Forward Models

BeAR currently includes the following forward models:

The secondary eclipse blackbody and flat line models are usually used to check if the observational data is more likely explained by simpler models, such as a flat line.

The forward model is selected in the main retrieval config file retrieval.toml via the forward_model_type key in the [retrieval] table:

[retrieval]
forward_model_type = "emission"

The accepted values (each with a short alias) are:

  • emission / em

  • secondary_eclipse / se

  • secondary_eclipse_bb / se_bb

  • transmission / trans

  • flat_line / fl

  • phase_curve / pc

Each model (except the flat line) requires its own config file forward_model.toml that is discussed below. The building blocks of these files, i.e. the temperature profiles, chemistry models, cloud models, stellar spectra, radiative transfer schemes, and opacity sources, are described in their own sections.

Model postprocessing

After the retrieval calculations are finished, BeAR will perform a postprocessing on the resulting posterior sample. Depending on the chosen forward model, different postprocessing steps can be used, including saving all posterior spectra or temperature profiles. Details can be found in the section on output files.

These postprocessing steps can also be configured in the optional post_process.toml file. If this file is not present, BeAR will use default settings for the postprocessing. Depending on the forward model, available options are currently:

  • delete_sampler_files - This option will delete all MultiNest sampler files that are not used in the post processing. Boolean value: true or false.

  • save_spectra - Compute the spectra for each model in the posterior sample. Spectra will be saved for each observation/instrument individually. Additionally, a high-resolution spectrum of the best-fit model will be computed and saved. Boolean value: true or false.

  • save_temperatures - Compute and save the temperature profile for each model in the posterior sample. Boolean value: true or false.

  • save_effective_temperatures - Compute and save the effective temperature for each model in the posterior sample. Boolean value: true or false.

  • save_contribution_functions - Compute and save the contribution functions for each observation/instrument for the best-fit model. Boolean value: true or false.

  • species_to_save - Save the mixing ratio profiles for selected chemical species for all posterior samples. The value is an array of the formulas of the chemical species that should be saved. For example, ["H2O", "CO2"] will save the mixing ratios of water and carbon dioxide. Species that BeAR does not know will be ignored.

Flat line

This model simply fits a flat line through the observational data. Usually, this model is used to test if the use of a more complex model is warranted to explain the observation. The test is normally done by comparing their Bayesian evidences.

In the main retrieval config file retrieval.toml it is selected by choosing:

[retrieval]
forward_model_type = "flat_line"

Model config file

The flat line model does not need a forward_model.toml file since it has no configurable parameters. In the prior distribution file this model requires a single free parameter, spectrum_value, that determines the flat line.

This parameter needs to have the same units as the observational data. For example, in case of a transmission spectrum, this parameter refers to the transit depth in ppm, while for an emission spectrum, it needs to have units of \(\mathrm{W} \mathrm{m^{-2}} \mathrm{\mu m^{-1}}\).

Model postprocessing

The optional postprocessing file post_process.toml has the following structure and options:

delete_sampler_files = true

The default options that are used when this file is not present are:

  • delete_sampler_files : false

  • save_spectra : false

Transmission spectrum

This forward model computes the wavelength-dependent transit depth \(D(\lambda)\) of an exoplanet atmosphere, given by

\[D(\lambda) = \left(\frac{R_p(\lambda)}{R_*}\right)^2 \ ,\]

where \(R_p(\lambda)\) is the wavelength-dependent planetary radius and \(R_*\) the radius of the host star. In BeAR, \(D(\lambda)\) has units of ppm.

In the retrieval config file retrieval.toml it is selected by choosing:

[retrieval]
forward_model_type = "transmission"

The transmission spectrum forward model has three general free parameters that have to be added to the priors configuration file. Since priors.config is name-keyed, the entries are identified by their names rather than their order:

  • log_g - logarithm of surface gravity \(\log g\) in cgs units

  • bottom_radius - planet radius at the bottom of the atmosphere

  • star_radius - stellar radius

If a reference pressure is set in the model config file (see below), the planet radius is defined at that pressure instead and the parameter is called reference_radius. In both cases, log_g refers to the same level as the radius.

Model config file

The forward_model.toml file for the transmission spectrum model has the following structure:

