species.data package¶
Submodules¶
species.data.ames_cond module¶
Module for AMES-Cond atmospheric model spectra.
-
species.data.ames_cond.
add_ames_cond
(input_path, database, wavel_range, teff_range, spec_res)[source]¶ Function for adding the AMES-Cond atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float)) – Wavelength range (um).
- teff_range (tuple(float, float), None) – Effective temperature range (K).
- spec_res (float) – Spectral resolution.
Returns: None
Return type: NoneType
species.data.ames_dusty module¶
Module for AMES-Dusty atmospheric model spectra.
-
species.data.ames_dusty.
add_ames_dusty
(input_path, database, wavel_range, teff_range, spec_res)[source]¶ Function for adding the AMES-Dusty atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float)) – Wavelength range (um).
- teff_range (tuple(float, float), None) – Effective temperature range (K).
- spec_res (float) – Spectral resolution.
Returns: None
Return type: NoneType
species.data.btnextgen module¶
Module for BT-NextGen atmospheric model spectra.
-
species.data.btnextgen.
add_btnextgen
(input_path, database, wavel_range, teff_range, spec_res)[source]¶ Function for adding the BT-NextGen atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float)) – Wavelength range (um).
- teff_range (tuple(float, float), None) – Effective temperature range (K).
- spec_res (float) – Spectral resolution.
Returns: None
Return type: NoneType
species.data.btsettl module¶
Module for BT-Settl atmospheric model spectra.
-
species.data.btsettl.
add_btsettl
(input_path, database, wavel_range, teff_range, spec_res)[source]¶ Function for adding the BT-Settl atmospheric models (solar metallicity) to the database. The spectra are read line-by-line because the wavelength and flux are not separated in the input data.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float)) – Wavelength range (um).
- teff_range (tuple(float, float), None) – Effective temperature range (K).
- spec_res (float) – Spectral resolution.
Returns: None
Return type: NoneType
species.data.companions module¶
Module for extracting data of directly imaged planets and brown dwarfs.
-
species.data.companions.
get_data
()[source]¶ Function for extracting a dictionary with the distances (pc) and apparent magnitudes of directly imaged planets and brown dwarfs.
Returns: Dictionary with the distances and apparent magnitudes of directly imaged companions. Distances are from GAIA DR2 unless indicated as comment. Return type: dict
species.data.database module¶
Module with functionalities for reading and writing of data.
-
class
species.data.database.
Database
[source]¶ Bases:
object
Class for fitting atmospheric model spectra to photometric data.
Returns: None Return type: NoneType -
add_calibration
(tag, filename=None, data=None, units=None, scaling=None)[source]¶ Function for adding a calibration spectrum to the database.
Parameters: - tag (str) – Tag name in the database.
- filename (str, None) – Filename with the calibration spectrum. The first column should contain the wavelength (um), the second column the flux density (W m-2 um-1), and the third column the error (W m-2 um-1). The data argument is used if set to None.
- data (numpy.ndarray, None) – Spectrum stored as 3D array with shape (n_wavelength, 3). The first column should contain the wavelength (um), the second column the flux density (W m-2 um-1), and the third column the error (W m-2 um-1).
- units (dict, None) – Dictionary with the wavelength and flux units. Default (um and W m-2 um-1) is used if set to None.
- scaling (tuple(float, float)) – Scaling for the wavelength and flux as (scaling_wavelength, scaling_flux). Not used if set to None.
Returns: None
Return type: NoneType
-
add_companion
(name=None)[source]¶ Function for adding the magnitudes of directly imaged planets and brown dwarfs from
get_data
to the database.Parameters: name (list(str, ), None) – List with names of the directly imaged planets and brown dwarfs (e.g. ['HR 8799 b', '51 Eri b', 'PZ Tel B']
). All the available companion data are added if set to None.Returns: None Return type: NoneType
-
add_filter
(filter_name, filename=None)[source]¶ Function for adding a filter profile to the database, either from the SVO Filter profile Service or input file.
Parameters: - filter_name (str) – Filter name from the SVO Filter Profile Service (e.g., ‘Paranal/NACO.Lp’).
- filename (str) – Filename of the filter profile. The first column should contain the wavelength (um) and the second column the transmission. The profile is downloaded from the SVO Filter Profile Service if set to None.
Returns: None
Return type: NoneType
-
add_isochrones
(filename, tag, model='baraffe')[source]¶ Function for adding isochrones data to the database.
Parameters: - filename (str) – Filename with the isochrones data.
- tag (str) – Database tag name where the isochrone that will be stored.
- model (str) – Evolutionary model (‘baraffe’ or ‘marleau’). For ‘baraffe’ models, the isochrone data can be downloaded from https://phoenix.ens-lyon.fr/Grids/. For ‘marleau’ models, the data can be requested from Gabriel Marleau.
Returns: None
Return type: NoneType
-
add_model
(model, wavel_range=None, spec_res=None, teff_range=None, data_folder=None)[source]¶ Parameters: - model (str) – Model name (‘ames-cond’, ‘ames-dusty’, ‘bt-settl’, ‘bt-nextgen’, ‘drift-phoenix’, ‘petitcode-cool-clear’, ‘petitcode-cool-cloudy’, ‘petitcode-hot-clear’, ‘petitcode-hot-cloudy’, or ‘exo-rem’).
- wavel_range (tuple(float, float), None) – Wavelength range (um). Optional for the DRIFT-PHOENIX and petitCODE models. For these models, the original wavelength points are used if set to None. which case the argument can be set to None.
- spec_res (float, None) – Spectral resolution. Optional for the DRIFT-PHOENIX and petitCODE models, in which
case the argument is only used if
wavel_range
is not None. - teff_range (tuple(float, float), None) – Effective temperature range (K). Setting the value to None for will add all available temperatures.
- data_folder (str, None) – Folder with input data. Only required for the petitCODE hot models which are not publicly available.
Returns: None
Return type: NoneType
-
add_object
(object_name, distance=None, app_mag=None, spectrum=None)[source]¶ Function for adding the photometric and/or spectroscopic data of an object to the database.
Parameters: - object_name (str) – Object name that will be used as label in the database.
- distance (tuple(float, float), None) – Distance and uncertainty (pc). Not stored if set to None.
- app_mag (dict, None) – Dictionary with the filter names, apparent magnitudes, and uncertainties. For example,
{'Paranal/NACO.Lp': (15., 0.2), 'Paranal/NACO.Mp': (13., 0.3)}
. Not stored if set to None. - spectrum (dict, None) – Dictionary with the spectrum, optional covariance matrix, and spectral resolution for
each instrument. The input data can either have a FITS or ASCII format. The spectra
should have 3 columns with wavelength (um), flux (W m-2 um-1), and uncertainty
(W m-2 um-1). The covariance matrix should be 2D with the same number of wavelength
points as the spectrum. For example,
{'SPHERE': ('spectrum.dat', 'covariance.fits', 50.)}
. No covariance data is stored if set to None, for example,{'SPHERE': ('spectrum.dat', None, 50.)}
. Thespectrum
parameter is ignored if set to None. For GRAVITY data, the same FITS file can be provided as spectrum and covariance matrix.
Returns: None
Return type: NoneType
-
add_photometry
(phot_library)[source]¶ Parameters: phot_library (str) – Photometric library (‘vlm-plx’ or ‘leggett’). Returns: None Return type: NoneType
-
add_samples
(sampler, samples, ln_prob, mean_accept, spectrum, tag, modelpar, distance=None, spec_labels=None)[source]¶ Parameters: - sampler (emcee.ensemble.EnsembleSampler) – Ensemble sampler.
- spectrum (tuple(str, str)) – Tuple with the spectrum type (‘model’ or ‘calibration’) and spectrum name (e.g. ‘drift-phoenix’).
- tag (str) – Database tag.
- modelpar (list(str, )) – List with the model parameter names.
- distance (float) – Distance to the object (pc). Not used if set to None.
- spec_labels (list(str, )) – List with the spectrum labels that are used for fitting an additional scaling parameter.
Returns: None
Return type: NoneType
-
add_spectrum
(spec_library, sptypes=None)[source]¶ Parameters: - spec_library (str) – Spectral library (‘irtf’ or ‘spex’).
- sptypes (list(str, )) – Spectral types (‘F’, ‘G’, ‘K’, ‘M’, ‘L’, ‘T’). Currently only implemented for ‘irtf’.
Returns: None
Return type: NoneType
-
delete_data
(dataset)[source]¶ Function for deleting a dataset from the HDF5 database.
Parameters: dataset (str) – Dataset path in the HDF5 database. Returns: None Return type: NoneType
-
get_mcmc_photometry
(tag, burnin, filter_name)[source]¶ Parameters: - tag (str) – Database tag with the MCMC samples.
- burnin (int) – Number of burnin steps.
- filter_name (str) – Filter name for which the photometry is calculated.
Returns: Synthetic photometry (mag).
Return type: numpy.ndarray
-
get_mcmc_spectra
(tag, burnin, random, wavel_range, spec_res=None)[source]¶ Parameters: - tag (str) – Database tag with the MCMC samples.
- burnin (int) – Number of burnin steps.
- random (int) – Number of random samples.
- wavel_range (tuple(float, float), str, None) – Wavelength range (um) or filter name. Full spectrum if set to None.
- spec_res (float) – Spectral resolution that is used for the smoothing with a Gaussian kernel. No smoothing is applied if set to None.
Returns: Boxes with the randomly sampled spectra.
Return type: list(species.core.box.ModelBox, )
-
get_median_sample
(tag, burnin=None)[source]¶ Function for extracting the median parameter values from the MCMC samples.
Parameters: - tag (str) – Database tag with the MCMC results.
- burnin (int, None) – Number of burnin steps. No burnin is removed if set to None.
Returns: Parameters and values for the sample with the maximum posterior probability.
Return type: dict
-
get_object
(object_name, filters=None, inc_phot=True, inc_spec=True)[source]¶ Function for extracting the photometric and/or spectroscopic data of an object from the database. The spectroscopic data contains optionally the covariance matrix and its inverse.
Parameters: - object_name (str) – Object name in the database.
- filters (list(str, )) – Filter names for which the photometry is selected. All available photometry of the object is selected if set to None.
- inc_phot (bool) – Include photometry in the box.
- inc_spec (bool) – Include spectrum in the box.
Returns: Box with the object’s data.
Return type:
-
get_probable_sample
(tag, burnin)[source]¶ Function for extracting the sample parameters with the highest posterior probability.
Parameters: - tag (str) – Database tag with the MCMC results.
- burnin (int) – Number of burnin steps.
Returns: Parameters and values for the sample with the maximum posterior probability.
Return type: dict
-
get_samples
(tag, burnin=None, random=None)[source]¶ Parameters: - tag (str) – Database tag with the samples.
- burnin (int, None) – Number of burnin samples to exclude. All samples are selected if set to None.
- random (int, None) – Number of random samples to select. All samples (with the burnin excluded) are selected if set to None.
Returns: Box with the MCMC samples.
Return type:
-
species.data.drift_phoenix module¶
Module for DRIFT-PHOENIX atmospheric model spectra.
-
species.data.drift_phoenix.
add_drift_phoenix
(input_path, database, wavel_range=None, teff_range=None, spec_res=1000.0)[source]¶ Function for adding the DRIFT-PHOENIX atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float), None) – Wavelength range (um). The original wavelength points are used if set to None.
- teff_range (tuple(float, float), None) – Effective temperature range (K). All temperatures are selected if set to None.
- spec_res (float, None) – Spectral resolution. Not used if
wavel_range
is set to None.
Returns: None
Return type: NoneType
species.data.exo_rem module¶
Module for Exo-REM atmospheric model spectra.
-
species.data.exo_rem.
add_exo_rem
(input_path, database, wavel_range=None, teff_range=None, spec_res=1000.0)[source]¶ Function for adding the Exo-REM atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float), None) – Wavelength range (um). The original wavelength points are used if set to None.
- teff_range (tuple(float, float), None) – Effective temperature range (K). All temperatures are selected if set to None.
- spec_res (float, None) – Spectral resolution. Not used if
wavel_range
is set to None.
Returns: None
Return type: NoneType
species.data.filters module¶
Module for downloading filter data from the SVO website.
species.data.irtf module¶
Module for adding the IRTF Spectral Library to the database.
-
species.data.irtf.
add_irtf
(input_path, database, sptypes)[source]¶ Function for adding the IRTF Spectral Library to the database.
Parameters: - input_path (str) – Path of the data folder.
- database (h5py._hl.files.File) – Database.
- sptypes (tuple(str, )) – Spectral types (‘F’, ‘G’, ‘K’, ‘M’, ‘L’, ‘T’).
Returns: None
Return type: NoneType
species.data.isochrones module¶
Module for isochrone data of evolutionary models.
-
species.data.isochrones.
add_baraffe
(database, tag, filename)[source]¶ Function for adding the Baraffe et al. isochrone data to the database. Any of the isochrones from https://phoenix.ens-lyon.fr/Grids/ can be used as input.
https://ui.adsabs.harvard.edu/abs/2003A%26A…402..701B/
Parameters: - database (h5py._hl.files.File) – Database.
- tag (str) – Tag name in the database.
- filename (str) – Filename with the isochrones data.
Returns: None
Return type: NoneType
-
species.data.isochrones.
add_marleau
(database, tag, filename)[source]¶ Function for adding the Marleau et al. isochrone data to the database. The isochrone data can be requested from Gabriel Marleau.
https://ui.adsabs.harvard.edu/abs/2019A%26A…624A..20M/abstract
Parameters: - database (h5py._hl.files.File) – Database.
- tag (str) – Tag name in the database.
- filename (str) – Filename with the isochrones data.
Returns: None
Return type: NoneType
species.data.leggett module¶
Text
species.data.petitcode module¶
Module for petitCODE atmospheric model spectra.
-
species.data.petitcode.
add_petitcode_cool_clear
(input_path, database, wavel_range=None, teff_range=None, spec_res=1000.0)[source]¶ Function for adding the petitCODE cool clear atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float), None) – Wavelength range (um). The original wavelength points are used if set to None.
- teff_range (tuple(float, float), None) – Effective temperature range (K). All temperatures are selected if set to None.
- spec_res (float, None) – Spectral resolution. Not used if
wavel_range
is set to None.
Returns: None
Return type: NoneType
-
species.data.petitcode.
add_petitcode_cool_cloudy
(input_path, database, wavel_range=None, teff_range=None, spec_res=1000.0)[source]¶ Function for adding the petitCODE cool cloudy atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- wavel_range (tuple(float, float), None) – Wavelength range (um). The original wavelength points are used if set to None.
- teff_range (tuple(float, float), None) – Effective temperature range (K). All temperatures are selected if set to None.
- spec_res (float, None) – Spectral resolution. Not used if
wavel_range
is set to None.
Returns: None
Return type: NoneType
-
species.data.petitcode.
add_petitcode_hot_clear
(input_path, database, data_folder, wavel_range=None, teff_range=None, spec_res=1000.0)[source]¶ Function for adding the petitCODE hot clear atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- data_folder (str) – Path with input data.
- wavel_range (tuple(float, float), None) – Wavelength range (um). The original wavelength points are used if set to None.
- teff_range (tuple(float, float), None) – Effective temperature range (K). All temperatures are selected if set to None.
- spec_res (float, None) – Spectral resolution. Not used if
wavel_range
is set to None.
Returns: None
Return type: NoneType
-
species.data.petitcode.
add_petitcode_hot_cloudy
(input_path, database, data_folder, wavel_range=None, teff_range=None, spec_res=1000.0)[source]¶ Function for adding the petitCODE hot cloudy atmospheric models to the database.
Parameters: - input_path (str) – Folder where the data is located.
- database (h5py._hl.files.File) – Database.
- data_folder (str) – Path with input data.
- wavel_range (tuple(float, float), None) – Wavelength range (um). The original wavelength points are used if set to None.
- teff_range (tuple(float, float), None) – Effective temperature range (K). All temperatures are selected if set to None.
- spec_res (float, None) – Spectral resolution. Not used if
wavel_range
is set to None.
Returns: None
Return type: NoneType
species.data.spex module¶
Module for adding the SpeX Prism Spectral Libraries to the database.
species.data.vega module¶
Text
species.data.vlm_plx module¶
Module for the photometric data and parallaxes from the Database of Ultracool Parallaxes.