Skip to content

Optics

OpticalProperties, the stage between opacity and the solver in radtrax · 3: per-layer optical depth τ (L, G) on its wavenumber grid. The single-scattering albedo and phase-function moments join it in v3 of the roadmap, with defaults for a non-scattering atmosphere.

optics

Optical properties between opacity and the solver: OpticalProperties (radtrax#35); Rayleigh, aerosol phase functions and delta-M scaling arrive with v3 of the roadmap.

properties

OpticalProperties: what a solver needs from the atmosphere.

The stage between opacity and the solver in radtrax · 3: per-layer optical depth on a wavenumber grid. v0's solvers need nothing else; the single-scattering albedo and phase-function moments of v3 join as fields with defaults (a non-scattering atmosphere), so a solver written against this module keeps working.

Shapes: L layers, G wavenumbers.

OpticalProperties

OpticalProperties(nu_cm: Real[ArrayLike, ' G'], tau: Real[ArrayLike, 'L G'], *, z_m: Real[ArrayLike, ' L'] | None = None, dz_m: Real[ArrayLike, ' L'] | None = None)

Bases: Module

Per-layer optical depth on a wavenumber grid.

Build it from any OpacityProvider: OpticalProperties(opacity.nu_cm, opacity(state)).

Attributes:

Name Type Description
nu_cm Float[Array, ' G']

Wavenumber grid [cm⁻¹], (G,).

tau Float[Array, 'L G']

Optical depth of each layer at each wavenumber (dimensionless), (L, G), layers from the surface up.

z_m Float[Array, ' L'] | None

Height of each layer's middle above the surface [m], (L,), or None; with dz_m, what a spherical air mass needs.

dz_m Float[Array, ' L'] | None

Thickness of each layer [m], (L,), or None.

Examples:

>>> import jax.numpy as jnp
>>> optics = OpticalProperties(
...     jnp.array([4300.0, 4300.1]), jnp.zeros((3, 2))
... )
>>> optics.n_layers
3
Source code in src/radtrax/optics/properties.py
def __init__(
    self,
    nu_cm: Real[ArrayLike, " G"],
    tau: Real[ArrayLike, "L G"],
    *,
    z_m: Real[ArrayLike, " L"] | None = None,
    dz_m: Real[ArrayLike, " L"] | None = None,
) -> None:
    self.nu_cm = jnp.asarray(nu_cm, dtype=float)
    self.tau = jnp.asarray(tau, dtype=float)
    self.z_m = None if z_m is None else jnp.asarray(z_m, dtype=float)
    self.dz_m = None if dz_m is None else jnp.asarray(dz_m, dtype=float)

n_layers property

n_layers: int

Number of layers L.