fit_mode = "no"
use_variable_gravity = false

atmosphere = { nb_grid_points = 150, bottom_pressure = 10, top_pressure = 1e-6 }

temperature = { model = "const", params = [] }

clouds = []

modules = []

chemistry = [
  { model = "iso", params = ["H2O", "TiO", "VO", "K"] },
  { model = "bg", params = ["H2He"] },
]

opacity = [
  { species = "CIA-H2-H2", folder = "CIA/H2-H2" },
  { species = "CIA-H2-He", folder = "CIA/H2-He" },
  { species = "H2", folder = "Rayleigh" },
  { species = "He", folder = "Rayleigh" },
  { species = "H2O", folder = "Molecules/1H2-16O__POKAZATEL_e2b" },
  { species = "TiO", folder = "Molecules/48Ti-16O__Toto" },
  { species = "VO", folder = "Molecules/51V-16O__VOMYT_e2b" },
  { species = "K", folder = "Alkali_Allard/K" },
  { species = "Na", folder = "Alkali_Allard/Na" },
]

The file starts with two inline keys. The first, fit_mode, selects the retrieval of the mean molecular weight or the scale height. Usually, BeAR will determine the mean molecular weight based on the chemical abundances of the species included in the retrieval. Sometimes, however, the background species in an atmosphere might not be known. For such a case, BeAR can use the mean molecular weight as a free parameter.

Furthermore, for transmission spectra, the surface gravity, the mean molecular weight, and the temperature might become degenerate in a retrieval. This is often the case when no constraints on the surface gravity can be provided and the dominating background species is not known. In such a scenario, BeAR can use the (constant) atmospheric scale height in units of km as a free parameter.

For the standard case, fit_mode = "no" is used. If BeAR should use the mean molecular weight as a free parameter, fit_mode = "mmw" is used, while fit_mode = "sh" is used when the scale height should be used as a free parameter instead. If either the mean molecular weight or the scale height is chosen as a free parameter, a corresponding prior (mean_molecular_weight or scale_height) needs to be added to the prior configuration file.

The second key, use_variable_gravity, is a boolean (true or false) that determines whether the gravitational acceleration is kept constant or allowed to vary with altitude throughout the atmosphere. If the key is omitted, a variable gravity is used. In this case, the gravity follows

\[g(r) = g_\mathrm{ref} \left(\frac{r_\mathrm{ref}}{r}\right)^2 \ ,\]

where \(g_\mathrm{ref}\) is the surface gravity given by log_g and \(r_\mathrm{ref}\) the planet radius. Both refer to the bottom of the atmosphere or, if it is set, to the reference pressure described below. With use_variable_gravity = false, the gravity is equal to \(g_\mathrm{ref}\) at all altitudes.

The atmosphere table sets the vertical discretisation of the atmosphere. This includes the number of atmospheric layers (nb_grid_points) as well as the bottom (bottom_pressure) and top-of-atmosphere (top_pressure) pressures in units of bars.

Optionally, the table can contain a reference pressure in bar, for example reference_pressure = 0.01. The planet radius and the surface gravity are then defined at this pressure and the altitude grid is integrated upwards and downwards from it. The radius parameter in the priors configuration file is called reference_radius in this case. The reference pressure has to be located between the bottom and top pressures, but it does not need to coincide with a grid point. Without this key, radius and gravity refer to the bottom of the atmosphere. A value close to the pressures probed by the transit, such as 0.01 bar, has two advantages: a surface gravity derived from the measured mass and transit radius is valid at this level, and the retrieved radius no longer depends on the choice of bottom_pressure.

Note

On the GPU, the transmission spectrum kernel keeps the vertical grid in the shared memory of each thread block (256 bytes per grid point). The number of grid points is therefore limited by the maximum shared memory per block of the GPU. On an NVIDIA RTX 5080, for example, 350 grid points work, while 400 fail with the error GPUassert: invalid argument. Typical values of 100 to 200 grid points are far below this limit. The CPU version has no such restriction.

With the next two entries, the parametrisation for the temperature profile and the cloud models are set. After that, optional modules can be added to the forward model via the modules array.

