Skip to content

Commit

Permalink
Update: input data path
Browse files Browse the repository at this point in the history
Update: input data path is now handled as a environment variable
  • Loading branch information
lorenaacuna authored Dec 16, 2024
1 parent 9ea2b72 commit 9bcce9a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 32 deletions.
5 changes: 1 addition & 4 deletions Examples/HAT-P-26b_thermal_seq_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import gastli.Thermal_evolution as therm
# Other Python modules
import numpy as np
# Path to input files
# Dont forget the "/" at the end of the string
path_input = "/Users/acuna/Desktop/gastli_input_data/"
# Create thermal evolution class object
my_therm_obj = therm.thermal_evolution(path_to_file=path_input)
my_therm_obj = therm.thermal_evolution()
# Input for interior
M_P = 18.76 # Earth units
# Equilibrium temperatures
Expand Down
6 changes: 1 addition & 5 deletions Examples/HAT-P-26b_thermal_solve_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
from scipy import interpolate
import pandas as pd

# Path to input files
# Dont forget the "/" at the end of the string
path_input = "/Users/acuna/Desktop/gastli_input_data/"

# Create thermal evolution class
my_therm_obj = therm.thermal_evolution(path_to_file=path_input)
my_therm_obj = therm.thermal_evolution()

# Read in data saved in step 1
data = pd.read_csv('thermal_sequence_HATP26b_CMF50_20xsolar.dat', sep='\s+',header=None,skiprows=1)
Expand Down
6 changes: 2 additions & 4 deletions Examples/Jupiter_MRrel_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import gastli.Coupling as cpl
# Other Python modules
import numpy as np
# Path to input files
# Dont forget the "/" at the beginning and end of the string
path_input = "/Users/acuna/Desktop/gastli_input_data/"

# Input for interior
## 1 Mjup in Mearth units
Mjup = 318.
Expand Down Expand Up @@ -34,7 +32,7 @@
print('Model = ', k+ 1, ' out of ', n_mrel)
print('---------------')
# Create coupling class (this also resets parameters)
my_coupling = cpl.coupling(path_to_file=path_input, pow_law_formass=0.31)
my_coupling = cpl.coupling(pow_law_formass=0.31)
# Case 1, log(Fe/H) is known
# You must have FeH_flag=True, which is the default value
my_coupling.main(M_P_model, CMF, Teqpl, Tintpl, CO=0.55, log_FeH=0.)
Expand Down
7 changes: 4 additions & 3 deletions Examples/Jupiter_metal_content_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import gastli.Coupling as cpl
# Other Python modules
import numpy as np
# Specify path to input data folder
path_to_input = "/Users/acuna/Desktop/gastli_input_data/"
import os


# Initialise coupling class
my_coupling = cpl.coupling(path_to_file=path_to_input)
my_coupling = cpl.coupling()

# Input for interior
# 1 Mjup in Mearth units
Expand Down
5 changes: 2 additions & 3 deletions Examples/Jupiter_profiles_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import gastli.constants as cte
import matplotlib.pyplot as plt

# Specify path to input data folder
path_to_input = "/Users/acuna/Desktop/gastli_input_data/"

# Initialise coupling class
my_coupling = cpl.coupling(path_to_file=path_to_input)
my_coupling = cpl.coupling()

# Input for interior
# 1 Mjup in Mearth units
Expand Down
5 changes: 1 addition & 4 deletions Examples/complete_thermal_curve_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
# Other Python modules
import numpy as np
import matplotlib.pyplot as plt
# Path to input files
# Dont forget the "/" at the end of the string
path_input = "/Users/acuna/Desktop/gastli_input_data/"
# Create thermal evolution class object
my_therm_obj = therm.thermal_evolution(path_to_file=path_input)
my_therm_obj = therm.thermal_evolution()
# Input for interior
M_P = 100. # Earth units
# Equilibrium temperatures
Expand Down
3 changes: 1 addition & 2 deletions Examples/convergence_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

# Create coupling class
# Time initialization time
my_coupling = cpl.coupling(path_to_file="/Users/acuna/Desktop/gastli_input_data/",\
j_max=99, pow_law_formass=0.31)
my_coupling = cpl.coupling(j_max=99, pow_law_formass=0.31)



Expand Down
3 changes: 1 addition & 2 deletions Examples/psurf_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

# Create coupling class
# Time initialization time
my_coupling = cpl.coupling(path_to_file="/Users/acuna/Desktop/gastli_input_data/",\
j_max=99, pow_law_formass=0.31)
my_coupling = cpl.coupling(j_max=99, pow_law_formass=0.31)



Expand Down
8 changes: 3 additions & 5 deletions Examples/water_phase_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import gastli.water_curves as water_curv
import gastli.Coupling as cpl

path_to_input = "/Users/acuna/Desktop/gastli_input_data/"

my_coupling = cpl.coupling(path_to_file=path_to_input)
my_coupling = cpl.coupling()


# Input for interior
Expand All @@ -29,11 +27,11 @@
# Run coupled interior-atmosphere model
my_coupling.main(M_P, CMF, Teqpl, Tintpl, CO=CO_planet, log_FeH=log_FeHpl,Rguess=6.)

my_coupling_hot = cpl.coupling(path_to_file=path_to_input)
my_coupling_hot = cpl.coupling()
my_coupling_hot.main(M_P, CMF, 1000., Tintpl, CO=CO_planet, log_FeH=log_FeHpl,Rguess=6.)


water_phase_lines = water_curv.water_curves(path_to_input)
water_phase_lines = water_curv.water_curves()


fig,ax = plt.subplots(nrows=1,ncols=1)
Expand Down

0 comments on commit 9bcce9a

Please sign in to comment.