Stellar spectra¶
Some forward models or optional modules in BeAR require a stellar spectrum as input. BeAR can handle stellar spectra in the three different ways:
Blackbody spectra¶
The simplest way to provide a stellar spectrum is by using a blackbody spectrum. It is chosen by using
the model keyword blackbody in the stellar_spectrum table in the forward_model.toml file:
stellar_spectrum = { model = "blackbody", params = [] }
This option requires the user to provide the temperature of the blackbody spectrum in Kelvin as a free
parameter in the priors configuration file, using the prior name star_t_eff.
Tabulated stellar spectrum¶
If a tabulated stellar spectrum is used, the model keyword file has to be used in the
stellar_spectrum table in the forward_model.toml file:
stellar_spectrum = { model = "file", params = ["SecondaryEclipseExample/WASP-43.dat"] }
with the file name of the stellar spectrum given as the single entry in params. The file location has to be given relative
to the working directory from which the Python driver script is run (the BeAR root directory for the provided examples).
It has the following structure:
#Wavelength (micron) Flux (W/m2/micron)
5.551000e-02 5.693171e-33
5.552000e-02 5.800245e-33
5.553000e-02 5.909291e-33
5.554000e-02 6.020349e-33
5.555000e-02 6.133451e-33
5.556000e-02 6.248634e-33
5.557000e-02 6.365938e-33
5.558000e-02 6.485398e-33
5.559000e-02 6.607055e-33
5.560000e-02 6.730948e-33
5.561000e-02 6.857117e-33
5.562000e-02 6.985604e-33
5.563000e-02 7.116450e-33
5.564000e-02 7.249697e-33
5.565000e-02 7.385387e-33
5.566000e-02 7.523568e-33
5.567000e-02 7.664280e-33
5.568000e-02 7.807571e-33
5.569000e-02 7.953487e-33
5.570000e-02 8.102075e-33
5.571000e-02 8.253380e-33
5.572000e-02 8.407459e-33
5.573000e-02 8.564354e-33
5.574000e-02 8.724117e-33
5.575000e-02 8.886800e-33
5.576000e-02 9.052455e-33
The first column contains the wavelengths in micrometers, while the second column contains the stellar photospheric flux in \(\mathrm{W/m^2/\mu m}\). The spectrum will be interpolated to the wavenumber grid of the retrieval. However, it needs to cover the entire wavelength range of the observations that are used in a retrieval. BeAR will not extrapolate the spectrum but replace missing values outside of the tabulated range with zeros. This stellar spectrum does not require a free parameter in the priors configuration file.
Grid of tabulated stellar spectra¶
In some cases, it is necessary to use a grid of stellar atmosphere models. This is especially the case when one wants to sample stellar spectra for a range of different effective temperatures, surface gravities, or metallicities. Examples of grids of stellar spectra are the PHOENIX stellar atmosphere library or the SPHINX library
To use a grid of stellar spectra, the model keyword grid has to be used in the
stellar_spectrum table in the forward_model.toml file:
stellar_spectrum = { model = "grid", params = ["/data/phoenix_grid/"] }
with the single params entry being a path to the folder that contains the grid of stellar atmosphere models.
BeAR currently assumes that the grid is given in terms of:
stellar effective temperature in Kelvin
logarithm of the surface gravity in \(\mathrm{cm/s^2}\)
metallicity in logarithm of solar units (typically [Fe/H])
The folder with the stellar grid should contain a file called grid_parameters.dat that
lists the parameters of the grid. It needs to have the following structure:
2300.0 2400.0 2500.0 2600.0 2700.0 2800.0 2900.0 3000.0 3100.0 3200.0 3300.0 3400.0 3500.0 3600.0 3700.0
2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
-1.0 -0.5 0.0 0.5 1.0
wavelengths.bin
3500.0 3.5 -0.5 lte03500-3.50-0.5.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
3400.0 3.5 0.0 lte03400-3.50-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
5300.0 5.5 0.5 lte05300-5.50+0.5.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
3100.0 6.0 0.5 lte03100-6.00+0.5.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
5700.0 3.0 -0.5 lte05700-3.00-0.5.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
3000.0 6.0 -0.5 lte03000-6.00-0.5.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
3400.0 6.0 0.0 lte03400-6.00-0.0.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
2300.0 4.0 -0.5 lte02300-4.00-0.5.PHOENIX-ACES-AGSS-COND-2011-HiRes.bin
The first line contains the list of stellar effective temperatures, the second line the list of surface gravities, and the third line the list of metallicities. BeAR assumes that the grid rectangular and regular, which means that every possible combinations of the parameters should have a tabulated stellar spectrum. If the original grid is not complete, the user has to extrapolate the grid to cover all possible combinations or create dummy data sets if those spectra will not get sampled during a retrieval.
The fourth line contains the name of the file that contains the wavelength grid for the stellar spectra. Each spectrum has to be tabulated at these wavelengths. These wavelengths have to be in micrometers and saved in a binary file that contains single precision floating point numbers.
Below the wavelength file, the actual grid of stellar spectra is listed. Each line contains the effective temperature, the surface gravity, the metallicity, and the file name of the tabulated spectrum. Like the wavelength file, the spectra have to be saved in binary format and have to be tabulated at the wavelengths listed in the wavelength file. The spectra need to cover the entire wavelength range of the observations that are used in a retrieval. BeAR will not extrapolate the spectra but replace missing values outside of the tabulated range with zeros.
The binary files should contain the stellar photospheric flux in \(\mathrm{W/m^2/\mu m}\) as single-precision floating point numbers. As mentioned above, BeAR expects to find a stellar spectrum entry for every possible combination of stellar parameters. If this is not the case, an error message will be displayed and the code will terminate.
The use of the stellar grid requires the user to provide the effective temperature, the surface gravity, and the
metallicity as free parameters in the priors configuration file, using the prior names star_t_eff,
star_log_g, and star_metallicity.
Smoothing for high-resolution re-injection¶
For the phase-curve forward model, an optional
highres_stellar_smooth_sigma key can be added to the stellar_spectrum inline table in the
forward_model.toml file, independently of the chosen stellar-spectrum model, for example:
stellar_spectrum = { model = "file", params = ["WASP-77Ab/WASP-77A.dat"], highres_stellar_smooth_sigma = 200 }
When set, BeAR wraps the chosen stellar-spectrum model in a SmoothedStellarSpectrum decorator that
applies a Gaussian smoothing to the stellar spectrum. The value of highres_stellar_smooth_sigma is
the standard deviation \(\sigma\) of the Gaussian kernel given in pixels of the spectral grid
(i.e. the number of wavenumber grid points), not in wavelength or wavenumber units. Internally the
Gaussian is approximated by a fast three-pass box filter, which is accurate to better than 0.1 % for
\(\sigma \gtrsim 5\) px.
The default value is 0, which disables the smoothing and leaves the stellar spectrum untouched.
The key is only read by the phase-curve model; the other forward models ignore it.
The smoothing is used to produce a smooth stellar reference spectrum for high-resolution re-injection
and phase-curve modelling; see High-resolution retrievals for the reasoning behind this step.