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#

MolecularSpecies

One atmospheric molecule with an altitude-resolved mixing ratio.

BulkGasResidual

Implicit residual gas filling the unallocated mass fraction.

MoleculeRecipe

Build instructions for one molecule.

BulkGasRecipe

Build instructions for the implicit residual gas.

Functions#

_build_rayleigh_xs(nu_grid, name, polarizability_override)

Compute Rayleigh cross-section [cm^2/molecule] vs wavenumber.

build_species_prebuilt(*, name, nu_grid, nu_min, ...)

Construct (molmass, opa, rayleigh_xs) for one molecule.

recipe_default_molmass(name)

Fallback molar mass [g/mol] when HITRAN provides no entry.

build_bulk_prebuilt(*, name, nu_grid)

Construct (molmass, rayleigh_xs) for the implicit residual gas.

Module Contents#

class skyscapes.physical_model.exojax.components.species.MolecularSpecies[source]#

Bases: equinox.Module

One atmospheric molecule with an altitude-resolved mixing ratio.

The mixing ratio is encoded as a profile component (e.g. ConstantMmr for well-mixed gases, StratosphericPeakMmr for O3, TroposphericMmr for 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 ExoJAX OpaPremodit (for

HITRAN-backed line-list molecules) or O3ChappuisOpacity (for visible cross-section absorbers like O3). May be None if 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.

profile: skyscapes.physical_model.exojax.components.mmr_profile.AbstractMmrProfile#
name: str#
molmass: float#
opa: Any#
rayleigh_xs: jaxtyping.Array#
class skyscapes.physical_model.exojax.components.species.BulkGasResidual[source]#

Bases: equinox.Module

Implicit 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 the

atmosphere’s wavenumber grid, shape (n_nu,).

name: str#
molmass: float#
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. None lets OpaRayleigh look it up.

name: str#
psg_xs_url: str | None = None#
psg_xs_molmass: float | None = None#
polarizability_override: float | None = None#
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.

name: str#
molmass: float#
polarizability_override: float | None = None#
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.

Parameters:
  • nu_grid (jaxtyping.Array)

  • name (str)

  • polarizability_override (float | None)

Return type:

jaxtyping.Array

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 a MolecularSpecies (everything except log_mmr).

Parameters:
Return type:

tuple[float, Any, jaxtyping.Array]

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.molmass lookup. 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.

Parameters:

name (str)

Return type:

float

skyscapes.physical_model.exojax.components.species.build_bulk_prebuilt(*, name, nu_grid)[source]#

Construct (molmass, rayleigh_xs) for the implicit residual gas.

Parameters:
  • name (str)

  • nu_grid (jaxtyping.Array)

Return type:

tuple[float, jaxtyping.Array]