Finally, the different chemistry models, chemical species, and the opacity sources are selected. It is important to note that chemical species that are used as part of the chemistry models, should normally also have an associated opacity source. Otherwise, the impact of that species on the resulting spectrum might be negligible and, therefore, its abundance will be likely be unconstrained.

On the other hand, it is theoretically also possible to add opacity species without including this species in any of the chemistry models. In this case, the abundance of this species will be zero and, thus, won’t show up in the spectrum.

Model postprocessing

The optional postprocessing file post_process.toml has the following structure and options:

delete_sampler_files = true
save_temperatures = false
species_to_save = []

The default options that are used when this file is not present are:

  • delete_sampler_files : false

  • save_spectra : true

  • save_temperatures : false

  • species_to_save : none

Secondary eclipse spectrum

This forward model computes the wavelength-dependent secondary eclipse (or occultation) depth \(D(\lambda)\) of an exoplanet atmosphere, given by

\[D(\lambda) = \frac{F_p(\lambda)}{F_*(\lambda)} \left(\frac{R_p}{R_*}\right)^2 \ ,\]

where \(F_p(\lambda)\) is the outgoing flux at top of the planet’s atmosphere, \(F_*(\lambda)\) is the stellar photospheric flux, \(R_p\) is the planetary radius and \(R_*\) the radius of the host star. In BeAR, \(D(\lambda)\) has units of ppm.

In the retrieval config file retrieval.toml it is selected by choosing:

[retrieval]
forward_model_type = "secondary_eclipse"

The secondary eclipse spectrum forward model has two general free parameters that have to be added to the priors configuration file. Since priors.config is name-keyed, the entries are identified by their names:

  • log_g - logarithm of surface gravity \(\log g\) in cgs units

  • radius_ratio - ratio of the planet’s and stellar radius \(\mathrm{R_p/R_*}\)

Model config file

The forward_model.toml file for the secondary eclipse spectrum model has the following structure:

atmosphere = { nb_grid_points = 70, bottom_pressure = 100, top_pressure = 1e-3 }

temperature = { model = "poly", params = ["6", "1"] }

stellar_spectrum = { model = "file", params = ["SecondaryEclipseExample/WASP-43.dat"] }

clouds = []

radiative_transfer = { model = "scm", params = [] }

chemistry = [
  { model = "eq", params = ["fastchem_parameters.dat"] },
]

opacity = [
  { species = "CIA-H2-H2", folder = "CIA/H2-H2" },
  { species = "CIA-H2-He", folder = "CIA/H2-He" },
  { species = "Na", folder = "Alkali_Allard/Na" },
  { species = "K", folder = "Alkali_Allard/K" },
  { species = "H2O", folder = "Molecules/1H2-16O__POKAZATEL_e2b" },
  { species = "CO", folder = "Molecules/12C-16O__Li2015_e2b" },
  { species = "TiO", folder = "Molecules/48Ti-16O__Toto_e2b" },
  { species = "VO", folder = "Molecules/51V-16O__VOMYT_e2b" },
  { species = "SH", folder = "Molecules/32S-1H__GYT_e2b" },
  { species = "H2S", folder = "Molecules/1H2-32S__AYT2_e2b" },
  { species = "FeH", folder = "Molecules/56Fe-1H__Yueqi_e2b" },
  { species = "CH4", folder = "Molecules/12C-1H4__YT34to10_e2b" },
  { species = "CO2", folder = "Molecules/12C-16O2__CDSD_4000_e2b" },
  { species = "HCN", folder = "Molecules/1H-12C-14N__Harris_e2b" },
  { species = "MgH", folder = "Molecules/26Mg-1H__Yadin_e2b" },
  { species = "TiH", folder = "Molecules/48Ti-1H__MoLLIST_e2b" },
  { species = "CrH", folder = "Molecules/52Cr-1H__Yueqi_e2b" },
  { species = "CaH", folder = "Molecules/40Ca-1H__MoLLIST_e2b" },
]

The atmosphere table sets the vertical discretisation of the atmosphere. This includes the number of atmospheric layers (nb_grid_points) as well as the bottom (bottom_pressure) and top-of-atmosphere (top_pressure) pressures in units of bars.

With the next entries, the parametrisation for the temperature profile, the stellar spectrum, and the cloud models are set.

