species.fit package#

Submodules#

species.fit.compare_spectra module#

Module with functionalities for comparing a spectrum with a library of empirical or model spectra. Empirical libraries of field or low-gravity objects can be used to determine the spectral type. A comparison with model spectra are useful for exploration of the atmospheric parameter.

class species.fit.compare_spectra.CompareSpectra(object_name: str, spec_name: str | List[str])[source]#

Bases: object

Class for comparing the spectrum of an object with a library of empirical or model spectra.

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

  • spec_name (str, list(str)) – Name of the spectrum or a list with the names of the spectra that will be used for the comparison. The spectrum names should have been stored at the object data of object_name.

Returns:

None

Return type:

NoneType

compare_model(tag: str, model: str, av_points: List[float] | ndarray | None = None, fix_logg: float | None = None, scale_spec: List[str] | None = None, weights: bool = True, inc_phot: List[str] | bool = False) None[source]#

Method for finding the best-fit spectrum from a grid of atmospheric model spectra by evaluating the goodness-of-fit statistic from Cushing et al. (2008).

Parameters:
  • tag (str) – Database tag where for each spectrum from the spectral library the best-fit parameters will be stored.

  • model (str) – Name of the model grid with synthetic spectra.

  • av_points (list(float), np.ndarray, None) – List of \(A_V\) extinction values for which the goodness-of-fit statistic will be tested. The extinction is calculated with the relation from Cardelli et al. (1989).

  • fix_logg (float, None) – Fix the value of \(\log(g)\), for example if estimated from gravity-sensitive spectral features. Typically, \(\log(g)\) can not be accurately determined when comparing the spectra over a broad wavelength range.

  • scale_spec (list(str), None) – List with names of observed spectra to which an additional flux scaling is applied to best match the spectral templates. This can be used to account for a difference in absolute calibration between spectra.

  • weights (bool) – Apply a weighting of the spectra and photometry based on the widths of the wavelengths bins and the FWHM of the filter profiles, respectively. No weighting is applied if the argument is set to False.

  • inc_phot (list(str), bool) – Filter names for which photometric fluxes of the selected object_name will be included in the comparison. The argument can be a list with filter names or a boolean to select all or none of the photometry. By default the argument is set to False so photometric fluxes are not included.

Returns:

None

Return type:

NoneType

spectral_type(tag: str, spec_library: str, wavel_range: Tuple[float | None, float | None] | None = None, sptypes: List[str] | None = None, av_ext: List[float] | ndarray | None = None, rad_vel: List[float] | ndarray | None = None) None[source]#

Method for finding the best fitting empirical spectra from a selected library by evaluating the goodness-of-fit statistic from Cushing et al. (2008).

Parameters:
  • tag (str) – Database tag where for each spectrum from the spectral library the best-fit parameters will be stored. So when testing a range of values for av_ext and rad_vel, only the parameters that minimize the goodness-of-fit statistic will be stored.

  • spec_library (str) – Name of the spectral library (e.g. ‘irtf’, ‘spex’, ‘kesseli+2017’, ‘bonnefoy+2014’).

  • wavel_range (tuple(float, float), None) – Wavelength range (\(\mu\mathrm{m}\)) that is evaluated.

  • sptypes (list(str), None) – List with spectral types to compare with, for example sptypes=['M', 'L']. All available spectral types in the spec_library are compared with if the argument is set to None.

  • av_ext (list(float), np.ndarray, None) –

    List of \(A_V\) for which the goodness-of-fit statistic is tested. The extinction is calculated with the empirical relation from Cardelli et al. (1989). The extinction is not varied if the argument is set to None.

  • rad_vel (list(float), np.ndarray, None) – List of radial velocities (km s-1) for which the goodness-of-fit statistic is tested. The radial velocity is not varied if the argument is set to None.

Returns:

None

Return type:

NoneType

species.fit.emission_line module#

Module with functionalities for the analysis of emission lines.

class species.fit.emission_line.EmissionLine(object_name: str, spec_name: str, hydrogen_line: str | None = None, lambda_rest: float | None = None, wavel_range: Tuple[float, float] | None = None)[source]#

Bases: object

Class for the analysis of emission lines.

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

  • spec_name (str) – Name of the spectrum that is stored at the object data of object_name.

  • hydrogen_line (str, None) – Name of the hydrogen line that will be analyzed. The names available lines can be checked with the list_hydrogen_lines() method. If the argument is set to None then provide the rest wavelength as argument of lambda_rest.

  • lambda_rest (float, None) – Rest wavelength (um) of the emission line. The parameter if used for calculating the radial velocity and its uncertainty. The argument can be set to None and will be ignored if the argument of hydrogen_line is used.

  • wavel_range (tuple(float, float), None) – Wavelength range (um) that is cropped from the spectrum. The full spectrum is used if the argument is set to None.

Returns:

None

Return type:

NoneType

accretion_luminosity(line_lum: float | ndarray) float | ndarray[source]#

Method for calculating the accretion luminosity from the (hydrogen) line luminosity with the relation from Aoyama et al. (2021) and extrapolated values from Marleau & Aoyama (2022).

Parameters:

line_lum (float, np.array) – Line luminosity (\(L_\odot\)) or array with line luminosities.

Returns:

Accretion luminosity (\(L_\odot\)) or array with accretion luminosities.

Return type:

float, np.ndarray

fit_gaussian(tag: str, min_num_live_points: float = 400, bounds: Dict[str, Tuple[float, float]] | None = None, output: str = 'ultranest/', plot_filename: str | None = 'line_fit.pdf', show_status: bool = True, double_gaussian: bool = False) None[source]#

Method for fitting a Gaussian profile to an emission line and using UltraNest for sampling the posterior distributions and estimating the evidence.

