species.data package

Submodules

species.data.allers2013 module

Module for adding young, M- and L-type dwarf spectra from Allers & Liu (2013) to the database. All spectra are also available in the SpeX Prism Library Analysis Toolkit.

species.data.allers2013.add_allers2013(input_path: str, database: h5py._hl.files.File) None[source]

Function for adding the spectra of young, M- and L-type dwarfs from Allers & Liu (2013) to the database.

Parameters
  • input_path (str) – Path of the data folder.

  • database (h5py._hl.files.File) – The HDF5 database.

Returns

None

Return type

NoneType

species.data.ames_cond module

Module for AMES-Cond atmospheric model spectra.

species.data.ames_cond.add_ames_cond(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: float = None) None[source]

Function for adding the AMES-Cond atmospheric models to the database. The original spectra have been resampled to a spectral resolution of R = 2000 from 0.5 to 40 um.

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 full wavelength range (0.5-40 um) is stored if set to None. Only used in combination with spec_res.

  • teff_range (tuple(float, float), None) – Effective temperature range (K). All available temperatures are stored if set to None.

  • spec_res (float, None) – Spectral resolution. The data is stored with the spectral resolution of the input spectra (R = 2000) if set to None. Only used in combination with wavel_range.

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: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: float = None) None[source]

Function for adding the AMES-Dusty atmospheric models to the database. The original spectra have been resampled to a spectral resolution of R = 2000 from 0.5 to 40 um.

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 full wavelength range (0.5-40 um) is stored if set to None. Only used in combination with spec_res.

  • teff_range (tuple(float, float), None) – Effective temperature range (K). All available temperatures are stored if set to None.

  • spec_res (float, None) – Spectral resolution. The data is stored with the spectral resolution of the input spectra (R = 2000) if set to None. Only used in combination with wavel_range.

Returns

None

Return type

NoneType

species.data.atmo module

Module for ATMO 2020 atmospheric model spectra.

species.data.atmo.add_atmo(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]], teff_range: Optional[Tuple[float, float]], spec_res: Optional[float]) None[source]

Function for adding the ATMO 2020 atmospheric models to the database. The spectra have been calculated with equilibrium chemistry and solar metallicity in the Teff range from 200 to 3000 K. The spectra have been downloaded from the Theoretical spectra web server (http://svo2.cab.inta-csic.es/svo/theory/newov2/index.php?models=atmo2020_ceq) and resampled to a spectral resolution of 5000 from 0.3 to 100 um.

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.blackbody module

Module for blackbody model spectra.

species.data.blackbody.add_blackbody(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]], teff_range: Optional[Tuple[float, float]], spec_res: Optional[float]) None[source]

Function for adding the blackbody atmospheric models to the database. The spectra have been calculated for Teff from 10 to 5000 K at spectral resolution of 1000 from 0.1 um to 5 mm.

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.bonnefoy2014 module

Module for adding young, M- and L-type dwarf spectra from Bonnefoy et al. (2014) to the database.

species.data.bonnefoy2014.add_bonnefoy2014(input_path: str, database: h5py._hl.files.File) None[source]

Function for adding the SINFONI spectra of young, M- and L-type dwarfs from Bonnefoy et al. (2014) to the database.

Parameters
  • input_path (str) – Path of the data folder.

  • database (h5py._hl.files.File) – The HDF5 database.

Returns

None

Return type

NoneType

species.data.btcond module

Module for BT-Cond atmospheric model spectra.

species.data.btcond.add_btcond(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]], teff_range: Optional[Tuple[float, float]], spec_res: Optional[float]) None[source]

Function for adding the BT-Cond atmospheric models (solar metallicity) to the database. The spectra have been downloaded from the Theoretical spectra web server (http://svo2.cab.inta-csic.es/svo/theory/newov2/index.php?models=bt-cond) and resampled to a spectral resolution of 5000 from 0.1 to 100 um.

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.btcond_feh module

Module for BT-Cond atmospheric model spectra with Teff > 2500 K and [Fe/H] as free parameter.

species.data.btcond_feh.add_btcond_feh(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]], teff_range: Optional[Tuple[float, float]], spec_res: Optional[float]) None[source]

