While correlated-k (see Section 3.2.2) greatly speeds up the radiative transfer calculation, deriving the total opacity from a large number of individual line species (see AppendixA.1) is still costly in computational terms. For retrieval applications millions to hundreds of mil- lions of spectra need to be generated at high enough spectral resolution, such that even if parallelization is used the amount of time spent on the computation of a single spectrum should not exceed a couple of seconds. It would thus be favorable to be able to calculate spectra without having to calculate the total opacity tot(g), and to use the i(g)of the indi- vidual species i directly. I will outline how to do this below.
6.3.1 Emission spectra
For the calculation of the emission spectra one has to solve the formal radiative transfer equation
dI(⌧ )
d⌧ = S(⌧ ) I(⌧ ) , (6.11)
where, as usual, I is the specific intensity, S the source function and ⌧ the optical depth. Wavelength dependencies have been neglected in this notation. Next I use that, if S is known, the solution to this first order differential equation can be written as
I(⌧ ) = I(0)e ⌧ + Z ⌧
0
S(⌧0)e⌧0 ⌧d⌧0, (6.12) which is easily verified by inserting this expression into the above equation of radiative transfer. For the outgoing intensity Itopat the top of the atmosphere one can thus write
Itop = IbotTatmo+ Z 1
Tatmo
S(T )dT , (6.13)
where Ibot is the upward pointing intensity at the bottom of the atmosphere, T (⌧) = e ⌧ is the transmission from a given point in the atmosphere to the top, with Tatmo =T (⌧atmo) being the transmission from the bottom of the atmosphere to the top. For the emission- only case, when assuming local thermal equilibrium (LTE) for the atmospheric gas, one can set S = B, where B is the Planck function evaluated at the frequency and temperature of interest. In a numerical, discrete-layer representation, the arising intensity in the atmosphere
can thus be written as
¯
Itop = ¯B(Tbot) ¯Tatmo+ 1 2
NXL 1 i=1
⇥ ¯B(Ti) + ¯B(Ti+1)⇤ ¯Ti T¯i+1 , (6.14) where NL is the number of atmospheric layers and the symbol ¯Qdenotes the wavelength average of a quantity Q within the correlated-k spectral bin of interest. Here I used the fact that the Planck function is roughly constant across one of these bins, and replaced it with its mean value within the bin, before calculating the average of Itop. This equation has the advantage that it only depends on the wavelength averaged transmission, which can be obtained without knowing tot(g), see below. This makes the evaluation of Equation 6.14
fast, and is the reason why it is used in the correlated-k retrieval code NEMESIS. Equation
6.14is equivalent to their Equation 13 inIrwin et al.(2008). I thus follow their example for the retrieval radiative transport.
Using the correlated-k assumption, and further making the standard assumption that the opacity distribution functions of given molecular species are uncorrelated (see Section3.2.2), one can write the transmission from a layer i, at pressure Pi, to the top of the atmosphere, at pressure P = 0, as ¯ Ti = NspeciesY j=1 2 4 Ng X l=1 exp ✓ Z Pi 0 Xjlj a dP ◆ gl 3 5 , (6.15)
where Nspeciesis the number of species, Ngthe number of the Gaussian quadrature points in g-space, X the mass fraction of a given species in a given atmospheric layer, a the grav- itational acceleration within the atmosphere, and lj the opacity of species j at g = gl, see AppendixA.5for the derivation. In particular one sees that if only the intensity aris- ing from atmospheric emission is of interest, only the atmospheric transmissions needs to be computed, which are themselves the products of the transmissions of the atmosphere’s opacity species. This means that the numerically expensive computation of the combined opacity table of all species is not necessary, which allows for a fast correlated-k application in retrieval calculations.
Note that the technique outlined in this section cannot be used for the petitCODE cal- culations. For the petitCODE temperature iteration we need to calculate terms such as (see Section3.6) J = 1 J NX⌫ i=1 Z 1 0 i(g)Ji(g)dg ⌫i, (6.16)
where N ⌫ is the number of spectral bins, and J = PNi=1⌫ hR1
0 Ji(g)dg i
⌫i. This quantity cannot be expressed using the atmospheric transmission functions alone. Hence tot(g)has to be calculated in petitCODE, such that the functions Q(g) of radiative quantities Q can be computed.
164 Chapter 6. Atmospheric parameter retrieval from spectral observations
6.3.2 Transmission spectra
As can be seen from Equation3.123in Section3.8, the planet’s transmission radius depends only on the atmospheric transmission, such that also transmission spectra can be calculated quickly, i.e. without calculating tot(g).
6.3.3 Implementation
I implemented a fast radiative transfer scheme for the calculation of transmission and emis- sion spectra, based on the theory outlined above. For the comparison between the model results and observations the statistical tools publicly available for Python are very useful, such that Python is an ideal language to carry out the retrieval. However, because Python is a script language, it is rather slow, and the numerically expensive part of calculating the planetary model spectra should not be carried out in Python itself. Hence I implemented the methods outlined in sections6.3.1and6.3.2in FORTRAN, and made them available for use in Python using the F2PY package.1
For all molecular line opacities I use the same wavelength and pressure–temperature grid as used for petitCODE, see Section3.3. Identically to the treatment in petitCODE, I use a wavelength binning such that / = 1000 at all wavelengths. The g-grid for the (g) opacities is set up to be a 16-point Gaussian quadrature grid, separated in an 8-point grid ranging from g = 0 to g = 0.9 and another 8-point grid ranging from g = 0.9 to g = 1. Additionally, I solve the radiative transport on a 3-point Gaussian grid for the radiation angle µ = cos#, rather than the 20-point Gaussian grid used in petitCODE. A comparison of the retrieval code results to petitCODE spectra yielded negligible differences, see Section
6.3.4.
6.3.4 Verification
In order to verify my radiative transport implementation for the retrieval code, I compared its spectral calculations to the solutions obtained with petitCODE. To that end I took a P –T structure for the fiducial, globally-averaged insolation case of TrES-4b fromMollière et al.
(2017). For this test I only considered H2O, CH4, CO, and CO2 line opacities, as well as H2–H2 and H2–He CIA opacities. Nominally, the correlated-k radiative transfer code for retrieval is set up to consider vertically constant molecular abundances, hence I adopted such an abundance model for the test case here. Note, however, that the retrieval correlated- k code can in principle use any arbitrary vertical abundance profile. The adopted mass fractions were XH2O = 10
2.5, XCH
4 = 10
5, XCO = 10 2, and XCO
2 = 10
4. For the hydrogen and helium abundances I adopted XH2 = 0.75⇥ XH/Heand XHe= 0.25⇥ XH/He, where XH/He = 1 XH2O XCO XCO2 XCH4. The comparison model, regarded as the “truth”, were spectra calculated with the petitCODE radiative transfer modules, using the same atmospheric setup. The petitCODE radiative transfer treatment was verified in Section
3.2.3.
2 3 4 5 6 7 8 9 Wavelength (micron) 0 1 2 3 4 5 6 Surface flux F⌫ (10 6erg cm 2s 1Hz 1) petitCODE / = 10000 line-by-line / = 20000 line-by-line Retrieval correlated-k 2 3 4 5 6 7 8 9 −15 −5 5 15 Relative error (%) 2 3 4 5 6 7 8 9 Wavelength (micron) 2.08 2.10 2.12 2.14 2.16 2.18 2.20 Transmission radius (RX ) petitCODE Retrieval correlated-k 2 3 4 5 6 7 8 9 −0.10 −0.05 0.00 0.05 0.10 Relative error (%)
FIGURE6.1: Uppermost panel: emission spectrum using the temperature structure of the fiducial, globally-averaged insola-
tion case of TrES-4b fromMollière et al.(2017), using only H2O, CH4, CO, and CO2line opacities with vertically constant abundances, as well as H2–H2and H2–He CIA opacities. Scattering has been neglected. The different lines denote the pe- titCODE radiative transfer (black spectrum), verified in Section3.2.3, and the retrieval correlated-k implementation (orange line). Liny-by-line calculations for the resolutions / = 10000(purple line) and / = 20000(olive line) are shown as well, having been re-binned to the correlated-k resolution. Upper middle panel: relative deviation of the three cases to the petitCODE solution. Lower middle panel: transmission spectrum for the same case as shown above. Only the petitCODE and retrieval correlated-k model are compared here. The corresponding relative deviation of the retrieval correlated-k calculation to the petitCODE result is given in the lowermost panel.
When starting the implementation of the retrieval scheme I also implemented a line- by-line radiative transfer scheme, i.e. solving the radiative transfer equation with the fre- quency as the spectral coordinate, rather than the cumulative opacity distribution function g. To remain in the same order of magnitude for the numerical costs and memory used by the correlated-k as well as line-by-line methods, I implemented the line-by-line versions at wavelength binnings of / = 10000and 20000. In order to obtain the opacity grid for the line-by-line case, I randomly sampled my fiducial opacity grid, which has a resolution of / = 106, as described as a possible method in Section3.2.2. Only the calculation of
166 Chapter 6. Atmospheric parameter retrieval from spectral observations
emission spectra was implemented for the line-by-line method, such that I do not show it in the comparison of transmission spectra.
I show the results of the comparison and verification study in Figure6.1. For the emis- sion spectra, one can see that the relative flux deviation of the correlated-k implementation of the retrieval model is always below 2% when compared to the petitCODE solution, and usually smaller. As described in Section 3.2.3, the randomly sampled line-by-line opacity cases have much larger errors, with a larger scatter.The scattering range is in the 5 to 10% regime. As expected, the scatter seems to become smaller at larger resolution. The system- atic offsets of the line-by-line case may be due to the line distribution in a given spectral bin, and the average error introduced when randomly sampling an opacity value from that bin. Furthermore, a given P-T opacity grid point was sampled only once, when generating the reduced resolution line-by-line opacities. The sampling error is thus frozen, and affects the opacity error in the temperature range in which the grid point is used for the P –T interpo- lation. It would be a cleaner way to sample the line-by-line opacities at high-resolution (106) for every interpolation step, but loading these opacities into memory is computationally unfeasible.
The transmission spectra are compared in the lower two panels of Figure6.1. As stated above, only the two correlated-k implementations, of the retrieval code and of petitCODE, are compared. Again, the two implementations compare very well, and the transmission radius error is below 0.05 %. However, most of the radius contribution stems from the deep regions of the planet with zero transmission, a value which would be obtained inde- pendently from the radiative transfer implementation, because then the exact value of the (large) opacity is not important. It is thus better to normalize the deviation with the trans- mission signal amplitude, which is roughly 0.06 RX, for a planet size of about 2.1 RX.2 The
relative deviation between the two correlated-k implementations, when measured relative to the amplitude is thus always below ⇠ 2 %.