species.data.model_data package#
Submodules#
species.data.model_data.custom_model module#
Module for adding a custom grid of model spectra to the database.
- species.data.model_data.custom_model.add_custom_model_grid(model_name: str, data_path: str, parameters: List[str], database: File, wavel_range: Tuple[float, float] | None, teff_range: Tuple[float, float] | None, wavel_sampling: float | None) None [source]#
Function for adding a custom grid of model spectra to the database. The spectra are read from the
data_path
and should contain themodel_name
andparameters
in the filenames in the following format example: model-name_teff_1000_logg_4.0_feh_0.0_spec.dat. The list withparameters
should contain the same parameters as are included in the filename. Each datafile should contain two columns with the wavelengths in \(\mu\text{m}\) and the fluxes in \(\text{W} \text{m}^{-2} \mu\text{m}^{-1}\). Each file should contain the same number and values of wavelengths. The wavelengths should be logarithmically sampled, so with a constant \(\lambda/\Delta\lambda\). If not, then thewavel_range
andwavel_sampling
parameters should be used such that the wavelengths are resampled when reading the data into thespecies
database.- Parameters:
model_name (str) – Name of the model grid. Should be identical to the model name that is included in the filenames.
data_path (str) – Path where the files with the model spectra are located.
parameters (list(str)) – List with the model parameters. The following parameters are supported:
teff
(for \(T_\mathrm{eff}\)),logg
(for \(\log\,g\)),feh
(for [Fe/H]),c_o_ratio
(for C/O),fsed
(for \(f_\mathrm{sed}\)),log_kzz
(for \(\log\,K_\mathrm{zz}\)), andad_index
(for \(\gamma_\mathrm{ad}\)). Please contact the code maintainer if support for other parameters should be added.database (h5py._hl.files.File) – Database.
wavel_range (tuple(float, float), None) – Wavelength range (\(\mu\text{m}\)). The original wavelength points are used if the argument is set to
None
.teff_range (tuple(float, float), None) – Effective temperature range (K) for adding a subset of the model grid. The full parameter grid will be added if the argument is set to
None
.wavel_sampling (float, None) – Wavelength spacing \(\lambda/\Delta\lambda\) to which the spectra will be resampled. Typically this parameter is not needed so the argument can be set to
None
. The only benefit of using this parameter is limiting the storage in the HDF5 database. The parameter should be used in combination with setting thewavel_range
.
- Returns:
None
- Return type:
NoneType
species.data.model_data.model_spectra module#
Module for adding a grid of model spectra to the database.
- species.data.model_data.model_spectra.add_model_grid(model_tag: str, input_path: str, database: File, wavel_range: Tuple[float, float] | None = None, teff_range: Tuple[float, float] | None = None, wavel_sampling: float | None = None, unpack_tar: bool = True) None [source]#
Function for adding a grid of model spectra to the database. The original spectra had been resampled to logarithmically- spaced wavelengths, so with at a constant \(\lambda/\Delta\lambda\). This function downloads the model grid, unpacks the tar file, and adds the spectra and parameters to the database.
- Parameters:
model_tag (str) – Tag of the grid of model spectra.
input_path (str) – Folder where the data is located.
database (h5py._hl.files.File) – HDF5 database.
wavel_range (tuple(float, float), None) – Wavelength range (\(\mu\text{m}\)). The original wavelength points are used if the argument is set to
None
.teff_range (tuple(float, float), None) – Range of effective temperatures (K) for which the spectra will be extracted from the TAR file and added to the database. All spectra are selected if the argument is set to
None
.wavel_sampling (float, None) – Wavelength spacing \(\lambda/\Delta\lambda\) to which the spectra will be resampled. Typically this parameter is not needed so the argument can be set to
None
. The only benefit of using this parameter is limiting the storage in the HDF5 database. The parameter should be used in combination with setting thewavel_range
.unpack_tar (bool) – Unpack the TAR file with the model spectra in the
data_folder
. The argument can be set toFalse
if the TAR file had already been unpacked previously.
- Returns:
None
- Return type:
NoneType