After that, the radiative transfer scheme is chosen via radiative_transfer = { model = "...", params = [...] }. BeAR offers several schemes, from the fast, purely absorbing short characteristics method (scm) to multi-stream solvers that include multiple scattering by clouds and Rayleigh scattering (toon, dda, adding_doubling, and disort). They are described in the section on radiative transfer schemes.

Finally, the different chemistry models, chemical species, and the opacity sources are selected. It is important to note that chemical species that are used as part of the chemistry models, should normally also have an associated opacity source. Otherwise, the impact of that species on the resulting spectrum might be negligible and, therefore, its abundance will be likely be unconstrained.

On the other hand, it is theoretically also possible to add opacity species without including this species in any of the chemistry models. In this case, the abundance of this species will be zero and, thus, won’t show up in the spectrum.

Model postprocessing

The optional postprocessing file post_process.toml has the following structure and options:

delete_sampler_files = true
save_spectra = true
save_temperatures = true
save_contribution_functions = false
species_to_save = ["H2O", "CO", "CO2", "CH4", "NH3"]

The default options that are used when this file is not present are:

  • delete_sampler_files : false

  • save_spectra : true

  • save_temperatures : true

  • save_contribution_functions : false

  • species_to_save : none

Secondary eclipse spectrum with planetary blackbody

This forward model computes the wavelength-dependent secondary eclipse (or occultation) depth \(D(\lambda)\) of an exoplanet atmosphere, given by

\[D(\lambda) = \frac{F_p(\lambda)}{F_*(\lambda)} \left(\frac{R_p}{R_*}\right)^2 \ ,\]

where \(F_p(\lambda)\) is the outgoing flux at top of the planet’s atmosphere, \(F_*(\lambda)\) is the stellar photospheric flux, \(R_p\) is the planetary radius and \(R_*\) the radius of the host star. In BeAR, \(D(\lambda)\) has units of ppm.

This model is a special case of the secondary eclipse spectrum model, where the planet’s flux is assumed to be blackbody radiation. This is often used to test if the observational data warrants a more complex model or when only a few, usually photometric, data points are available.

In the retrieval config file retrieval.toml it is selected by choosing:

[retrieval]
forward_model_type = "secondary_eclipse_bb"

This forward model has two general free parameters that have to be added to the priors configuration file:

  • planet_temperature - the planet’s effective temperature in Kelvin

  • radius_ratio - ratio of the planet’s and stellar radius \(\mathrm{R_p/R_*}\)

In addition, the parameters of the chosen stellar spectrum model are required, e.g. star_t_eff for a blackbody star (see Stellar spectra).

Model config file

The forward_model.toml file for the secondary eclipse spectrum model has the following structure:

stellar_spectrum = { model = "blackbody", params = [] }

clouds = []

chemistry = []

It contains a single option related to the description of the stellar spectrum. Information on the available options can be found in the section on stellar spectra.

Model postprocessing

The optional postprocessing file post_process.toml has the following structure and options:

delete_sampler_files = true

The default options that are used when this file is not present are:

  • delete_sampler_files : false

  • save_spectra : true

Emission spectrum

This forward model computes the emission spectrum \(F(\lambda)\) of an exoplanet or brown dwarf atmosphere. In BeAR, \(F(\lambda)\) has units of \(\mathrm{W} \mathrm{m^{-2}} \mathrm{\mu m^{-1}}\).

In the retrieval config file retrieval.toml it is selected by choosing:

[retrieval]
forward_model_type = "emission"

The emission spectrum forward model has three general free parameters that have to be added to the priors configuration file. Since priors.config is name-keyed, the entries are identified by their names:

  • log_g - logarithm of surface gravity \(\log g\) in cgs units

  • scaling_factor - a scaling factor \(f\) for the radius/distance relationship, where the radius is internally set to 1 Jupiter radius

  • distance - distance to the object

Model config file

The forward_model.toml file for the emission spectrum model has the following structure:

atmosphere = { nb_grid_points = 70, bottom_pressure = 300, top_pressure = 1e-3 }

temperature = { model = "cubicbspline", params = ["5"] }

clouds = []

radiative_transfer = { model = "scm", params = [] }

chemistry = [
  { model = "iso", params = ["H2O", "CH4", "NH3", "K", "H2S", "CO2"] },
  { model = "bg", params = ["H2He"] },
]

