Skip to content

Commit

Permalink
Added support for clear and cloudy petitCODE grid from Linder et al. …
Browse files Browse the repository at this point in the history
…(2019)
  • Loading branch information
tomasstolker committed Oct 15, 2023
1 parent 87ebe56 commit 04d84c3
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 6 deletions.
22 changes: 21 additions & 1 deletion species/data/model_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"reference": "Phillips et al. (2020)",
"url": "https://ui.adsabs.harvard.edu/abs/2020A%26A...637A..38P/abstract"
},
"petrus2023": {
"atmo-petrus2023": {
"parameters": ["teff", "logg", "feh", "c_o_ratio", "ad_index"],
"name": "ATMO (Petrus et al. 2023)",
"file size": "2.1 GB",
Expand Down Expand Up @@ -212,6 +212,26 @@
"reference": "Mollière et al. (2015)",
"url": "https://ui.adsabs.harvard.edu/abs/2015ApJ...813...47M/abstract"
},
"petitcode-linder2019-clear": {
"parameters": ["teff", "logg", "feh"],
"name": "petitCODE (Linder et al. 2019)",
"file size": "225 MB",
"wavelength range": [0.1, 250],
"resolution": 1000,
"teff range": [150, 1000],
"reference": "Linder et al. (2019)",
"url": "https://ui.adsabs.harvard.edu/abs/2019A%26A...623A..85L/abstract"
},
"petitcode-linder2019-cloudy": {
"parameters": ["teff", "logg", "feh", "fsed"],
"name": "petitCODE hot cloudy",
"file size": "1.4 GB",
"wavelength range": [0.1, 250],
"resolution": 1000,
"teff range": [150, 1000],
"reference": "Linder et al. (2019)",
"url": "https://ui.adsabs.harvard.edu/abs/2019A%26A...623A..85L/abstract"
},
"saumon2008-clear": {
"parameters": ["teff", "logg"],
"name": "Saumon & Marley (2008) clear",
Expand Down
32 changes: 32 additions & 0 deletions species/read/read_isochrone.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,40 @@ def __init__(
"atmo-neq-strong": "atmo-neq-strong",
"atmo-neq-weak": "atmo-neq-weak",
"bt-settl": "bt-settl",
"linder2019-petitCODE-metal_-0.4": "petitcode-linder2019-clear",
"linder2019-petitCODE-metal_0.0": "petitcode-linder2019-clear",
"linder2019-petitCODE-metal_0.4": "petitcode-linder2019-clear",
"linder2019-petitCODE-metal_0.8": "petitcode-linder2019-clear",
"linder2019-petitCODE-metal_1.2": "petitcode-linder2019-clear",
"linder2019-petitCODE-metal_-0.4-fsed_1.0": "petitcode-linder2019-cloudy",
"linder2019-petitCODE-metal_0.0-fsed_1.0": "petitcode-linder2019-cloudy",
"linder2019-petitCODE-metal_0.4-fsed_1.0": "petitcode-linder2019-cloudy",
"linder2019-petitCODE-metal_0.8-fsed_1.0": "petitcode-linder2019-cloudy",
"linder2019-petitCODE-metal_1.2-fsed_1.0": "petitcode-linder2019-cloudy",
"saumon2008-nc_solar": "saumon2008-clear",
"saumon2008-f2_solar": "saumon2008-cloudy",
"sonora+0.0": "sonora-bobcat",
}

# Set attribute with extra parameters
# The attribute will be overwritten by any of
# the methods that have the extra_param parameter

self.extra_param = None

if self.tag.split("-")[0] == "linder2019":
self.extra_param = {}
tag_split = self.tag.split("_")

if len(tag_split) == 2:
self.extra_param['feh'] = float(tag_split[1])

elif len(tag_split) == 3:
self.extra_param['feh'] = float(tag_split[1][:-5])
self.extra_param['fsed'] = float(tag_split[2])

print(f"Setting 'extra_param' attribute: {self.extra_param}")

@typechecked
def _read_data(
self,
Expand Down Expand Up @@ -385,6 +414,9 @@ def _update_param(
the evolutionary model.
"""

if len(extra_param) == 0 and self.extra_param is not None:
extra_param = self.extra_param.copy()

for key, value in param_bounds.items():
if key not in model_param:
if key in extra_param:
Expand Down
2 changes: 1 addition & 1 deletion species/read/read_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def open_database(self) -> h5py._hl.files.File:
"If this does not work (e.g. currently without an "
"internet connection) then please use the "
"'add_model' method of 'Database' to add the "
"grid of spectra yourself."
"grid of spectra at a later moment."
)

species_db = database.Database()
Expand Down
17 changes: 13 additions & 4 deletions species/util/plot_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,9 @@ def convert_model_name(in_name: str) -> str:
elif in_name == "petrus2023":
out_name = "ATMO (Petrus et al. 2023)"

elif in_name == "atmo-petrus2023":
out_name = "ATMO (Petrus et al. 2023)"

elif in_name == "bt-cond":
out_name = "BT-Cond"

Expand All @@ -895,16 +898,22 @@ def convert_model_name(in_name: str) -> str:
out_name = "BT-NextGen"

elif in_name == "petitcode-cool-clear":
out_name = "petitCODE"
out_name = "petitCODE clear"

elif in_name == "petitcode-cool-cloudy":
out_name = "petitCODE"
out_name = "petitCODE cloudy"

elif in_name == "petitcode-hot-clear":
out_name = "petitCODE"
out_name = "petitCODE clear"

elif in_name == "petitcode-hot-cloudy":
out_name = "petitCODE"
out_name = "petitCODE cloudy"

elif in_name == "petitcode-linder2019-clear":
out_name = "petitCODE clear (Linder et al. 2019)"

elif in_name == "petitcode-linder2019-cloudy":
out_name = "petitCODE cloudy (Linder et al. 2019)"

elif in_name == "exo-rem":
out_name = "Exo-REM"
Expand Down

0 comments on commit 04d84c3

Please sign in to comment.