Skip to content

Commit

Permalink
Added support for the SPHINX model spectra
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstolker committed Sep 25, 2023
1 parent 0d35df1 commit 8a97e92
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ The following data and models are currently supported:
- `Morley et al. (2012) T/Y dwarf spectra <https://ui.adsabs.harvard.edu/abs/2012ApJ...756..172M/abstract>`_
- `petitCODE <http://www.mpia.de/~molliere/#petitcode>`_
- `petitRADTRANS <https://petitradtrans.readthedocs.io>`_
- `Saumon & Marley (2008) <https://ui.adsabs.harvard.edu/abs/2008ApJ...689.1327S/abstract>`_
- `Sonora Bobcat <https://zenodo.org/record/5063476>`_
- `Sonora Cholla <https://zenodo.org/record/4450269>`_
- `Saumon & Marley (2008) <https://ui.adsabs.harvard.edu/abs/2008ApJ...689.1327S/abstract>`_
- `SPHINX <https://zenodo.org/record/7416042>`_

.. tip::
It is also possible to add your own custom grid of model spectra with :func:`~species.data.database.Database.add_custom_model()`. Have a look at the documentation for details on the required file format.
Expand Down
2 changes: 1 addition & 1 deletion species/data/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def add_model(
'blackbody', bt-cond', 'bt-cond-feh, 'morley-2012',
'sonora-cholla', 'sonora-bobcat', 'sonora-bobcat-co',
'koester-wd', 'saumon2008-clear', 'saumon2008-cloudy',
'petrus2023').
'petrus2023', 'sphinx').
wavel_range : tuple(float, float), None
Wavelength range (um) for adding a subset of the spectra.
The full wavelength range is used if the argument is set
Expand Down
10 changes: 10 additions & 0 deletions species/data/model_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,15 @@
"information": "[Fe/H] = 0.0, log(g) = 5.0",
"reference": "Marley et al. (2021)",
"url": "https://zenodo.org/record/5063476"
},
"sphinx": {
"parameters": ["teff", "logg", "feh", "c_o_ratio"],
"name": "SPHINX",
"file size": "143 Mb",
"wavelength range": [0.1, 20],
"resolution": 250,
"teff range": [2000, 4000],
"reference": "Aishwarya et al. (2022)",
"url": "https://zenodo.org/record/7416042"
}
}
17 changes: 9 additions & 8 deletions species/data/model_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ def add_model_grid(
else:
raise ValueError(
f"The {model_name} atmospheric model is not available. "
f"Please choose one of the following models: "
f"'ames-cond', 'ames-dusty', 'atmo', 'bt-settl', "
f"'bt-nextgen', 'drift-phoexnix', 'petitcode-cool-clear', "
f"'petitcode-cool-cloudy', 'petitcode-hot-clear', "
f"'petitcode-hot-cloudy', 'exo-rem', 'bt-settl-cifist', "
f"'bt-cond', 'bt-cond-feh', 'blackbody', 'sonora-cholla', "
f"'sonora-bobcat', 'sonora-bobcat-co', 'koester-wd', "
f"'saumon2008-clear', 'saumon2008-cloudy', 'petrus2023' "
"Please choose one of the following models: "
"'ames-cond', 'ames-dusty', 'atmo', 'bt-settl', "
"'bt-nextgen', 'drift-phoexnix', 'petitcode-cool-clear', "
"'petitcode-cool-cloudy', 'petitcode-hot-clear', "
"'petitcode-hot-cloudy', 'exo-rem', 'bt-settl-cifist', "
"'bt-cond', 'bt-cond-feh', 'blackbody', 'sonora-cholla', "
"'sonora-bobcat', 'sonora-bobcat-co', 'koester-wd', "
"'saumon2008-clear', 'saumon2008-cloudy', 'petrus2023', "
"'sphinx'"
)

if model_name == "bt-settl":
Expand Down
4 changes: 2 additions & 2 deletions species/read/read_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,8 +1121,8 @@ def get_model(
if np.isnan(np.sum(model_box.flux)):
warnings.warn(
f"The resampled spectrum contains {np.sum(np.isnan(model_box.flux))} "
f"NaNs, probably because the original wavelength range does not fully "
f"encompass the new wavelength range. The happened with the "
"NaNs, probably because the original wavelength range does not fully "
"encompass the new wavelength range. The happened with the "
f"following parameters: {model_param}."
)

Expand Down
3 changes: 3 additions & 0 deletions species/util/plot_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,9 @@ def convert_model_name(in_name: str) -> str:
elif in_name == "sonora-bobcat-co":
out_name = "Sonora Bobcat C/O"

elif in_name == "sphinx":
out_name = "SPHINX"

elif in_name == "petitradtrans":
out_name = "petitRADTRANS"

Expand Down

0 comments on commit 8a97e92

Please sign in to comment.