-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpyaneti.py
executable file
·71 lines (53 loc) · 1.93 KB
/
pyaneti.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/python3.8
# -----------------------------------------------------------
# pyaneti.py
# Main pyaneti file
# Barragan O, March 2016
# -----------------------------------------------------------
# Load libraries
from __future__ import print_function, division, absolute_import
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys
import os
import pyaneti as pti # FORTRAN module
# -------------------------------------------------------------
# INITIALIZATION
# -------------------------------------------------------------
# Load the input file
# You have to run the program as ./pyaneti star_name
star = str(sys.argv[1])
# Create path to the input_fit.py file
inf_name = 'inpy/'+star+'/input_fit.py'
# Did you create an input_fit.py file?
if (not os.path.isfile(inf_name)):
print('You have not created', inf_name)
sys.exit()
# Read the file with all the python functions
exec(open('src/todo-py.py').read())
# Read the file with the default values
exec(open('src/default.py').read())
# Read input file
exec(open(inf_name).read())
# Prepare data
exec(open('src/prepare_data.py').read())
# Create ouput directory
outdir = outdir + star + '_out'
if not os.path.exists(outdir):
os.makedirs(outdir)
# Obtain smart priors based on iput data
if is_smart_priors:
smart_priors()
print_init()
# -------------------------------------------------------------
# FITTING ROUTINES
# -------------------------------------------------------------
joint_fit()
# -------------------------------------------------------------
# PRINT AND PLOT ROUTINES
# -------------------------------------------------------------
exec(open('src/output.py').read())
# -------------------------------------------------------------
# END pyaneti.py FILE
# -------------------------------------------------------------