Function for adding the BT-Cond atmospheric models with Teff > 2500 K to the database. The spectra have been downloaded from the Theoretical spectra web server (http://svo2.cab.inta-csic.es/svo/theory/newov2/index.php?models=bt-cond) and resampled to a spectral resolution of 5000 from 0.1 to 100 um. The metallicity is also a free parameter.

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.btnextgen module

Module for BT-NextGen atmospheric model spectra.

species.data.btnextgen.add_btnextgen(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: float = None) None[source]

Function for adding the BT-NextGen atmospheric models to the database. The original spectra have been resampled to a spectral resolution of R = 2000 from 0.1 to 50 um.

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 full wavelength range (0.1-50 um) is stored if set to None. Only used in combination with spec_res.

  • teff_range (tuple(float, float), None) – Effective temperature range (K). All available temperatures are stored if set to None.

  • spec_res (float, None) – Spectral resolution. The data is stored with the spectral resolution of the input spectra (R = 2000) if set to None. Only used in combination with wavel_range.

Returns

None

Return type

NoneType

species.data.btsettl module

Module for BT-Settl atmospheric model spectra.

species.data.btsettl.add_btsettl(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]], teff_range: Optional[Tuple[float, float]], spec_res: Optional[float]) None[source]

Function for adding the BT-Settl atmospheric models (solar metallicity) to the database. The spectra have been downloaded from the Theoretical spectra web server (http://svo2.cab.inta-csic.es/svo/theory/newov2/index.php?models=bt-settl) and resampled to a spectral resolution of 5000 from 0.1 to 100 um. For Teff > 2500 K, these are BT-NextGen spectra instead of BT-Settl.

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.btsettl_cifist module

Module for BT-Settl atmospheric model spectra.

species.data.btsettl_cifist.add_btsettl(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]], teff_range: Optional[Tuple[float, float]], spec_res: Optional[float]) None[source]

Function for adding the BT-Settl-CIFIST atmospheric models (solar metallicity) to the database. The spectra had been downloaded from the Theoretical spectra web server (http://svo2.cab.inta-csic.es/svo/theory/newov2/index.php?models=bt-settl-cifist) and resampled to a spectral resolution of 5000 from 0.1 to 100 um.

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.companions module

Module for extracting data of directly imaged planets and brown dwarfs.

species.data.companions.companion_spectra(input_path: str, comp_name: str) Optional[Dict[str, Tuple[str, Optional[str], float]]][source]

Function for getting available spectra of directly imaged planets and brown dwarfs.

Parameters
  • input_path (str) – Path of the data folder.

  • comp_name (str) – Companion name for which the spectra will be returned.

Returns

Dictionary with the spectra of comp_name. A None will be returned if there are not any spectra available.

Return type

dict, None

species.data.companions.get_data() Dict[str, Dict[str, Union[bool, Tuple[float, float], Dict[str, Union[Tuple[float, float], List[Tuple[float, float]]]]]]][source]

Function for extracting a dictionary with the distances (pc) and apparent magnitudes of directly imaged planets and brown dwarfs. These data can be added to the database with add_companion().

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.companions.get_spec_data() Dict[str, Dict[str, Tuple[str, Optional[str], float, str]]][source]

Function for extracting a dictionary with the spectra of directly imaged planets. These data can be added to the database with add_companion().

Returns

Dictionary with the spectrum, optional covariances, spectral resolution, and filename.

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 with reading and writing functionalities for the HDF5 database.

Returns

None

Return type

NoneType

add_calibration(tag: str, filename: Optional[str] = None, data: Optional[numpy.ndarray] = None, units: Optional[Dict[str, str]] = None, scaling: Optional[Tuple[float, float]] = None) 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 (np.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). The filename argument is used if set to None.

  • units (dict, None) – Dictionary with the wavelength and flux units, e.g. {'wavelength': 'angstrom', 'flux': 'w m-2'}. The default units (um and W m-2 um-1) are used if set to None.

  • scaling (tuple(float, float), None) – 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: Union[str, None, List[str]] = None) None[source]

