Adapters¶
Classes that structurally satisfy the pipekit_cycle ObservationOperator protocol. plumax does not import pipekit_cycle at runtime. The ForwardModel over an EulerianDispersionRHS is integrix.march.DiffraxForwardModel(rhs, solver=diffrax.Euler(), dt0=dt, dt=dt), as the module docstring below shows.
adapters
¶
Data-assimilation adapters for the pipekit_cycle protocols.
pipekit_cycle decomposes data assimilation into three runtime-checkable
protocols — ForwardModel (predict), ObservationOperator (compare),
AnalysisStep (update). plumax ships adapters that satisfy them
structurally: the class below exposes exactly the right methods /
properties, so isinstance(obj, ObservationOperator) succeeds, without
plumax importing pipekit_cycle at runtime. This keeps the dependency arrow
pointing the right way — assimilation drivers depend on plumax, not the
reverse.
- :class:
RadtranObservationOperator— wraps the normalised Beer–Lambert forward model as anObservationOperatormapping a scalar plume enhancement (ΔVMR) to a normalised radiance spectrum, with itsjax.jacfwdas the tangent-linear.
A ForwardModel over an :class:~plumax.les_fvm.EulerianDispersionRHS is
integrix.march.DiffraxForwardModel, which takes any diffrax solver; with
diffrax.Euler and dt0 = dt one step is one explicit-Euler step,
c ← c + Δt · RHS(0, c)::
import diffrax as dfx
from integrix.march import DiffraxForwardModel
forward = DiffraxForwardModel(rhs, solver=dfx.Euler(), dt0=1.0, dt=1.0)
# (Nz, Ny, Nx), integrated over [0, Δt]
next_c = forward.step(c, 1.0)
# (Nz, Ny, Nx), over [t₀, t₀ + Δt] at the true time
next_c = forward.as_dynamics()(c, t0, t0 + 1.0)
RadtranObservationOperator
¶
RadtranObservationOperator(ds: Dataset, nu_obs: Float[ArrayLike, ' G'], *, T_K: float, p_atm: float, path_length_cm: float, amf: float, var: str = 'absorption_cross_section')
Bases: Module
Expose the normalised Beer–Lambert forward as an ObservationOperator.
H(ΔVMR) answers "what normalised radiance spectrum would a plume
enhancement of ΔVMR produce?". The innovation in a retrieval is then
observed_spectrum - H(ΔVMR_forecast). It is the one-receptor case of
:class:plumax.coupled.RadianceObservationOperator without an SRF, taken
in ΔVMR rather than column mass, and :meth:linearize is its
jax.jacfwd.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds
|
Dataset
|
Absorption-cross-section LUT dataset. |
required |
nu_obs
|
Float[ArrayLike, ' G']
|
Observation wavenumbers [cm⁻¹]. |
required |
T_K
|
float
|
Layer temperature [K]. |
required |
p_atm
|
float
|
Layer pressure [atm]. |
required |
path_length_cm
|
float
|
Optical path length [cm]. |
required |
amf
|
float
|
Air-mass factor. |
required |
var
|
str
|
LUT cross-section variable name. |
'absorption_cross_section'
|
Attributes:
| Name | Type | Description |
|---|---|---|
operator |
RadianceObservationOperator
|
The slab operator on |
Source code in src/plumax/_src/adapters.py
linearize
¶
Return the tangent-linear d(L_norm)/d(ΔVMR) at state.