Transport backends¶
The Tier II and Tier III transports behind CoupledForward. A TransportBackend gives each instrument's column per unit emission through the shared ColumnObservation: LagrangianSource from met-ensemble backward footprints, EulerianSource from the les_fvm finite-volume run at the overpass time. PlumeSource is the Tier I backend. A backend whose response depends on parameters the inversion fits subclasses AbstractControlledSource: it declares those parameters as named control blocks, with the emission blocks that scale its response, and evaluates the response at any value of them. PlumeSource declares the source position and the wind, and the column plume gauss_plume.ColumnPlumeSource its geometry, scaled by the line density \(q = Q / U\). Tier IV.
backends
¶
Transport backends: the protocol, the controlled base and Tiers II and III (implementation in plumax.coupled._src.backends).
AbstractControlledSource
¶
Bases: Module
A transport backend whose response depends on fitted parameters.
r_inst(θ) = A_inst ⊙ r(s_inst; θ), with θ the blocks this backend declares.
The control arrives as an argument and is never stored: the fields hold the values the response takes when a block is absent from the control. The inversion fits the declared blocks, one of the emission blocks, the background and the per-instrument biases.
A subclass gives background as a field: eqx.AbstractVar cannot
be read from the postponed annotations every plumax module uses, so the
base declares it as an abstract property.
background
abstractmethod
property
¶
Additive background column Ω_bg, in the observation's units.
control_blocks
abstractmethod
property
¶
Block name → shape, for every parameter this backend can fit.
emission_blocks
abstractmethod
property
¶
Names of the blocks that scale the response; a prior holds one.
A name that starts with log_ is the logarithm of the scale, so the
inversion multiplies the response by its exponential.
column_response
abstractmethod
¶
The unit response at this backend's own parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instrument
|
Instrument
|
The observing instrument (receptors and kernel). |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ' obs']
|
The response r_inst, one value per receptor. |
Source code in src/plumax/_src/controlled.py
response_at
abstractmethod
¶
response_at(instrument: Instrument, control: Mapping[str, Float[Array, '*shape']]) -> Float[Array, ' obs']
The unit response with the declared blocks taken from control.
Blocks missing from control keep this backend's own values, and
names it does not declare are ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instrument
|
Instrument
|
The observing instrument (receptors and kernel). |
required |
control
|
Mapping[str, Float[Array, '*shape']]
|
The control, by block. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ' obs']
|
The response r_inst(θ), one value per receptor. |
Source code in src/plumax/_src/controlled.py
EulerianSource
dataclass
¶
Tier III transport: the les_fvm finite-volume run through the shared column.
r_i = A_i Σ_k Δz c_k(x_i, t_inst; Q = 1),
the field of a unit constant emission at the overpass time t_inst, read in
the T-cell that holds each receptor. The forward is linear in the emission
with a zero initial field, so Q · r is the run at constant emission Q.
Attributes:
| Name | Type | Description |
|---|---|---|
forward |
EulerianForward4DVar
|
The differentiable transport ( |
background |
float
|
Additive background column c_bg. |
unit_history
cached
property
¶
Interior field history of a unit constant emission, one solve.
time_index
¶
Index of the save time that equals the instrument's overpass time.
Raises:
| Type | Description |
|---|---|
GridMismatchError
|
If no save time matches it. |
Source code in src/plumax/coupled/_src/backends.py
column_response
¶
Column per unit emission at the instrument's receptors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instrument
|
Instrument
|
The observing instrument. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ' obs']
|
The response r_inst. |
Raises:
| Type | Description |
|---|---|
GridMismatchError
|
If the overpass time is not a save time. |
DomainError
|
If a receptor lies outside the grid. |
Source code in src/plumax/coupled/_src/backends.py
LagrangianSource
dataclass
¶
LagrangianSource(emission_pattern: Float[Array, ' cell'] | Float[Array, 'cell param'], winds: tuple[Velocity, ...], turbulence: TurbulenceModel, domain_x: tuple[float, float, int], domain_y: tuple[float, float, int], column_z: Float[Array, ' level'], n_particles: int = 1000, t_back: float = 600.0, dt: float = 1.0, pbl_height: float = 1000.0, pbl_fraction: float = 0.5, air_density: float = 1.2, seed: int = 0, background: float = 0.0)
Tier II transport: met-ensemble backward footprints through the shared column.
c_k(x_i) = ρ_air F̄(x_i, z_k) q, F̄ = mean_e F_e, r_i = A_i Σ_k h_k c_k(x_i),
with F_e the footprint of member e at receptor (x_i, z_k), q the surface
flux of a unit source and h_k the trapezoid weights over column_z.
Attributes:
| Name | Type | Description |
|---|---|---|
emission_pattern |
Float[Array, ' cell'] | Float[Array, 'cell param']
|
Surface flux per unit emission q [m⁻²] on the
footprint grid, cells flattened row-major over |
winds |
tuple[Velocity, ...]
|
One mean wind per met-ensemble member, a tracerax velocity (gridded or uniform). One member is a deterministic run. |
turbulence |
TurbulenceModel
|
Turbulence model shared by the members. |
domain_x |
tuple[float, float, int]
|
|
domain_y |
tuple[float, float, int]
|
|
column_z |
Float[Array, ' level']
|
Receptor levels z_k [m] of the column, strictly increasing and
inside the layer, |
n_particles |
int
|
Particles per receptor level and member. |
t_back |
float
|
Backward integration time [s]. |
dt |
float
|
Particle time step [s]. |
pbl_height |
float
|
Boundary-layer height [m]. |
pbl_fraction |
float
|
Fraction of the boundary layer that sees the surface flux. |
air_density |
float
|
Air density ρ_air [kg m⁻³]. |
seed |
int
|
Base PRNG seed of the particle draws. |
background |
float
|
Additive background column c_bg. |
point
classmethod
¶
point(location: tuple[float, float], *, winds: Sequence[Velocity], turbulence: TurbulenceModel, domain_x: tuple[float, float, int], domain_y: tuple[float, float, int], column_z: Float[Array, ' level'], **settings: float | int) -> LagrangianSource
A point source: unit emission spread over the cell that holds it.
q_s = 1 / A_cell in the containing cell s, zero elsewhere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
tuple[float, float]
|
Source |
required |
winds
|
Sequence[Velocity]
|
One mean wind per met member. |
required |
turbulence
|
TurbulenceModel
|
Turbulence model. |
required |
domain_x
|
tuple[float, float, int]
|
|
required |
domain_y
|
tuple[float, float, int]
|
|
required |
column_z
|
Float[Array, ' level']
|
Receptor levels z_k [m], inside the layer. |
required |
**settings
|
float | int
|
Any other field of :class: |
{}
|
Returns:
| Type | Description |
|---|---|
LagrangianSource
|
The source, with a one-cell emission pattern. |
Raises:
| Type | Description |
|---|---|
DomainError
|
If the location lies outside the footprint grid. |
Source code in src/plumax/coupled/_src/backends.py
footprints
¶
Member footprints F_e at every receptor level, level fastest.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instrument
|
Instrument
|
The observing instrument; its overpass time is the receptor time of the backward runs. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, 'member point cell']
|
One row per (receptor, level) pair, units s m² kg⁻¹. |
Source code in src/plumax/coupled/_src/backends.py
column_response
¶
Column per unit emission at the instrument's receptors.
Algorithm
- Backward footprints from every receptor level, per member.
- Average over the members: F̄ = mean_e F_e.
- Concentration of a unit source: c = ρ_air F̄ q.
- Column and averaging kernel: r_i = A_i Σ_k h_k c_k(x_i).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instrument
|
Instrument
|
The observing instrument. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ' obs'] | Float[Array, 'obs param']
|
The response r_inst, one column per emission pattern when the |
Float[Array, ' obs'] | Float[Array, 'obs param']
|
pattern has a parameter axis. |
Source code in src/plumax/coupled/_src/backends.py
TransportBackend
¶
Bases: Protocol
A transport tier as the coupled forward sees it.
r_inst = A_inst col_z(c(·; Q = 1)), the column per unit emission at each of the instrument's receptors.
Attributes:
| Name | Type | Description |
|---|---|---|
background |
float
|
Additive background column c_bg, in the units of the observation. |
column_response
¶
Column per unit emission at the instrument's receptors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instrument
|
Instrument
|
The observing instrument (receptors and kernel). |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ' obs'] | Float[Array, 'obs param']
|
The response r_inst: one value per receptor for a scalar emission |
Float[Array, ' obs'] | Float[Array, 'obs param']
|
rate, or one column per emission parameter. |