Function for adding the magnitudes and spectra of directly imaged planets and brown dwarfs from get_data and get_comp_spec to the database.

Parameters

name (str, list(str), None) – Name or list with names of the directly imaged planets and brown dwarfs (e.g. 'HR 8799 b' or ['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_comparison(tag: str, goodness_of_fit: numpy.ndarray, flux_scaling: numpy.ndarray, model_param: List[str], coord_points: List[numpy.ndarray], object_name: str, spec_name: List[str], model: str, scale_spec: List[str], extra_scaling: Optional[numpy.ndarray]) None[source]
Parameters
  • tag (str) – Database tag where the results will be stored.

  • goodness_of_fit (np.ndarray) – Array with the goodness-of-fit values.

  • flux_scaling (np.ndarray) – Array with the best-fit scaling values to match the model spectra with the data.

  • model_param (list(str)) – List with the names of the model parameters.

  • coord_points (list(np.ndarray)) – List with 1D arrays of the model grid points, in the same order as model_param.

  • object_name (str) – Object name as stored in the database with add_object() or add_companion().

  • spec_name (list(str)) – List with spectrum names that are stored at the object data of object_name.

  • model (str) – Atmospheric model grid that is used for the comparison.

  • scale_spec (list(str)) – List with spectrum names to which an additional scaling has been applied.

  • extra_scaling (np.ndarray. None) – Array with extra scalings that have been applied to the spectra of scale_spec. The argument can be set to None if no extra scalings have been applied.

Returns

None

Return type

NoneType

add_dust() None[source]

Function for adding optical constants of MgSiO3 and Fe, and MgSiO3 cross sections for a log-normal and power-law size distribution to the database. The optical constants have been compiled by Mollière et al. (2019) for petitRADTRANS from the following sources:

  • MgSiO3, crystalline
    • Scott & Duley (1996), ApJS, 105, 401

    • Jäger et al. (1998), A&A, 339, 904

  • MgSiO3, amorphous
    • Jäger et al. (2003), A&A, 408, 193

  • Fe, crystalline
    • Henning & Stognienko (1996), A&A, 311, 291

  • Fe, amorphous
    • Pollack et al. (1994), ApJ, 421, 615

Returns

None

Return type

NoneType

add_empirical(tag: str, names: List[str], sptypes: List[str], goodness_of_fit: List[float], flux_scaling: List[numpy.ndarray], av_ext: List[float], rad_vel: List[float], object_name: str, spec_name: List[str], spec_library: str) None[source]
Parameters
  • tag (str) – Database tag where the results will be stored.

  • names (list(str)) – Array with the names of the empirical spectra.

  • sptypes (list(str)) – Array with the spectral types of names.

  • goodness_of_fit (list(float)) – Array with the goodness-of-fit values.

  • flux_scaling (list(np.ndarray)) – List with arrays with the best-fit scaling values to match the library spectra with the data. The size of each array is equal to the number of spectra that are provided as argument of spec_name.

  • av_ext (list(float)) – Array with the visual extinction \(A_V\).

  • rad_vel (list(float)) – Array with the radial velocities (km s-1).

  • object_name (str) – Object name as stored in the database with add_object() or add_companion().

  • spec_name (list(str)) – List with spectrum names that are stored at the object data of object_name.

  • spec_library (str) – Name of the spectral library that was used for the empirical comparison.

Returns

None

Return type

NoneType

add_filter(filter_name: str, filename: Optional[str] = None, detector_type: str = 'photon') None[source]

Function for adding a filter profile to the database, either from the SVO Filter profile Service or from an input file. Additional filters that are automatically added are Magellan/VisAO.rp, Magellan/VisAO.ip, Magellan/VisAO.zp, Magellan/VisAO.Ys, ALMA/band6, and ALMA/band7.

Parameters
  • filter_name (str) – Filter name from the SVO Filter Profile Service (e.g., ‘Paranal/NACO.Lp’) or a user-defined name if a filename is specified.

  • filename (str) – Filename of the filter profile. The first column should contain the wavelength (um) and the second column the fractional transmission. The profile is downloaded from the SVO Filter Profile Service if the argument of filename is set to None.

  • detector_type (str) – The detector type (‘photon’ or ‘energy’). The argument is only used if a filename is provided. Otherwise, for filters that are fetched from the SVO website, the detector type is read from the SVO data. The detector type determines if a wavelength factor is included in the integral for the synthetic photometry.

Returns

None

Return type

NoneType

add_isochrones(filename: str, tag: str, model: str = 'baraffe') None[source]

Function for adding isochrone data to the database.

Parameters
  • filename (str) – Filename with the isochrone 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: str, wavel_range: Optional[Tuple[float, float]] = None, spec_res: Optional[float] = None, teff_range: Optional[Tuple[float, float]] = None, data_folder: Optional[str] = None) None[source]

Method for adding a grid of model spectra to the database. All spectra have been resampled to a lower, constant spectral resolution (typically \(R = 5000\)).

Parameters
  • model (str) – Model name (‘ames-cond’, ‘ames-dusty’, ‘atmo’, ‘bt-settl’, ‘bt-settl-cifist’, ‘bt-nextgen’, ‘drift-phoenix’, ‘petitcode-cool-clear’, ‘petitcode-cool-cloudy’, ‘petitcode-hot-clear’, ‘petitcode-hot-cloudy’, ‘exo-rem’, ‘blackbody’, bt-cond’, ‘bt-cond-feh, ‘morley-2012’).

  • 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 to None.

  • spec_res (float, None) – Spectral resolution to which the spectra will be resampled. This parameter is optional since the spectra have already been resampled to a lower, constant resolution (typically \(R = 5000\)). The argument is only used if wavel_range is not 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.

  • data_folder (str, None) – DEPRECATED: Folder where the input data is located. This parameter is no longer in use since all model spectra are publicly available. The parameter will be removed in a future release.

Returns

None

Return type

NoneType

add_object(object_name: str, distance: Optional[Tuple[float, float]] = None, app_mag: Optional[Dict[str, Union[Tuple[float, float], List[Tuple[float, float]]]]] = None, flux_density: Optional[Dict[str, Tuple[float, float]]] = None, spectrum: Optional[Dict[str, Tuple[str, Optional[str], Optional[float]]]] = None, deredden: Union[Dict[str, float], float] = None) 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)}. For the use of duplicate filter names, the magnitudes have to be provided in a list, for example {'Paranal/NACO.Lp': [(15., 0.2), (14.5, 0.5)], 'Paranal/NACO.Mp': (13., 0.3)}. No photometric data is stored if set to None.

  • flux_density (dict, None) – Dictionary with filter names, flux densities (W m-2 um-1), and uncertainties (W m-1 um-1). For example, {'Paranal/NACO.Lp': (1e-15, 1e-16)}. Currently, the use of duplicate filters is not implemented. The use of app_mag is preferred over flux_density because with flux_density only fluxes are stored while with app_mag both magnitudes and fluxes. However, flux_density can be used in case the magnitudes and/or filter profiles are not available. In that case, the fluxes can still be selected with inc_phot in FitModel. The argument of flux_density is ignored 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.)}. The spectrum parameter is ignored if set to None. For GRAVITY data, the same FITS file can be provided as spectrum and covariance matrix.

  • deredden (dict, float, None) – Dictionary with spectrum and app_mag names that will de dereddened with the provided A_V. For example, deredden={'SPHERE': 1.5, 'Keck/NIRC2.J': 1.5} will deredden the provided spectrum named ‘SPHERE’ and the Keck/NIRC2 J-band photometry with a visual extinction of 1.5. For photometric fluxes, the filter-averaged extinction is used for the dereddening.

