Temperature, Pressure, and Chemistry¶
With the opacity data in place from Setup and opacity data, we can now build the atmosphere itself. This notebook introduces the three interchangeable components that form the physical foundation of every TauREx model: a temperature profile, a pressure grid, and a chemical mixture. The Transmission spectrum basics and Emission spectrum basics walkthroughs plug these directly into forward models.
Before any spectrum can be computed, the state of the atmosphere must be specified:
Temperature profile — how temperature varies with altitude.
Pressure grid — the vertical extent and resolution of the atmosphere.
Chemistry — which gases are present and at what mixing ratios.
Each of these is a separate, swappable object. Changing one — say, switching from an isothermal to a parametric temperature profile — does not require re-building the rest of the model. More information about temperature profiles is here, pressure grids are here, and chemistry options are here.
Data Note¶
This notebook uses the opacity and CIA files set up in Setup and opacity data. TauREx provides the software to work with these datasets; the files themselves are third-party products from ExoMol and HITRAN.
[1]:
from _shared import build_base_components
context = build_base_components(download=False)
iso_t = context['iso_t']
press = context['press']
chemistry = context['chemistry']
print('Built a reusable atmospheric context.')
Built a reusable atmospheric context.
Pressure and Temperature Profiles¶
A quick inspection of the vertical grid confirms that the pressure boundaries, layer count, and temperature values are all as expected. These profile objects will be handed directly to the forward models in Transmission spectrum basics and Emission spectrum basics.
More information about temperature profiles is here, and pressure-grid options are here.
[2]:
iso_t, press
print(f'Layers: {press.nLayers}')
print(f'Pressure range: {press.profile.min():.3e} Pa to {press.profile.max():.3e} Pa')
print(f'Isothermal temperature: {iso_t.isoTemperature} K')
Layers: 100
Pressure range: 1.122e-05 Pa to 8.913e+04 Pa
Isothermal temperature: 2000.0 K
[3]:
pressure_bar = press.profile / 1e5
print('First five pressure levels in bar:')
print(pressure_bar[:5])
print('Last five pressure levels in bar:')
print(pressure_bar[-5:])
First five pressure levels in bar:
[0.89125094 0.70794578 0.56234133 0.44668359 0.35481339]
Last five pressure levels in bar:
[2.81838293e-10 2.23872114e-10 1.77827941e-10 1.41253754e-10
1.12201845e-10]
Chemistry and Gas Mixtures¶
Atmospheric chemistry in TauREx is split into two roles:
Active gases carry explicit absorption cross-sections and imprint molecular features on the spectrum (H₂O, CH₄, CO₂, and similar).
Fill gases (H₂, He) establish the background pressure structure and drive continuum processes such as CIA and Rayleigh scattering.
The choice of active gases directly determines which molecular signatures will appear in the simulated spectrum. More information about chemistry components is here.
[4]:
print(f'Active gases: {chemistry.activeGases}')
print(f'Inactive gases: {chemistry.inactiveGases}')
for gas_name, mix_ratio in zip(chemistry.gases, chemistry.mixProfile[:, 0]):
print(f'{gas_name}: {mix_ratio:.3e}')
Active gases: ('H2O', 'CH4', 'NH3', 'CO2')
Inactive gases: ('H2', 'He')
H2: 8.495e-01
He: 1.492e-01
H2O: 1.000e-03
CH4: 1.000e-04
NH3: 1.000e-04
CO2: 1.000e-04
[5]:
layer0_total = chemistry.mixProfile[:, 0].sum()
print(f'Total mixing ratio in the first layer: {layer0_total:.6f}')
Total mixing ratio in the first layer: 1.000000