skyscapes.physical_model.exojax.components.species#
Atmospheric-gas components.
Each MolecularSpecies is a self-contained record for one
atmospheric molecule: its per-planet log mass-mixing ratio (a PyTree
leaf, fittable) plus the shared static data needed to evaluate both
line absorption and Rayleigh scattering for that species. The
atmosphere holds a tuple of these plus an optional
BulkGasResidual for the implicit residual gas (N2 for
terrestrial atmospheres, H2 for gas giants).
To mix and match molecules: just change the tuple. To add a new
molecule supported by HITRAN, register its recipe in
MOLECULE_RECIPES. The 8-molecule set used by Star+ “Earth
through time” (H2O, O2, O3, CH4, CO2, CO, N2O, SO2) is preregistered.
Attributes#
Classes#
One atmospheric molecule with an altitude-resolved mixing ratio. |
|
Implicit residual gas filling the unallocated mass fraction. |
|
Build instructions for one molecule. |
|
Build instructions for the implicit residual gas. |
Functions#
|
Compute Rayleigh cross-section [cm^2/molecule] vs wavenumber. |
|
Construct (molmass, opa, rayleigh_xs) for one molecule. |
|
Fallback molar mass [g/mol] when HITRAN provides no entry. |
|
Construct (molmass, rayleigh_xs) for the implicit residual gas. |
Module Contents#
- class skyscapes.physical_model.exojax.components.species.MolecularSpecies[source]#
Bases:
equinox.ModuleOne atmospheric molecule with an altitude-resolved mixing ratio.
The mixing ratio is encoded as a profile component (e.g.
ConstantMmrfor well-mixed gases,StratosphericPeakMmrfor O3,TroposphericMmrfor H2O) rather than a single scalar, so altitude variation is represented explicitly.- Attributes:
- profile: Per-species mmr profile. Owns the fittable
log-mixing-ratio leaves.
name: Molecule name, e.g.
"H2O". molmass: Molar mass [g/mol]. opa: Opacity engine. Either an ExoJAXOpaPremodit(forHITRAN-backed line-list molecules) or
O3ChappuisOpacity(for visible cross-section absorbers like O3). May beNoneif the species contributes only Rayleigh scattering.- rayleigh_xs: Pre-computed Rayleigh cross-section
[cm^2/molecule] on the atmosphere’s wavenumber grid, shape
(n_nu,). Set to all-zeros to disable per-species Rayleigh contribution.
- opa: Any#
- rayleigh_xs: jaxtyping.Array#
- class skyscapes.physical_model.exojax.components.species.BulkGasResidual[source]#
Bases:
equinox.ModuleImplicit residual gas filling the unallocated mass fraction.
The mass-mixing ratio is computed dynamically as
max(0, 1 - sum(tracked species mmrs)). Contributes only to Rayleigh scattering (no line-list absorption is associated with the bulk gas in this model – N2 is essentially transparent across 300–1100 nm, H2/He likewise).- Attributes:
name: Gas name, e.g.
"N2"for Earth or"H2"for gas giants. molmass: Molar mass [g/mol]. rayleigh_xs: Rayleigh cross-section [cm^2/molecule] on theatmosphere’s wavenumber grid, shape
(n_nu,).
- rayleigh_xs: jaxtyping.Array#
- skyscapes.physical_model.exojax.components.species.N2O_POLARIZABILITY_CM3 = 3.03e-24#
- class skyscapes.physical_model.exojax.components.species.MoleculeRecipe[source]#
Build instructions for one molecule.
- Attributes:
- name: Molecule name (must match ExoJAX’s HITRAN / polarizability
keys when those tables apply).
- psg_xs_url: If set, use a PSG cross-section file at this URL
(
PsgCrossSectionOpacity) instead of an ExoJAX line-list opa. Required for species whose absorption is dominated by electronic transitions in the visible/NIR (e.g. O3 Chappuis, SO2 UV).- psg_xs_molmass: Molar mass [g/mol]; required when
psg_xs_url is set since we can’t extract it from HITRAN in that case.
- polarizability_override: Explicit polarizability [cm^3] for the
Rayleigh cross-section, used when ExoJAX’s table doesn’t have an entry.
NoneletsOpaRayleighlook it up.
- skyscapes.physical_model.exojax.components.species.PSG_O3_URL = 'https://psg.gsfc.nasa.gov/data/linelists/xuv/data/o3.txt'#
- skyscapes.physical_model.exojax.components.species.PSG_SO2_URL = 'https://psg.gsfc.nasa.gov/data/linelists/xuv/data/so2.txt'#
- skyscapes.physical_model.exojax.components.species.MOLECULE_RECIPES: dict[str, MoleculeRecipe]#
- class skyscapes.physical_model.exojax.components.species.BulkGasRecipe[source]#
Build instructions for the implicit residual gas.
- Attributes:
- name: Gas name; must match an ExoJAX polarizability key (or
provide
polarizability_override).
molmass: Molar mass [g/mol]. polarizability_override: Override polarizability if missing
from ExoJAX’s table.
- skyscapes.physical_model.exojax.components.species.BULK_GAS_RECIPES: dict[str, BulkGasRecipe]#
- skyscapes.physical_model.exojax.components.species._build_rayleigh_xs(nu_grid, name, polarizability_override)[source]#
Compute Rayleigh cross-section [cm^2/molecule] vs wavenumber.
- skyscapes.physical_model.exojax.components.species.build_species_prebuilt(*, name, nu_grid, nu_min, nu_max, databases_dir, crit)[source]#
Construct (molmass, opa, rayleigh_xs) for one molecule.
Used by
build_exojax_engines; not typically called by users directly. Returns the static parts of aMolecularSpecies(everything exceptlog_mmr).
- skyscapes.physical_model.exojax.components.species.recipe_default_molmass(name)[source]#
Fallback molar mass [g/mol] when HITRAN provides no entry.
Uses ExoJAX’s
molinfo.molmasslookup. Used when the species has no HITRAN lines in the configured wavenumber range and we therefore can’t construct an MdbHitran to get the value from.