opacity = [
  { species = "CIA-H2-H2", folder = "CIA/H2-H2" },
  { species = "CIA-H2-He", folder = "CIA/H2-He" },
  { species = "K", folder = "Alkali_Allard/K" },
  { species = "Na", folder = "Alkali_Allard/Na" },
  { species = "H2O", folder = "Molecules/1H2-16O__POKAZATEL_e2b" },
  { species = "CH4", folder = "Molecules/12C-1H4__YT34to10_e2b" },
  { species = "NH3", folder = "Molecules/14N-1H3__CoYuTe_e2b" },
  { species = "H2S", folder = "Molecules/1H2-32S__AYT2_e2b" },
  { species = "CO2", folder = "Molecules/12C-16O2__CDSD_4000_e2b" },
]

The atmosphere table sets the vertical discretisation of the atmosphere. This includes the number of atmospheric layers (nb_grid_points) as well as the bottom (bottom_pressure) and top-of-atmosphere (top_pressure) pressures in units of bars.

With the next two entries, the parametrisation for the temperature profile and the cloud models are set.

After that, the radiative transfer scheme is chosen via radiative_transfer = { model = "...", params = [...] }. BeAR offers several schemes, from the fast, purely absorbing short characteristics method (scm) to multi-stream solvers that include multiple scattering by clouds and Rayleigh scattering (toon, dda, adding_doubling, and disort). They are described in the section on radiative transfer schemes.

Finally, the different chemistry models, chemical species, and the opacity sources are selected. It is important to note that chemical species that are used as part of the chemistry models, should normally also have an associated opacity source. Otherwise, the impact of that species on the resulting spectrum might be negligible and, therefore, its abundance will be likely be unconstrained.

On the other hand, it is theoretically also possible to add opacity species without including this species in any of the chemistry models. In this case, the abundance of this species will be zero and, thus, won’t show up in the spectrum.

Model postprocessing

The optional postprocessing file post_process.toml has the following structure and options:

delete_sampler_files = true
save_spectra = true
save_temperatures = true
save_effective_temperatures = true
save_contribution_functions = false
species_to_save = []

The default options that are used when this file is not present are:

  • delete_sampler_files : false

  • save_spectra : true

  • save_temperatures : true

  • save_effective_temperatures : true

  • save_contribution_functions : false

  • species_to_save : none

Phase curve (high-resolution)

This forward model is used for high-resolution cross-correlation spectroscopy and phase-curve retrievals. It computes both a low-resolution occultation depth and a high-resolution planet-to-star flux ratio \(F_\mathrm{p}/F_\mathrm{s}\) on a separate high-resolution spectral grid. The full high-resolution workflow — the orbital-velocity model, exposure blurring, model filtering and re-injection, and the cross-correlation likelihoods — is described on a dedicated page: High-resolution retrievals.

In the retrieval config file retrieval.toml it is selected by choosing:

[retrieval]
forward_model_type = "phase_curve"

It has two general free parameters, identified by name in priors.config:

  • log_g - logarithm of surface gravity \(\log g\) in cgs units

  • radius_ratio - the planet-to-star radius ratio \(R_\mathrm{p}/R_\mathrm{s}\)

When high-resolution observations are present, BeAR additionally appends the high-resolution tail parameters kp, vsys, dphi and, optionally, alpha to the parameter list, together with any parameters required by the selected modules (see High-resolution retrievals for details).

Model config file

The forward_model.toml file for the phase-curve model uses the same building blocks as the other models (atmosphere, temperature, stellar_spectrum, clouds, radiative_transfer, chemistry, opacity; see Radiative transfer schemes for the available radiative transfer schemes) and adds two high-resolution-specific pieces:

The stellar_spectrum table of this model additionally accepts the highres_stellar_smooth_sigma key to smooth the stellar spectrum for the high-resolution model (see Stellar spectra). Its post_process.toml file supports the same keys as the secondary eclipse model plus the boolean save_hr_spectra_all (default false), which writes the high-resolution spectrum for every posterior sample instead of only the best-fit model.

The stellar_spectrum table may also carry the optional highres_stellar_smooth_sigma key used for high-resolution re-injection (see High-resolution retrievals).