Returns

None

Return type

NoneType

add_photometry(phot_library: str) None[source]
Parameters

phot_library (str) – Photometric library (‘vlm-plx’ or ‘leggett’).

Returns

None

Return type

NoneType

add_retrieval(tag: str, output_folder: str, inc_teff: bool = False) None[source]

Function for adding the output data from the atmospheric retrieval with AtmosphericRetrieval to the database.

Parameters
  • tag (str) – Database tag to store the posterior samples.

  • output_folder (str) – Output folder that was used for the output files by MultiNest.

  • inc_teff (bool) – Calculate Teff for each sample by integrating the model spectrum from 0.5 to 50 um. The Teff samples are added to the array with samples that are stored in the database. The computation time for adding Teff will be long because the spectra need to be calculated and integrated for all samples.

Returns

None

Return type

NoneType

add_samples(sampler: str, samples: numpy.ndarray, ln_prob: numpy.ndarray, ln_evidence: Optional[Tuple[float, float]], mean_accept: Optional[float], spectrum: Tuple[str, str], tag: str, modelpar: List[str], distance: Optional[float], spec_labels: Optional[List[str]])[source]
Parameters
  • sampler (str) – Sampler (‘emcee’, ‘multinest’, or ‘ultranest’).

  • samples (np.ndarray) – Samples of the posterior.

  • ln_prob (np.ndarray) – Log posterior for each sample.

  • ln_evidence (tuple(float, float)) – Log evidence and uncertainty. Set to None when sampler is ‘emcee’.

  • mean_accept (float, None) – Mean acceptance fraction. Set to None when sampler is ‘multinest’ or ‘ultranest’.

  • 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, None) – Distance to the object (pc). Not used if set to None.

  • spec_labels (list(str), None) – List with the spectrum labels that are used for fitting an additional scaling parameter. Not used if set to None.