Parameters:
  • tag (str) – Database tag where the posterior samples will be stored.

  • min_num_live_points (int) – Minimum number of live points (see https://johannesbuchner.github.io/UltraNest/issues.html).

  • bounds (dict(str, tuple(float, float)), None) – The boundaries that are used for the uniform priors of the 3 Gaussian parameters (gauss_amplitude, gauss_mean, and gauss_sigma). Conservative prior boundaries will be estimated from the spectrum if the argument is set to None or if any of the required parameters is missing in the bounds dictionary.

  • output (str) – Path that is used for the output files from UltraNest.

  • plot_filename (str) – Filename for the plot with the best-fit line profile. The plot is shown in an interface window if the argument is set to None.

  • show_status (bool) – Print information about the convergence.

  • double_gaussian (bool) – Set to True for fitting a double instead of a single Gaussian. In that case, the bounds dictionary may also contain 'gauss_amplitude_2', 'gauss_mean_2', and 'gauss_sigma_2' (otherwise conservative parameter boundaries are estimated from the data).

Returns:

None

Return type:

NoneType

integrate_flux(wavel_int: Tuple[float, float], interp_kind: str = 'linear', plot_filename: str | None = 'int_line.pdf') Tuple[float64, float64][source]#

Method for calculating the integrated line flux and error. The spectrum is first interpolated to \(R = 100000\) and then integrated across the specified wavelength range with the composite trapezoidal rule of np.trapz. The error is estimated with a Monte Carlo approach from 1000 samples. The accretion luminosity is also calculated with the relation from Aoyama et al. (2021) and Marleau & Aoyama (2022) if the argument of hydrogen_line was set when creating an instance of the class.

Parameters:
  • wavel_int (tuple(float, float)) – Wavelength range (um) across which the flux will be integrated.

  • interp_kind (str) – Kind of interpolation kind for scipy.interpolate.interp1d (default: ‘linear’).

  • plot_filename (str, None) – Filename for the plot with the interpolated line profile. The plot is shown in an interface window if the argument is set to None.

Returns:

  • float – Integrated line flux (W m-2).

  • float – Flux error (W m-2).

list_hydrogen_lines() List[str][source]#

Function to list the hydrogen lines for which an accretion luminosity relation \(L_\mathrm{acc}(L_\mathrm{line}\)) was fit explicitly provided in Aoyama et al. (2021) [Ao21] or Marleau & Aoyama (2022) [MA22]. These names can be set as argument hydrogen_line. In that case, the measured line luminosity from fit_gaussian() will be automatically converted to an accretion luminosity with the relation from [Ao21] and [MA22].

Returns:

List with the names of the hydrogen lines for which there are coefficients available for the accretion relation.

Return type:

list(str)

subtract_continuum(poly_degree: int = 3, plot_filename: str | None = 'continuum.pdf', spec_filename: str | None = None) None[source]#

Method for fitting the continuum with a polynomial function of the following form: \(P = \sum_{i=0}^{i=n}C_{i} * x^{i}\). The spectrum is first smoothed with a median filter and then fitted with a linear least squares algorithm.

Parameters:
  • poly_degree (int) – Degree of the polynomial series.

  • plot_filename (str, None) – Filename for the plots with the continuum fit and the continuum-subtracted spectrum. The plot is shown in an interface window if the argument is set to None.

  • spec_filename (str, None) – Output text file for writing the continuum-subtracted spectrum. The file will not be created if the argument is set to None.

Returns:

None

Return type:

NoneType

species.fit.fit_evolution module#

Module with functionalities for retrieving the age and bulk parameters of one or multiple planets and/or brown dwarfs in a system.

class species.fit.fit_evolution.FitEvolution(evolution_model: str, object_lbol: Tuple[float, float] | List[Tuple[float, float]] | None, object_mass: Tuple[float, float] | List[Tuple[float, float] | None] | None = None, object_radius: Tuple[float, float] | List[Tuple[float, float] | None] | None = None, bounds: Dict[str, Tuple[float, float] | Tuple[Tuple[float, float] | None, Tuple[float, float] | None] | List[Tuple[float, float]]] | None = None)[source]#

Bases: object

Class for retrieving evolutionary parameters from the bolometric luminosity of one or multiple planets in a planetary system. Optionally, dynamical mass and/or radius priors can be applied A single age is retrieved, so assuming that a difference in formation time is negligible at the age of the system.

Parameters:
  • evolution_model (str) – Database tag of the isochrone data (e.g. ‘ames-cond’, ‘sonora+0.0’, ‘atmo-ceq’). When using an incorrect argument, and error message is printed that includes a list with the isochrone models that are available in the current species database.

  • object_lbol (tuple(float, float), list(tuple(float, float))) – List with tuples that contain \(\log10{L/L_\odot}\) and the related uncertainty for one or multiple objects. The list should follow the alphabetical order of companion characters (i.e. b, c, d, etc.) to make sure that the labels are correctly shown when plotting results.

  • object_mass (tuple(float, float), list(tuple(float, float)), None) – Optional list with tuples that contain the (dynamical) masses and the related uncertainty for one or multiple objects. These masses we be used as Gaussian prior with the fit. The order should be identical to object_lbol.

  • object_radius (tuple(float, float), list(tuple(float, float)), None) – Optional list with tuples that contain the radii (e.g. from and SED fit) and the related uncertainty for one or multiple objects. These radii we be used as Gaussian prior with the fit. The order should be identical to object_lbol.

  • bounds (dict(str, tuple(float, float)), None) – The boundaries that are used for the uniform or log-uniform priors. Fixing a parameter is possible by providing the same value as lower and upper boundary of the parameter (e.g. bounds={'y_frac': (0.25, 0.25).

Returns:

None

Return type:

NoneType

run_multinest(tag: str, n_live_points: int = 1000, output: str = 'multinest/') None[source]#

Function to run the PyMultiNest wrapper of the MultiNest sampler. While PyMultiNest can be installed with pip from the PyPI repository, MultiNest has to to be build manually. See the PyMultiNest documentation for details: http://johannesbuchner.github.io/PyMultiNest/install.html. Note that the library path of MultiNest should be set to the environmental variable LD_LIBRARY_PATH on a Linux machine and DYLD_LIBRARY_PATH on a Mac. Alternatively, the variable can be set before importing the species package, for example:

>>> import os
>>> os.environ['DYLD_LIBRARY_PATH'] = '/path/to/MultiNest/lib'
>>> import species
Parameters:
  • tag (str) – Database tag where the samples will be stored.

  • n_live_points (int) – Number of live points.

  • output (str) – Path that is used for the output files from MultiNest.

Returns:

None

Return type:

NoneType

species.fit.fit_model module#

Module with functionalities for fitting atmospheric model spectra.

class species.fit.fit_model.FitModel(object_name: str, model: str, bounds: Dict[str, Tuple[float | None, float | None] | None | Tuple[Tuple[float | None, float | None] | None, Tuple[float | None, float | None] | None] | Tuple[Tuple[float, float] | None, Tuple[float, float] | None, Tuple[float, float] | None] | List[Tuple[float, float]]] | None = None, inc_phot: bool | List[str] = True, inc_spec: bool | List[str] = True, fit_corr: List[str] | None = None, apply_weights: bool | Dict[str, float | ndarray] = False, ext_filter: str | None = None, normal_prior: Dict[str, Tuple[float, float]] | None = None)[source]#

Bases: object

Class for fitting atmospheric model spectra to spectra and/or photometric fluxes, and using Bayesian inference (with MultiNest or UltraNest) to estimate the posterior distribution and marginalized likelihood (i.e. “evidence”). A grid of model spectra is linearly interpolated for each spectrum and photometric flux, while taking into account the filter profile, spectral resolution, and wavelength sampling. The computation time depends mostly on the number of free parameters and the resolution / number of data points of the spectra.

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

  • model (str) – Name of the atmospheric model (e.g. ‘bt-settl’, ‘exo-rem’, ‘planck’, or ‘powerlaw’).

  • bounds (dict(str, tuple(float, float)), None) –

    The boundaries that are used for the uniform or log-uniform priors. Mandatory parameters are automatically added if not already included in bounds. Fixing a parameter is possible by providing the same value as lower and upper boundary of the parameter (e.g. bounds={'logg': (4., 4.). An explanation of the various parameters can be found below. See also the normal_prior parameter for using priors with a normal distribution.

    Atmospheric model parameters (e.g. with model='bt-settl-cifist'; see docstring of add_model() for the available model grids):

    • Boundaries are provided as tuple of two floats. For example, bounds={'teff': (1000, 1500.), 'logg': (3.5, 5.)}.

    • The grid boundaries (i.e. the maximum range) are adopted as prior if a parameter range is set to None (instead of a tuple with two values), or if a mandatory parameter is not included in the dictionary of bounds. For example, bounds={'teff': (1000., 1500.), 'logg': None}. The default range for the radius is \(0.5-5.0~R_\mathrm{J}\). With bounds=None, automatic priors will be set for all mandatory parameters.

    • Radial velocity can be included with the rad_vel parameter (km/s). This parameter will only be relevant if the radial velocity shift can be spectrally resolved given the instrument resolution. When including rad_vel, a single RV will be fitted for all spectra. Or, it is also possible by fitting an RV for individual spectra by for example including the parameter as rad_vel_SPHERE in case the spectrum name is SPHERE, that is, the name used as tag when adding the spectrum to the database with add_object().

    • Rotational broadening can be fitted by including the vsini parameter (km/s). This parameter will only be relevant if the rotational broadening is stronger than or comparable to the instrumental broadening, so typically when the data has a high spectral resolution. The resolution is set when adding a spectrum to the database with add_object(). Note that the broadening is applied with the fastRotBroad function from PyAstronomy. The rotational broadening is only accurate if the wavelength range of the data is somewhat narrow. For example, when fitting a medium- or high-resolution spectrum across multiple bands (e.g. $JHK$ bands) then it is best to split up the data into the separate bands when adding them with add_object(). A single broadening parameter, vsini, can be fitted, so it is applied for all spectra. Or, it is also possible to fit the broadening for individual spectra by for example including the parameter as vsini_SPHERE in case the spectrum name is SPHERE, that is, the name used as tag when adding the spectrum to the database with add_object().

    • It is possible to fit a weighted combination of two atmospheric parameters from the same model. This can be useful to fit data of a spectroscopic binary or to account for atmospheric asymmetries of a single object. For each atmospheric parameter, a tuple of two tuples can be provided, for example bounds={'teff': ((1000., 1500.), (1300., 1800.))}. Mandatory parameters that are not included are assumed to be the same for both components. The grid boundaries are used as parameter range if a component is set to None. For example, bounds={'teff': (None, None), 'logg': (4.0, 4.0), (4.5, 4.5)} will use the full range for \(T_\mathrm{eff}\) of both components and fixes \(\log{g}\) to 4.0 and 4.5, respectively. The spec_weight parameter is automatically included in the fit, as it sets the weight of the two components in case a single radius is fitted, so when simulating horizontal inhomogeneities in the atmosphere. When fitting the combined photometry from two stars, but with known flux ratios in specific filters, it is possible to apply a prior for the known flux ratios. The filters with the known flux ratios can be different from the filters with (combined) photometric fluxes. For example, when the flux ratio is known in filter Paranal/ERIS.H then the parameter to add is ratio_Paranal/ERIS.H. For a uniform prior, the ratio parameter should be added to bounds and for a normal prior it is added to normal_prior. The flux ratio is defined as the flux of the secondary star divided by the flux of the primary star.

    • Instead of fitting the radius and parallax, it is also possible to fit a scaling parameter directly, either linearly sampled (flux_scaling) or logarithmically sampled (log_flux_scaling). Additionally, it is also possible to fit a flux offset (flux_offset), which adds a constant flux (in W m-2 um-1) to the model spectrum.

    Blackbody disk emission:

    • Blackbody parameters can be fitted to account for thermal emission from one or multiple disk components, in addition to the atmospheric emission. These parameters should therefore be combined with an atmospheric model.

    • Parameter boundaries have to be provided for ‘disk_teff’ and ‘disk_radius’. For example, bounds={'teff': (2000., 3000.), 'radius': (1., 5.), 'logg': (3.5, 4.5), 'disk_teff': (100., 2000.), 'disk_radius': (1., 100.)} for fitting a single blackbody component, in addition to the atmospheric parameters. Or, bounds={'teff': (2000., 3000.), 'radius': (1., 5.), 'logg': (3.5, 4.5), 'disk_teff': [(2000., 500.), (1000., 20.)], 'disk_radius': [(1., 100.), (50., 1000.)]} for fitting two blackbody components. Any number of blackbody components can be fitted by including additional priors in the lists of 'disk_teff' and 'disk_radius'.

    Blackbody parameters (only with model='planck'):

    • This implementation fits both the atmospheric emission and possible disk emission with blackbody components. Parameter boundaries have to be provided for ‘teff’ and ‘radius’.

    • For a single blackbody component, the values are provided as a tuple with two floats. For example, bounds={'teff': (1000., 2000.), 'radius': (0.8, 1.2)}.

    • For multiple blackbody components, the values are provided as a list with tuples. For example, bounds={'teff': [(1000., 1400.), (1200., 1600.)], 'radius': [(0.8, 1.5), (1.2, 2.)]}.

    • When fitting multiple blackbody components, an additional prior is used for restricting the temperatures and radii to decreasing and increasing values, respectively, in the order as provided in bounds.

    Power-law spectrum (model='powerlaw'):

    • Parameter boundaries have to be provided for ‘log_powerlaw_a’, ‘log_powerlaw_b’, and ‘log_powerlaw_c’. For example, bounds={'log_powerlaw_a': (-20., 0.), 'log_powerlaw_b': (-20., 5.), 'log_powerlaw_c': (-20., 5.)}.

    • The spectrum is parametrized as \(\log10{f} = a + b*\log10{\lambda}^c\), where \(a\) is log_powerlaw_a, \(b\) is log_powerlaw_b, and \(c\) is log_powerlaw_c.

    • Only implemented for fitting photometric fluxes, for example the IR fluxes of a star with disk. In that way, synthetic photometry can be calculated afterwards for a different filter. Note that this option assumes that the photometric fluxes are dominated by continuum emission while spectral lines are ignored.

    • The plot_mag_posterior() function can be used for calculating synthetic photometry and error bars from the posterior distributions.

    Calibration parameters:

    • For each spectrum/instrument, two optional parameters can be fitted to account for biases in the calibration: a scaling of the flux and a relative inflation of the uncertainties.

    • For example, bounds={'SPHERE': ((0.8, 1.2), (0., 1.))} if the scaling is fitted between 0.8 and 1.2, and the error is inflated (relative to the sampled model fluxes) with a value between 0 and 1.

    • The dictionary key should be the same as the database tag of the spectrum. For example, {'SPHERE': ((0.8, 1.2), (0., 1.))} if the spectrum is stored as 'SPHERE' with add_object().

    • Each of the two calibration parameters can be set to None in which case the parameter is not used. For example, bounds={'SPHERE': ((0.8, 1.2), None)}.

    • The errors of the photometric fluxes can be inflated to account for underestimated error bars. The error inflation is relative to the actual flux and is either fitted separately for a filter, or a single error inflation is applied to all filters from an instrument. For the first case, the keyword in the bounds dictionary should be provided in the following format: 'Paranal/NACO.Mp_error': (0., 1.). Here, the error of the NACO \(M'\) flux is inflated up to 100 percent of the actual flux. For the second case, only the telescope/instrument part of the the filter name should be provided in the bounds dictionary, so in the following format: 'Paranal/NACO_error': (0., 1.). This will increase the errors of all NACO filters by the same (relative) amount.

    • No calibration parameters are fitted if the spectrum name is not included in bounds.

    ISM extinction parameters:

    • There are three approaches for fitting extinction. The first is with the empirical relation from Cardelli et al. (1989) for ISM extinction.

    • The extinction is parametrized by the $V$ band extinction, $A_V$ (ism_ext), and optionally the reddening, R_V (ism_red). If ism_red is not provided, its value is fixed to 3.1 and not fitted.

    • The prior boundaries of ism_ext and ism_red should be provided in the bounds dictionary, for example bounds={'ism_ext': (0., 10.), 'ism_red': (0., 20.)}.

    Log-normal size distribution:

    • The second approach is fitting the extinction of a log-normal size distribution of grains with a crystalline MgSiO3 composition, and a homogeneous, spherical structure.

    • The size distribution is parameterized with a mean geometric radius (lognorm_radius in um) and a geometric standard deviation (lognorm_sigma, dimensionless). The grid of cross sections has been calculated for mean geometric radii between 0.001 and 10 um, and geometric standard deviations between 1.1 and 10.

    • The extinction (lognorm_ext) is fitted in the $V$ band ($A_V$ in mag) and the wavelength-dependent extinction cross sections are interpolated from a pre-tabulated grid.

    • The prior boundaries of lognorm_radius, lognorm_sigma, and lognorm_ext should be provided in the bounds dictionary, for example bounds={'lognorm_radius': (0.001, 10.), 'lognorm_sigma': (1.1, 10.), 'lognorm_ext': (0., 5.)}.

    • A uniform prior is used for lognorm_sigma and lognorm_ext, and a log-uniform prior for lognorm_radius.

    Power-law size distribution:

    • The third approach is fitting the extinction of a power-law size distribution of grains, again with a crystalline MgSiO3 composition, and a homogeneous, spherical structure.

    • The size distribution is parameterized with a maximum radius (powerlaw_max in um) and a power-law exponent (powerlaw_exp, dimensionless). The minimum radius is fixed to 1 nm. The grid of cross sections has been calculated for maximum radii between 0.01 and 100 um, and power-law exponents between -10 and 10.

    • The extinction (powerlaw_ext) is fitted in the $V$ band ($A_V$ in mag) and the wavelength-dependent extinction cross sections are interpolated from a pre-tabulated grid.

    • The prior boundaries of powerlaw_max, powerlaw_exp, and powerlaw_ext should be provided in the bounds dictionary, for example {'powerlaw_max': (0.01, 100.), 'powerlaw_exp': (-10., 10.), 'powerlaw_ext': (0., 5.)}.

    • A uniform prior is used for powerlaw_exp and powerlaw_ext, and a log-uniform prior for powerlaw_max.

  • inc_phot (bool, list(str)) – Include photometric data in the fit. 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 in the fit. 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.

  • fit_corr (list(str), None) – List with spectrum names for which the covariances are modeled with a Gaussian process (see Wang et al. 2020). This option can be used if the actual covariances as determined from the data are not available for the spectra of object_name. The parameters that will be fitted are the correlation length and the fractional amplitude.

  • apply_weights (bool, dict) – Weights to be applied to the log-likelihood components of the spectra and photometric fluxes that are provided with inc_spec and inc_phot. This parameter can for example be used to increase the weighting of the photometric fluxes relative to a spectrum that consists of many wavelength points. By setting the argument to True, the weighting factors are automatically set, based on the FWHM of the filter profiles or the wavelength spacing calculated from the spectral resolution. By setting the argument to False, there will be no weighting applied.

  • ext_filter (str, None) – Filter that is associated with the (optional) extinction parameter, ism_ext. When the argument of ext_filter is set to None, the extinction is defined in the visual (i.e. \(A_V\)). By providing a filter name from the SVO Filter Profile Service as argument then the extinction ism_ext is fitted in that filter instead of the $V$ band.

  • normal_prior (dict(str, tuple(float, float)), None) – Dictionary with normal priors for one or multiple parameters. The prior can be set for any of the atmosphere or calibration parameters, e.g. normal_prior={'teff': (1200., 100.)}, for a prior distribution with a mean of 1200 K and a standard deviation of 100 K. Additionally, a prior can be set for the mass, e.g. normal_prior={'mass': (13., 3.)} for an expected mass of 13 Mjup with an uncertainty of 3 Mjup. A normal prior for the parallax is automatically included so does not need to be set with normal_prior. The parameter is not used if the argument is set to None. See also the bounds parameter for including priors with a (log-)uniform distribution.

Returns:

None

Return type:

NoneType

run_dynesty(tag: str, n_live_points: int = 1000, resume: bool = False, output: str = 'dynesty/', evidence_tolerance: float = 0.5, dynamic: bool = False, sample_method: str = 'auto', bound: str = 'multi', n_pool: int | None = None, mpi_pool: bool = False) None[source]#

Function for running the atmospheric retrieval. The parameter estimation and computation of the marginalized likelihood (i.e. model evidence), is done with Dynesty.

When using MPI, it is also required to install mpi4py (e.g. pip install mpi4py), otherwise an error may occur when the output_folder is created by multiple processes.

Parameters:
  • tag (str) – Database tag where the samples will be stored.

  • n_live_points (int) – Number of live points used by the nested sampling with Dynesty.

  • resume (bool) – Resume the posterior sampling from a previous run.

  • output (str) – Path that is used for the output files from Dynesty.

  • evidence_tolerance (float) – The dlogZ value used to terminate a nested sampling run, or the initial dlogZ value passed to a dynamic nested sampling run.

  • dynamic (bool) – Whether to use static or dynamic nested sampling (see Dynesty documentation).

  • sample_method (str) – The sampling method that should be used (‘auto’, ‘unif’, ‘rwalk’, ‘slice’, ‘rslice’ (see sampling documentation).

  • bound (str) – Method used to approximately bound the prior using the current set of live points (‘none’, ‘single’, ‘multi’, ‘balls’, ‘cubes’). Conditions the sampling methods used to propose new live points

  • n_pool (int) – The number of processes for the local multiprocessing. The parameter is not used when the argument is set to None.

  • mpi_pool (bool) – Distribute the workers to an MPIPool on a cluster, using schwimmbad.

Returns:

None

Return type:

NoneType

run_multinest(tag: str, n_live_points: int = 1000, resume: bool = False, output: str = 'multinest/', kwargs_multinest: dict | None = None, **kwargs) None[source]#

Function to run the PyMultiNest wrapper of the MultiNest sampler. While PyMultiNest can be installed with pip from the PyPI repository, MultiNest has to to be build manually. See the PyMultiNest documentation. The library path of MultiNest should be set to the environmental variable LD_LIBRARY_PATH on a Linux machine and DYLD_LIBRARY_PATH on a Mac. Alternatively, the variable can be set before importing the species package, for example:

>>> import os
>>> os.environ['DYLD_LIBRARY_PATH'] = '/path/to/MultiNest/lib'
>>> import species
Parameters:
  • tag (str) – Database tag where the samples will be stored.

  • n_live_points (int) – Number of live points.

  • resume (bool) – Resume the posterior sampling from a previous run.

  • output (str) – Path that is used for the output files from MultiNest.

  • kwargs_multinest (dict, None) – Dictionary with keyword arguments that can be used to adjust the parameters of the run() function of the PyMultiNest sampler. See also the documentation of MultiNest.

Returns:

None

Return type:

NoneType

run_ultranest(tag: str, min_num_live_points: int = 400, resume: bool | str = False, output: str = 'ultranest/', kwargs_ultranest: dict | None = None, **kwargs) None[source]#

Function to run UltraNest for estimating the posterior distributions of model parameters and computing the marginalized likelihood (i.e. “evidence”).

Parameters:
  • tag (str) – Database tag where the samples will be stored.

  • min_num_live_points (int) – Minimum number of live points. The default of 400 is a reasonable number. In principle, choosing a very low number allows nested sampling to make very few iterations and go to the peak quickly. However, the space will be poorly sampled, giving a large region and thus low efficiency, and potentially not seeing interesting modes. Therefore, a value above 100 is typically useful.

  • resume (bool, str) – Resume the posterior sampling from a previous run. The UltraNest documentation provides a description of the possible arguments (True, 'resume', 'resume-similar', 'overwrite', 'subfolder'). Setting the argument to False is identical to 'subfolder'.

  • kwargs_ultranest (dict, None) – Dictionary with keyword arguments that can be used to adjust the parameters of the run() method of the UltraNest sampler.

  • output (str) – Path that is used for the output files from UltraNest.

Returns:

None

Return type:

NoneType

species.fit.fit_spectrum module#

Module with functionalities for photometric and spectroscopic calibration. The fitting routine be used to fit photometric data with a calibration spectrum (e.g. extracted with get_model()) by simply fitting a scaling parameter.

class species.fit.fit_spectrum.FitSpectrum(object_name: str, filters: List[str] | None, spectrum: str, bounds: Dict[str, Tuple[float, float]])[source]#

Bases: object

Class for fitting a calibration spectrum to photometric data.

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 the argument is set to None.

  • spectrum (str) – Calibration spectrum as labelled in the database. The calibration spectrum can be stored in the database with add_calibration().

  • bounds (dict) – Boundaries of the scaling parameter, as {'scaling':(min, max)}.

Returns:

None

Return type:

NoneType

run_mcmc(nwalkers: int, nsteps: int, guess: Dict[str, float] | Dict[str, None], tag: str) None[source]#

Function to run the MCMC sampler.

Parameters:
  • nwalkers (int) – Number of walkers.

  • nsteps (int) – Number of steps per walker.

  • guess (dict(str, float), dict(str, None)) – Guess of the scaling parameter.

  • tag (str) – Database tag where the MCMC samples will be stored.

Returns:

None

Return type:

NoneType

species.fit.fit_spectrum.lnprob(param: ndarray, bounds: Dict[str, Tuple[float, float]], modelpar: List[str], objphot: List[ndarray], specphot: List[float] | List[Tuple[SyntheticPhotometry, Tuple[float64, float64]]]) float[source]#

Internal function for calculating the posterior probability.

Parameters:
  • param (np.ndarray) – Value of the scaling parameter.

  • bounds (dict) – Boundaries of the main scaling parameter.

  • modelpar (list(str)) – Parameter names.

  • objphot (list(tuple(float, float))) – Photometry of the object.

  • specphot (list(float), SyntheticPhotometry) – Synthetic photometry of the calibration spectrum for the same filters as the photometry of the object.

Returns:

Log posterior probability.

Return type:

float

species.fit.retrieval module#

Module with a frontend for atmospheric retrieval with the radiative transfer and retrieval code petitRADTRANS. The Bayesian inference can be done with PyMultiNest or with Dynesty.

class species.fit.retrieval.AtmosphericRetrieval(object_name: str, line_species: List[str] | None = None, cloud_species: List[str] | None = None, res_mode: str = 'c-k', output_folder: str = 'multinest', wavel_range: Tuple[float, float] | None = None, scattering: bool = True, inc_spec: bool | List[str] = True, inc_phot: bool | List[str] = False, pressure_grid: str = 'smaller', weights: Dict[str, float] | None = None, ccf_species: List[str] | None = None, max_pressure: float = 1000.0, lbl_opacity_sampling: int | None = None)[source]#

Bases: object

Class for atmospheric retrievals of self-luminous atmospheres of giant planets and brown dwarfs within a Bayesian framework. This class provides a frontend for petitRADTRANS, with a variety of P-T profiles, cloud models, priors, and more. The Bayesian inference is done with the nested sampling implementation of PyMultiNest or Dynesty.

Parameters:
  • object_name (str) – Name of the object as stored in the database with add_object().

  • line_species (list, None) – List with the line species. A minimum of one line species should be included.

  • cloud_species (list, None) – List with the cloud species. No cloud species are used if the argument is to None.

  • res_mode (str) – Resolution mode (‘c-k’ or ‘lbl’). The low-resolution mode (‘c-k’) calculates the spectrum with the correlated-k assumption at \(\lambda/\Delta \lambda = 1000\). The high-resolution mode (‘lbl’) calculates the spectrum with a line-by-line treatment at \(\lambda/\Delta \lambda = 10^6\).

  • output_folder (str) – Folder name that is used for the output files from MultiNest. The folder is created if it does not exist.

  • wavel_range (tuple(float, float), None) – The wavelength range (um) that is used for the forward model. Should be a bit broader than the minimum and maximum wavelength of the data. If photometric fluxes are included (see inc_phot), it is important that wavel_range encompasses the full filter profile, which can be inspected with the functionalities of ReadFilter. The wavelength range is set automatically if the argument is set to None.

  • scattering (bool) – Turn on scattering in the radiative transfer. Only recommended at infrared wavelengths when clouds are included in the forward model. Using scattering will increase the computation time significantly.

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

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

  • pressure_grid (str) – The type of pressure grid that is used for the radiative transfer. Either ‘standard’, to use 180 layers both for the atmospheric structure (e.g. when interpolating the abundances) and 180 layers with the radiative transfer, or ‘smaller’ to use 60 (instead of 180) with the radiative transfer, or ‘clouds’ to start with 1440 layers but resample to ~100 layers (depending on the number of cloud species) with a refinement around the cloud decks. For cloudless atmospheres it is recommended to use ‘smaller’, which runs faster than ‘standard’ and provides sufficient accuracy. For cloudy atmosphere, it is recommended to test with ‘smaller’ but it might be required to use ‘clouds’ to improve the accuracy of the retrieved parameters, at the cost of a long runtime.

  • weights (dict(str, float), None) – Weights to be applied to the log-likelihood components of the different spectroscopic and photometric data that are provided with inc_spec and inc_phot. This parameter can for example be used to increase the weighting of the photometric data points relative to the spectroscopic data. An equal weighting is applied if the argument is set to None.

  • ccf_species (list, None) – List with the line species that will be used for calculating line-by-line spectra for the list of high-resolution spectra that are provided as argument of cross_corr when starting the retrieval with species.fit.retrieval.AtmosphericRetrieval.run_multinest(). The argument can be set to None when cross_corr=None. The ccf_species and cross_corr parameters should only be used if the log-likelihood component should be determined with a cross-correlation instead of a direct comparison of data and model.

  • max_pressure (float) – Maximum pressure (bar) that is used for the P-T profile. The default is set to 1000 bar.

  • lbl_opacity_sampling (int, None) – This is the same parameter as in petitRADTRANS which is used with res_mode='lbl' to downsample the line-by-line opacities by selecting every lbl_opacity_sampling-th wavelength from the original sampling of \(\lambda/\Delta \lambda = 10^6\). Setting this parameter will lower the computation time. By setting the argument to None, the value is automatically set, based on the spectral resolution of the input data. By setting the parameter to lbl_opacity_sampling=1, the original sampling is used so no downsampling is applied.

Returns:

None

Return type:

NoneType

rebin_opacities(spec_res: float, out_folder: str = 'rebin_out') None[source]#

Function for downsampling the c-k opacities from \(\lambda/\Delta\lambda = 1000\) to a smaller wavelength binning. The downsampled opacities should be stored in the opacities/lines/corr_k/ folder of pRT_input_data_path.

Parameters:
  • spec_res (float) – Spectral resolution, \(\lambda/\Delta\lambda\), to which the opacities will be downsampled.

  • out_folder (str) – Path of the output folder where the downsampled opacities will be stored.

Returns:

None

Return type:

NoneType

run_dynesty(n_live_points: int = 2000, evidence_tolerance: float = 0.5, dynamic: bool = False, sample_method: str = 'auto', bound: str = 'multi', n_pool: int | None = None, mpi_pool: bool = False, resume: bool = False, plotting: bool = False) None[source]#

Function for running the atmospheric retrieval. The parameter estimation and computation of the marginalized likelihood (i.e. model evidence), is done with Dynesty.

When using MPI, it is also required to install mpi4py (e.g. pip install mpi4py), otherwise an error may occur when the output_folder is created by multiple processes.

Parameters:
  • n_live_points (int) – Number of live points used by the nested sampling with Dynesty.

  • evidence_tolerance (float) – The dlogZ value used to terminate a nested sampling run, or the initial dlogZ value passed to a dynamic nested sampling run.

  • dynamic (bool) –

    Whether to use static or dynamic nested sampling (see Dynesty documentation).

  • sample_method (str) –

    The sampling method that should be used (‘auto’, ‘unif’, ‘rwalk’, ‘slice’, ‘rslice’ (see sampling documentation).

  • bound (str) –

    Method used to approximately bound the prior using the current set of live points (‘none’, ‘single’, ‘multi’, ‘balls’, ‘cubes’). Conditions the sampling methods used to propose new live points

  • n_pool (int) – The number of processes for the local multiprocessing. The parameter is not used when the argument is set to None.

  • mpi_pool (bool) – Distribute the workers to an MPIPool on a cluster, using schwimmbad.

  • resume (bool) – Resume the posterior sampling from a previous run.

  • plotting (bool) – Plot sample results for testing purpose. It is recommended to only set the argument to True for testing purposes.

Returns:

None

Return type:

NoneType

run_multinest(n_live_points: int = 1000, resume: bool = False, const_efficiency_mode: bool | None = True, sampling_efficiency: float | None = 0.05, evidence_tolerance: float | None = 0.5, out_basename: str | None = None, plotting: bool = False, **kwargs) None[source]#

Function for running the atmospheric retrieval. The parameter estimation and computation of the marginalized likelihood (i.e. model evidence), is done with PyMultiNest wrapper of the MultiNest sampler. While PyMultiNest can be installed with pip from the PyPI repository, MultiNest has to to be compiled manually. See the PyMultiNest documentation for further details. Note that the library path of MultiNest should be set to the environment variable LD_LIBRARY_PATH on a Linux machine and DYLD_LIBRARY_PATH on a Mac. Alternatively, the variable can be set before importing the species toolkit, for example:

>>> import os
>>> os.environ['DYLD_LIBRARY_PATH'] = '/path/to/MultiNest/lib'
>>> import species

When using MPI, it is also required to install mpi4py (e.g. pip install mpi4py), otherwise an error may occur when the output_folder is created by multiple processes.

Parameters:
  • n_live_points (int) – Number of live points used by the nested sampling with MultiNest (default: 1000).

  • resume (bool) – Resume the posterior sampling from a previous run (default: False).

  • const_efficiency_mode (bool) – Use the constant efficiency mode (default: True). It is recommended to use this mode when the model includes a large number of parameter, as is typically the case with atmospheric retrievals.

  • sampling_efficiency (float) – Sampling efficiency (default: 0.05). A value of 0.8 is recommended for parameter estimation and a value of 0.3 for evidence evaluation. However, in case of a large number of model parameters, the sampling efficiency will be low, so it is recommended to set the argument of const_efficiency_mode to True and the argument of sampling_efficiency to 0.05 (see MultiNest documentation).

  • evidence_tolerance (float) – Tolerance for the evidence. A value of 0.5 should provide sufficient accuracy. (default: 0.5).

  • out_basename (str, None) – Set the path and basename for the output files from MultiNest. This will overwrite the use of the output_folder parameter. By setting the argument to None, the output_folder will be used.

  • plotting (bool) – Plot sample results for testing purpose. It is recommended to only set the argument to True for testing purposes.

Returns:

None

Return type:

NoneType

setup_retrieval(bounds: dict, chemistry: str = 'equilibrium', quenching: str | None = 'pressure', pt_profile: str = 'molliere', fit_corr: List[str] | None = None, cross_corr: List[str] | None = None, check_isothermal: bool = False, pt_smooth: float | None = 0.3, abund_smooth: float | None = 0.3, check_flux: float | None = None, temp_nodes: int | None = None, abund_nodes: int | None = None, prior: Dict[str, Tuple[float, float]] | None = None, check_phot_press: float | None = None, apply_rad_vel: List[str] | None = None, apply_vsini: List[str] | None = None, global_fsed: bool = True) None[source]#

Function for running the atmospheric retrieval. The parameter estimation and computation of the marginalized likelihood (i.e. model evidence), is done with PyMultiNest wrapper of the MultiNest sampler. While PyMultiNest can be installed with pip from the PyPI repository, MultiNest has to to be compiled manually. See the PyMultiNest documentation: http://johannesbuchner.github.io/PyMultiNest/install.html. Note that the library path of MultiNest should be set to the environment variable LD_LIBRARY_PATH on a Linux machine and DYLD_LIBRARY_PATH on a Mac. Alternatively, the variable can be set before importing the species toolkit, for example:

>>> import os
>>> os.environ['DYLD_LIBRARY_PATH'] = '/path/to/MultiNest/lib'
>>> import species

When using MPI, it is also required to install mpi4py (e.g. pip install mpi4py), otherwise an error may occur when the output_folder is created by multiple processes.

Parameters:
  • bounds (dict) –

    The boundaries that are used for the uniform or log-uniform priors. The dictionary contains the parameters as key and the boundaries as value. The boundaries are provided as a tuple with two values (lower and upper boundary). Fixing a parameter is possible by providing the same value as lower and upper boundary of the parameter (e.g. bounds={'logg': (4., 4.). An explanation of the mandatory and optional parameters can be found in the description of the model_param parameter of species.read.read_radtrans.ReadRadtrans.get_model(). Additional parameters that can specifically be used for a retrieval are listed below.

    Scaling parameters (mandatory):

    • The radius (\(R_\mathrm{J}\)), radius, is a mandatory parameter to include. It is used for scaling the flux from the planet surface to the observer.

    • The parallax (mas), parallax, is also used for scaling the flux. However, this parameter is automatically included in the retrieval with a Gaussian prior (based on the object data of object_name). So this parameter does not need to be included in bounds).

    Radial velocity and rotational broadening (optional):

    • Radial velocity can be included with the rad_vel parameter (km/s). This parameter will only be relevant if the radial velocity shift can be spectrally resolved given the instrument resolution.

    • Rotational broadening can be fitted by including the vsini parameter (km/s). This parameter will only be relevant if the rotational broadening is stronger than or comparable to the instrumental broadening, so typically when the data has a high spectral resolution. The resolution is set when adding a spectrum to the database with add_object(). Note that the broadening is applied with the fastRotBroad function from PyAstronomy. The rotational broadening is only accurate if the wavelength range of the data is somewhat narrow. For example, when fitting a medium- or high-resolution spectrum across multiple bands (e.g. $JHK$ bands) then it is best to split up the data into the separate bands when adding them with add_object().

    Calibration parameters (optional):

    • For each spectrum/instrument, three optional parameters can be fitted to account for biases in the calibration: a scaling of the flux, a constant inflation of the uncertainties, and a constant offset in the wavelength solution.

    • For example, bounds={'SPHERE': ((0.8, 1.2), (-16., -14.), (-0.01, 0.01))} if the scaling is fitted between 0.8 and 1.2, each uncertainty is inflated with a constant value between \(10^{-16}\) and \(10^{-14}\) W \(\mathrm{m}^{-2}\) \(\mu\mathrm{m}^{-1}\), and a constant wavelength offset between -0.01 and 0.01 \(\mu\mathrm{m}\)

    • The dictionary key should be the same as to the database tag of the spectrum. For example, {'SPHERE': ((0.8, 1.2), (-16., -14.), (-0.01, 0.01))} if the spectrum is stored as 'SPHERE' with add_object().

    • Each of the three calibration parameters can be set to None in which case the parameter is not used. For example, bounds={'SPHERE': ((0.8, 1.2), None, None)}.

    • No calibration parameters are fitted if the spectrum name is not included in bounds.

    Prior parameters (optional):

    • The log_sigma_alpha parameter can be used when pt_profile='molliere'. This prior penalizes samples if the parametrized, pressure-dependent opacity is not consistent with the atmosphere’s non-gray opacity structure (see GRAVITY Collaboration et al. 2020 for details).

    • The log_gamma_r and log_beta_r parameters can be included when pt_profile='monotonic' or pt_profile='free'. A prior will be applied that penalizes wiggles in the P-T profile through the second derivative of the temperature structure (see Line et al. (2015) for details).

  • chemistry (str) – The chemistry type: ‘equilibrium’ for equilibrium chemistry or ‘free’ for retrieval of free abundances.

  • quenching (str, None) – Quenching type for CO/CH4/H2O abundances. Either the quenching pressure (bar) is a free parameter (quenching='pressure') or the quenching pressure is calculated from the mixing and chemical timescales (quenching='diffusion'). The quenching is not applied if the argument is set to None.

  • pt_profile (str) – The parametrization for the pressure-temperature profile (‘molliere’, ‘free’, ‘monotonic’, ‘eddington’, ‘gradient’).

  • fit_corr (list(str), None) – List with spectrum names for which the correlation lengths and fractional amplitudes are fitted (see Wang et al. 2020) to model the covariances in case these are not available.

  • cross_corr (list(str), None) – List with spectrum names for which a cross-correlation to log-likelihood mapping is used (see Brogi & Line 2019) instead of a direct comparison of model an data with a least-squares approach. This parameter should only be used for high-resolution spectra. Currently, it only supports spectra that have been shifted to the planet’s rest frame.

  • check_isothermal (bool) – Check if there is an isothermal region below 1 bar. If so, discard the sample. This parameter is experimental and has not been properly implemented.

  • pt_smooth (float, None) – Standard deviation of the Gaussian kernel that is used for smoothing the P-T profile, after the temperature nodes have been interpolated to a higher pressure resolution. Only required with `pt_profile='free'` or `pt_profile='monotonic'`. The argument should be given as \(\log10{P/\mathrm{bar}}\), with the default value set to 0.3 dex. No smoothing is applied if the argument if set to 0 or None. The pt_smooth parameter can also be included in bounds, in which case the value is fitted and the pt_smooth argument is ignored.

  • abund_smooth (float, None) – Standard deviation of the Gaussian kernel that is used for smoothing the abundance profiles, after the abundance nodes have been interpolated to a higher pressure resolution. Only required with `chemistry='free'` and abund_nodes is not set to None. The argument should be given as \(\log10{P/\mathrm{bar}}\), with the default value set to 0.3 dex. No smoothing is applied if the argument if set to 0 or None. The pt_smooth parameter can also be included in bounds, in which case the value is fitted and the abund_smooth argument is ignored.

  • check_flux (float, None) – Relative tolerance for enforcing a constant bolometric flux at all pressures layers. By default, only the radiative flux is used for the bolometric flux. The convective flux component is also included if the mix_length parameter (relative to the pressure scale height) is included in the bounds dictionary. To use check_flux, the opacities should be recreated with rebin_opacities() at $R = 10$ (i.e. spec_res=10) and placed in the folder of pRT_input_data_path. This parameter is experimental and has not been fully tested.

  • temp_nodes (int, None) – Number of free temperature nodes that are used with pt_profile='monotonic' or pt_profile='free'.

  • abund_nodes (int, None) – Number of free abundances nodes that are used with chemistry='free'. Constant abundances with altitude are used if the argument is set to None.

  • prior (dict(str, tuple(float, float)), None) – Dictionary with Gaussian priors for one or multiple parameters. The prior can be set for any of the atmosphere or calibration parameters, for example prior={'logg': (4.2, 0.1)}. Additionally, a prior can be set for the mass, for example prior={'mass': (13., 3.)} for an expected mass of 13 Mjup with an uncertainty of 3 Mjup. The parameter is not used if set to None.

  • check_phot_press (float, None) – Remove the sample if the photospheric pressure that is calculated for the P-T profile is more than a factor check_phot_press larger or smaller than the photospheric pressure that is calculated from the Rosseland mean opacity of the non-gray opacities of the atmospheric structure (see Eq. 7 in GRAVITY Collaboration et al. 2020, where a factor of 5 was used). This parameter can only in combination with pt_profile='molliere'. The parameter is not used used if set to None. Finally, since samples are removed when not full-filling this requirement, the runtime of the retrieval may increase significantly.

  • apply_rad_vel (list(str), None) – List with the spectrum names for which the radial velocity (RV) will be applied. By including only a subset of the spectra (i.e. excluding low-resolution spectra for which the RV will not matter), the computation will be a bit faster. This parameter is only used when the rad_vel model parameter has been include in bounds. The RV is applied to all spectra by setting the argument of apply_rad_vel to None.

  • apply_vsini (list(str), None) – List with the spectrum names for which the rotational broadening will be applied. By including only a subset of the spectra (i.e. excluding low-resolution spectra for which the broadening will not matter), the computation will be a bit faster. This parameter is only used when the vsini model parameter has been include in bounds. The \(v \sin(i)\) is applied to all spectra by setting the argument of apply_vsini to None.

  • global_fsed (bool) – Retrieve a global fsed parameter when set to True or retrieve the fsed parameter for each cloud species individually in the cloud_species list when set to False.

Returns:

None

Return type:

NoneType

Module contents#