Returns

None

Return type

NoneType

add_spectra(spec_library: str, sptypes: Optional[List[str]] = None) None[source]
Parameters
  • spec_library (str) – Spectral library (‘irtf’, ‘spex’, ‘kesseli+2017’, ‘bonnefoy+2014’, ‘allers+2013’).

  • sptypes (list(str)) – Spectral types (‘F’, ‘G’, ‘K’, ‘M’, ‘L’, ‘T’). Currently only implemented for ‘irtf’.

Returns

None

Return type

NoneType

add_spectrum(spec_library: str, sptypes: Optional[List[str]] = None) None[source]

DEPRECATION: This method is deprecated and will be removed in a future release. Please use the add_spectra() method instead.

Parameters
  • spec_library (str) – Spectral library (‘irtf’, ‘spex’, ‘kesseli+2017’, ‘bonnefoy+2014’, ‘allers+2013’).

  • sptypes (list(str)) – Spectral types (‘F’, ‘G’, ‘K’, ‘M’, ‘L’, ‘T’). Currently only implemented for ‘irtf’.

Returns

None

Return type

NoneType

delete_data(dataset: str) None[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_compare_sample(tag: str) Dict[str, float][source]

Function for extracting the sample parameters with the highest posterior probability.

Parameters

tag (str) – Database tag where the results from compare_model() are stored.

Returns

Dictionary with the best-fit parameters.

Return type

dict

get_mcmc_photometry(tag: str, filter_name: str, burnin: Optional[int] = None, phot_type: str = 'magnitude') numpy.ndarray[source]

Function for calculating synthetic magnitudes or fluxes from the posterior samples.

Parameters
  • tag (str) – Database tag with the posterior samples.

  • filter_name (str) – Filter name for which the synthetic photometry will be computed.

  • burnin (int, None) – Number of burnin steps. No burnin is removed if set to None. Not required when using nested sampling.

  • phot_type (str) – Photometry type (‘magnitude’ or ‘flux’).

Returns

Synthetic magnitudes or fluxes (W m-2 um-1).

Return type

np.ndarray

get_mcmc_spectra(tag: str, random: int, burnin: Optional[int] = None, wavel_range: Optional[Union[Tuple[float, float], str]] = None, spec_res: Optional[float] = None, wavel_resample: Optional[numpy.ndarray] = None) Union[List[species.core.box.ModelBox], List[species.core.box.SpectrumBox]][source]

Function for drawing random spectra from the sampled posterior distributions.

Parameters
  • tag (str) – Database tag with the posterior samples.

  • random (int) – Number of random samples.

  • burnin (int, None) – Number of burnin steps. No burnin is removed if set to None. Not required when using nested sampling.

  • wavel_range (tuple(float, float), str, None) – Wavelength range (um) or filter name. Full spectrum is used if set to None.

  • spec_res (float, None) – Spectral resolution that is used for the smoothing with a Gaussian kernel. No smoothing is applied if the argument set to None.

  • wavel_resample (np.ndarray, None) – Wavelength points (um) to which the model spectrum will be resampled. The resampling is applied after the optional smoothing to the resolution of spec_res.

Returns

List with ModelBox objects.

Return type

list(species.core.box.ModelBox)

get_median_sample(tag: str, burnin: Optional[int] = None) Dict[str, float][source]

Function for extracting the median parameter values from the posterior samples.

Parameters
  • tag (str) – Database tag with the posterior 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: str, inc_phot: Union[bool, List[str]] = True, inc_spec: Union[bool, List[str]] = True) species.core.box.ObjectBox[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.

  • inc_phot (bool, list(str)) – Include photometric data. If a boolean, either all (True) or none (False) of the data are selected. If a list, a subset of filter names (as stored in the database) can be provided.

  • inc_spec (bool, list(str)) – Include spectroscopic data. If a boolean, either all (True) or none (False) of the data are selected. If a list, a subset of spectrum names (as stored in the database with add_object()) can be provided.

Returns

Box with the object’s data.

Return type

species.core.box.ObjectBox

get_probable_sample(tag: str, burnin: Optional[int] = None) Dict[str, float][source]

Function for extracting the sample parameters with the highest posterior probability.

Parameters
  • tag (str) – Database tag with the posterior 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_pt_profiles(tag: str, random: Optional[int] = None, out_file: Optional[str] = None) Tuple[numpy.ndarray, numpy.ndarray][source]

Method for returning the pressure-temperature profiles from the atmospheric retrieval with petitRADTRANS. The data can also be optionally stored to an output file.

Parameters
  • tag (str) – Database tag with the posterior samples from the atmospheric retrieval with AtmosphericRetrieval.

  • random (int, None) – Number of random samples that will be used for the P-T profiles. All samples will be selected if set to None.

  • out_file (str, None) – Output file to store the P-T profiles. The data will be stored in a FITS file if the argument of out_file ends with .fits. Otherwise, the data will be written to a text file. The data has two dimensions with the first column containing the pressures (bar) and the remaining columns the temperature profiles (K). The data will not be written to a file if the argument is set to None.

Returns

  • np.ndarray – Array (1D) with the pressures (bar).

  • np.ndarray – Array (2D) with the temperature profiles (K). The shape of the array is (n_pressures, n_samples).

static get_retrieval_spectra(tag: str, random: Optional[int], wavel_range: Union[Tuple[float, float], str] = None, spec_res: Optional[float] = None) Tuple[List[species.core.box.ModelBox], species.read.read_radtrans.ReadRadtrans][source]

Function for extracting random spectra from the posterior distribution obtained with AtmosphericRetrieval.

Parameters
  • tag (str) – Database tag with the posterior samples.

  • random (int, None) – Number of randomly selected samples. All samples are used if set to None.

  • wavel_range (tuple(float, float), str, None) – Wavelength range (um) or filter name. The wavelength range from the retrieval is adopted (i.e. the wavel_range parameter of AtmosphericRetrieval) when set to None. It is mandatory to set the argument to None in case the log_tau_cloud parameter has been used with the retrieval.

  • spec_res (float, None) – Spectral resolution that is used for the smoothing with a Gaussian kernel. No smoothing is applied when the argument is set to None.

Returns

  • list(box.ModelBox) – Boxes with the randomly sampled spectra.

  • read_radtrans.Radtrans – Instance of ReadRadtrans.

get_retrieval_teff(tag: str, random: int = 100) Tuple[float, float][source]

Function for calculating Teff from randomly drawn samples of the posterior distribution from AtmosphericRetrieval. This requires the recalculation of the spectra across a broad wavelength range (0.5-50 um).

Parameters
  • tag (str) – Database tag with the posterior samples.

  • random (int) – Number of randomly selected samples.

Returns

  • float – Mean of Teff samples.

  • float – Standard deviation of Teff samples.

get_samples(tag: str, burnin: Optional[int] = None, random: Optional[int] = None, json_file: Optional[str] = None) species.core.box.SamplesBox[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. The parameter is only required for samples obtained with emcee and is therefore not used for samples obtained with MultiNest or UltraNest.

  • random (int, None) – Number of random samples to select. All samples (with the burnin excluded) are selected if set to None.

  • json_file (str, None) – JSON file to store the posterior samples. The data will not be written if the argument is set to None.

Returns

Box with the posterior samples.

Return type

species.core.box.SamplesBox

static list_companions() None[source]
Returns

None

Return type

NoneType

list_content() None[source]
Returns

None

Return type

NoneType

petitcode_param(tag: str, sample_type: str = 'median', json_file: Optional[str] = None) Dict[str, float][source]

Function for converting the median are maximum likelihood posterior parameters of petitRADTRANS into a dictionary of input parameters for petitCODE.

Parameters
  • tag (str) – Database tag with the posterior samples.

  • sample_type (str) – Sample type that will be selected from the posterior (‘median’ or ‘probable’). Either the median or maximum likelihood parameters are used.

  • json_file (str, None) – JSON file to store the posterior samples. The data will not be written if the argument is set to None.

Returns

Dictionary with parameters for petitCODE.

Return type

dict

species.data.drift_phoenix module

Module for DRIFT-PHOENIX atmospheric model spectra.

species.data.drift_phoenix.add_drift_phoenix(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: float = None) None[source]

Function for adding the DRIFT-PHOENIX atmospheric models to the database. The original spectra were downloaded from http://svo2.cab.inta-csic.es/theory/newov2/index.php?models=drift and have been resampled to a spectral resolution of R = 2000 from 0.1 to 50 um.

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 full wavelength range (0.1-50 um) is stored if set to None. Only used in combination with spec_res.

  • teff_range (tuple(float, float), None) – Effective temperature range (K). All available temperatures are stored if set to None.

  • spec_res (float, None) – Spectral resolution. The data is stored with the spectral resolution of the input spectra (R = 2000) if set to None. Only used in combination with wavel_range.

Returns

None

Return type

NoneType

species.data.dust module

Module for optical constants of dust grains.

species.data.dust.add_cross_sections(input_path: str, database: h5py._hl.files.File) None[source]

Function for adding the extinction cross section of crystalline MgSiO3 for a log-normal and power-law size distribution to the database.

Parameters
  • input_path (str) – Folder where the data is located.

  • database (h5py._hl.files.File) – Database.

Returns

NoneType

Return type

None

species.data.dust.add_optical_constants(input_path: str, database: h5py._hl.files.File) None[source]

Function for adding the optical constants of crystalline and amorphous MgSiO3 and Fe to the database.

Parameters
  • input_path (str) – Folder where the data is located.

  • database (h5py._hl.files.File) – Database.

Returns

NoneType

Return type

None

species.data.exo_rem module

Module for Exo-REM atmospheric model spectra.

species.data.exo_rem.add_exo_rem(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: Optional[float] = None) None[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 with a spectral resolution of 5000 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 website of the SVO Filter Profile Service.

species.data.filters.download_filter(filter_id: str) Tuple[Optional[numpy.ndarray], Optional[numpy.ndarray], Optional[str]][source]

Function for downloading filter profile data from the SVO Filter Profile Service.

Parameters

filter_id (str) – Filter name as listed on the website of the SVO Filter Profile Service (see http://svo2.cab.inta-csic.es/svo/theory/fps/).

Returns

  • np.ndarray – Wavelength (um).

  • np.ndarray – Fractional transmission.

  • str – Detector type (‘energy’ or ‘photon’).

species.data.irtf module

Module for adding the IRTF Spectral Library to the database.

species.data.irtf.add_irtf(input_path: str, database: h5py._hl.files.File, sptypes: Optional[List[str]] = None) None[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 (list(str), None) – List with the spectral types (‘F’, ‘G’, ‘K’, ‘M’, ‘L’, ‘T’). All spectral types are included if set to None.

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. (2003) isochrone data to the database. Any of the isochrones from https://phoenix.ens-lyon.fr/Grids/ can be used as input.

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.kesseli2017 module

Module for adding O5 through L3 SDSS stellar spectra from Kesseli et al. (2017) to the database.

species.data.kesseli2017.add_kesseli2017(input_path: str, database: h5py._hl.files.File) None[source]

Function for adding the SDSS stellar spectra from Kesseli et al. (2017) to the database.

Parameters
  • input_path (str) – Path of the data folder.

  • database (h5py._hl.files.File) – The HDF5 database.

Returns

None

Return type

NoneType

species.data.leggett module

Text

species.data.leggett.add_leggett(input_path, database)[source]

Function for adding the Database of Ultracool Parallaxes to the database.

Parameters
  • input_path (str) – Path of the data folder.

  • database (h5py._hl.files.File) – Database.

Returns

None

Return type

NoneType

species.data.morley2012 module

Module for T/Y dwarf model spectra from Morley et al. (2012).

species.data.morley2012.add_morley2012(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]], teff_range: Optional[Tuple[float, float]], spec_res: Optional[float]) None[source]

Function for adding the T/Y dwarf model spectra from Morley et al. (2012) to the database. The spectra have been at solar metallicity in the Teff range from 500 to 1300 K. The spectra have been downloaded from the Theoretical spectra web server (http://svo2.cab.inta-csic.es/svo/theory/newov2/index.php?models=morley12) and resampled to a spectral resolution of 5000 from 0.6 to 30 um.

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 for resampling. Not used if wavel_range is set to None.

Returns

None

Return type

NoneType

species.data.petitcode module

Module for petitCODE atmospheric model spectra.

species.data.petitcode.add_petitcode_cool_clear(input_path: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: Optional[float] = 1000.0) None[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: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: Optional[float] = 1000.0) None[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: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: Optional[float] = 1000.0) None[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.

  • 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: str, database: h5py._hl.files.File, wavel_range: Optional[Tuple[float, float]] = None, teff_range: Optional[Tuple[float, float]] = None, spec_res: Optional[float] = 1000.0) None[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.

  • 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.spex.add_spex(input_path: str, database: h5py._hl.files.File) None[source]

Function for adding the SpeX Prism Spectral Library to the database.

Parameters
  • input_path (str) – Path of the data folder.

  • database (h5py._hl.files.File) – The HDF5 database.

Returns

None

Return type

NoneType

species.data.vega module

Text

species.data.vega.add_vega(input_path, database)[source]

Function for adding a flux-calibrated spectrum of Vega to the database.

Parameters
  • input_path (str) – Path of the data folder.

  • database (h5py._hl.files.File) – Database.

Returns

None

Return type

NoneType

species.data.vlm_plx module

Module for the photometric data and parallaxes from the Database of Ultracool Parallaxes.

species.data.vlm_plx.add_vlm_plx(input_path, database)[source]

Function for adding the Database of Ultracool Parallaxes to the database.

Parameters
  • input_path (str) – Data folder.

  • database (h5py._hl.files.File) – HDF5 database.

Returns

None

Return type

NoneType

Module contents