From a column map to an emission rate: models, identifiability and the wind
GeoStack · background · the modeling cycle · example 2 of 3 · L2 → L4
Abstract¶
The second worked example of the modeling cycle. It starts from the column map that example 1 retrieved and asks how much the facility emits. The usual first answer, the integrated mass enhancement, follows from a mass balance in three lines and returns a number with no prediction of the image, so the compare step has nothing to hold. A column plume derived from advection–diffusion does predict the image. Fitting it makes the misfit visible, one structural change removes it, and the derivation shows what no image can supply: the image determines , never .
The operators¶
1 · Mass enhancement
Add up the gas in the plume and divide by the time it takes to leave. The integrated mass enhancement over the plume mask, times an effective wind and divided by the plume’s length scale, gives the rate.
| Role | Symbol | Name | Shape | Unit | Note |
|---|---|---|---|---|---|
| Input | enhancement map | (row, col) | ppm·m | from example 1 | |
| External input | 10 m wind speed | () | m s⁻¹ | from a reanalysis | |
| Parameter | effective-wind slope | () | — | fitted to simulations | |
| effective-wind offset | () | m s⁻¹ | fitted to simulations | ||
| Constant | column per enhancement | () | kg m⁻² (ppm·m)⁻¹ | ||
| pixel area | () | m² | |||
| Estimated | plume mask | (row, col) | bool | ||
| plume length | () | m | |||
| integrated mass enhancement | () | kg | eq. 1 | ||
| effective wind | () | m s⁻¹ | |||
| Output | emission rate | () | kg s⁻¹ | eq. 2 |
2 · Column plume
To have something to compare with the image, plumax predicts it: what a steady plume looks like from above. A Gaussian cross-section that widens with distance from the source carries the line density over a background.
| Role | Symbol | Name | Shape | Unit | Note |
|---|---|---|---|---|---|
| Input | pixel centres | (pixel, 2) | m | ||
| Parameter | line density | () | kg m⁻¹ | the controls, 7 numbers in all | |
| plume direction | () | rad | |||
| source position | (2,) | m | |||
| reference width | () | m | |||
| widening exponent | () | — | |||
| background | () | kg m⁻² | |||
| Constant | pixel blur width | () | m | ||
| reference distance | () | m | |||
| Estimated | along-plume distance | (pixel,) | m | eq. 1 | |
| cross-plume distance | (pixel,) | m | eq. 1 | ||
| cross-plume width | (pixel,) | m | eq. 1 | ||
| unit cross-section shape | (pixel,) | m⁻¹ | eq. 2 | ||
| Output | column enhancement | (row, col) | kg m⁻² | eq. 3 |
3 · Image fit
Fit the plume’s controls to the map. The minimiser is the MAP estimate, and the Laplace approximation at it gives the posterior covariance, from which the line density and its uncertainty follow.
| Role | Symbol | Name | Shape | Unit | Note |
|---|---|---|---|---|---|
| Input | enhancement map | (pixel,) | kg m⁻² | from example 1 | |
| its error covariance | diagonal | (kg m⁻²)² | from example 1 | ||
| Parameter | prior mean | (7,) | wind product, catalogue position | ||
| prior covariance | (7, 7) | ||||
| Estimated | observation operator | (pixel,) | kg m⁻² | ||
| Jacobian of | (pixel, 7) | kg m⁻² per control | |||
| Output | line density | () | kg m⁻¹ | ||
| its uncertainty | () | kg m⁻¹ |
4 · Wind
The one input the image cannot supply is the wind, applied after the fit and independent of it. The rate is the line density times the transport wind, and their log-variances add.
| Role | Symbol | Name | Shape | Unit | Note |
|---|---|---|---|---|---|
| Input | line density | () | kg m⁻¹ | from the fit | |
| its uncertainty | () | kg m⁻¹ | from the fit | ||
| External input | transport wind speed | () | m s⁻¹ | ||
| its uncertainty | () | m s⁻¹ | |||
| Output | emission rate | () | kg s⁻¹ | ||
| its uncertainty | () | kg s⁻¹ |
The running example¶
Notation¶
indexes the pixels at positions ; and are a pixel’s distance along and across the plume from the source , for a plume heading ; is the pixel area; is the number of pixels and the number of controls.
| Symbol | Role | Shape | Unit |
|---|---|---|---|
| observation · column enhancement map, | (row, col) | kg m⁻² | |
| const · error of the map, diagonal | kg² m⁻⁴ | ||
| out · emission rate | kg s⁻¹ | ||
| state · line density, | kg m⁻¹ | ||
| state · plume direction and source position | , | rad, m | |
| state · width at , growth exponent | , | m, — | |
| state · residual background column | kg m⁻² | ||
| observation operator, controls to map | kg m⁻² | ||
| exogenous · transport wind and its standard deviation | , | m s⁻¹ |
Model 1 · Add up the gas¶
The integrated mass enhancement (IME) is the workhorse of plume quantification. It is a mass balance on the plume as one box.
Measuring from the map as the IME and inserting B1:
A second view of the same balance is the cross-sectional flux: in steady state the mass crossing any line across the plume per second is the emission rate, at any distance downwind. It needs a centreline, and it gives one estimate per transect, whose scatter is a useful check.
import plumax.geo
# Shapes: R × C pixels
# Units: [Ω] = kg m⁻²; [Q] = kg s⁻¹
# today (plumax)
# 𝓜 = [α̂_n > α_thr], small components dropped
mask = plumax.geo.PlumeMask(threshold=750.0, min_area_px=20)(enhancement) # (R, C) bool
# today* (plumax)
# IME = Σ_𝓜 κ α̂ a, Q = U_eff · IME / L
estimate = plumax.geo.IMEEstimate(
wind_speed=effective_wind, length_method="max_axis", return_uncertainty=True
)(enhancement, mask) # → dictModel 2 · A plume that predicts the image¶
To have something to compare, write down what a steady plume looks like from above. Start from the transport equation and simplify it in numbered steps.
Integrating over height under B2 and B3, the column obeys a one-dimensional diffusion equation in which plays the role of time:
whose solution is a Gaussian across the plume whose width grows downwind:
Card 2 generalises to a power law with a pixel-sized floor , and rotates the coordinates to a heading from a source , so that and are distances along and across the plume. Two consequences follow from eq. (14) before any data are seen:
The cross-sectional flux is constant downwind. at every : the line density .
Only is identifiable. A plume twice as strong in a wind twice as fast looks exactly the same from above. plumax’s column plume therefore has a line-density control and no wind control.
Model 3 · Fit the plume to the image¶
Under B4 the objective is card 3’s weighted least squares. The controls enter through logarithms where they must stay positive, so the posterior is closer to Gaussian in those coordinates. At the minimum, the Laplace approximation takes the curvature as the posterior covariance; the share of each control set by the data is .
import jax.numpy as jnp
import plumax.coupled as cpl
import plumax.gauss_plume as gp
# Shapes: N pixels; D = 7 controls
# Units: [Ω] = kg m⁻²; [q] = kg m⁻¹
# today* (plumax)
# φ_plume(s; θ) = exp(−c² / 2w²) / (√(2π) w), w² = w₀² + w_ref² (d / d_ref)^(2b)
plume = gp.ColumnPlume(reference_distance=1_000.0, initial_width=17.3, pixel_size=60.0)
# today (plumax)
source = gp.ColumnPlumeSource(plume=plume, geometry=reported_geometry)
# today (plumax)
# Σ_ε = diag(σ_n²)
instrument = cpl.Instrument("EMIT", receptors, retrieval_variance=column_std**2) # (N, 2)
# today (plumax)
# θ ~ 𝒩(μ_θ, diag(σ_θ²)): direction from the wind product, s₀ from the catalogue
prior = cpl.CoupledPrior.from_std(prior_mean, prior_std)
# today (plumax)
# h(θ) = q φ_plume(s; θ) + Ω_bg
problem = cpl.CoupledProblem(
forward=cpl.build_coupled_forward(source, [instrument]),
prior=prior,
observations={"EMIT": column_map}, # (N,)
)
# today (plumax)
# θ⋆ = argmin ℒ_MAP(θ), Σ_θ∣y = (Σ_θ⁻¹ + J_hᵀ Σ_ε⁻¹ J_h)⁻¹
result = cpl.solve_coupled(problem)Compare: read the residual¶
Read the residual: a plume pointed the wrong way
Truth and the reported windwind product
Fit along the reported windresidual: above, below
Fit with the direction freeresidual: noise
What the plume model predicts and what goes wrong when its direction is fixed. The truth (left) heads off the reported wind; a plume forced along the reported wind (middle) compensates by widening, and its residual has one positive and one negative flank; with the direction fitted (right) the residual is noise.
The first fit takes the plume’s direction from the wind product and fits the rest. Two diagnostics come out of the residual :
Its size: the reduced should be near 1.
Its shape: a residual that is negative along one flank and positive along the other is a plume pointing the wrong way. No value of or can rotate the prediction, so the fit widens the plume and raises to cover gas it cannot reach: a systematic misfit.
Repair. Add the direction and the source position to the controls, with the wind product and the catalogue as their priors. The prior keeps them sensible when the plume is faint; when it is bright, the data share of both is close to 100 %.
The outer loop on quantification
Model 1 · Mass enhancementa mask, a wind speed, a length
predicts no image
compare: nothing to compare the image withthe model returns a number, not a prediction
Model 2 · Plume along the reported wind, width and background fitted
reduced well above 1 and the width too large
compare: the residual is one-sided along the plumethe plume does not point where the wind says
Model 3 · Direction and source fitted and become controls
reduced to about
The outer loop on quantification. The first change is to a model that predicts the observation at all; the second adds the control the residual asked for.
The referee: is the quick posterior right?¶
The Laplace posterior is a Gaussian fitted to the curvature at the optimum. It is cheap, and it is wrong when the posterior is skewed or curved: near a faint plume, or when the direction is poorly constrained. The referee samples the same posterior without that assumption.
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, NUTS
# Shapes: D controls; S draws
# user
# the same posterior, sampled in coordinates scaled by the Laplace covariance:
# θ = θ⋆ + C z with C Cᵀ = Σ_θ∣y, so the sampler sees unit scale in every direction
def model():
whitened = numpyro.sample("chi", dist.ImproperUniform(dist.constraints.real_vector, (), (D,)))
theta = unflatten(result.mean + cholesky @ whitened) # (D,)
# log p(θ)
numpyro.factor("prior", prior_log_density(theta))
# y ~ 𝒩(h(θ), Σ_ε)
numpyro.sample("y", dist.Normal(problem.predict_stacked(theta), noise_std).to_event(1),
obs=column_map)
# today (numpyro)
draws = MCMC(NUTS(model), num_warmup=400, num_samples=800).run(key) # (S, D)The density is exact; only the coordinates come from the approximation. Compare the two posteriors control by control: the shift of the means in units of the sampler’s standard deviation, and the ratio of the widths. When both are close to 0 and 1, the Laplace posterior is used for every scene, and NUTS is rerun when the model changes.
What the image cannot see¶
Card 4 applies the wind after the fit. Because and the two are independent, the variances of their logarithms add:
The image fixes the plume to about 5 %; the rate inherits the wind’s 33 %. A better plume model would not change that. A better wind would, and so would a catalogue that stores and applies winds later, which plumax#111 proposes.
What example 1’s errors do here¶
The plume fit inherits whatever example 1 got wrong. An uncorrected matched-filter map under-reads dark ground near the source and over-reads bright ground downwind; the fit faithfully reproduces that as a wrong width exponent and a biased . A level cannot repair the one below it; it can only report, through its residual, that something does not fit.
Worked numbers¶
| Model | Predicts the image? | What it needs | Uncertainty |
|---|---|---|---|
| 1 · Mass enhancement | no | mask, , calibration | a fixed fraction, about ±50 % |
| 1′ · Cross-sectional flux | no | centreline, transport wind | scatter across transects |
| 2 · Column plume along the reported wind | yes | wind direction as given | Laplace; residual patterned |
| 3 · Column plume, direction fitted | yes | priors on , | Laplace, checked by NUTS |
| with the wind | — | eq. (15) |
The six steps, for this problem¶
| Step | In this example | Status |
|---|---|---|
| 1 · Simple model | plumax.gauss_plume.ColumnPlume: a Gaussian ridge with a power-law width, per unit line density | today |
| 2 · Model-based inference | plumax.coupled.solve_coupled (L-BFGS, Laplace); NUTS on the same posterior as the referee | today |
| 3 · Emulator | Skipped: one evaluation of the model takes milliseconds | — |
| 4 · Emulator-based inference | Skipped with it | — |
| 5 · Amortized inference | A network from the image and its context straight to the posterior of , for screening thousands of scenes | plumax#87 |
| 6 · Improve | A meandering centreline (plumax#270), cross-plume transects (#269), per-pixel noise from the retrieval (#272), the gate against metered releases (#273) | plumax#265 |
What example 3 receives¶
| Handed on | Value | Used in example 3 as |
|---|---|---|
| One catalogue event | = 2.0 kg s⁻¹ = 7 200 kg h⁻¹, = 0.33 | what a detection looks like |
| Draws of | from the posterior of and the wind | the measurement error of each detection’s rate |
| How it is built | plumax.population.catalog.event_from_posterior | the per-event payload of the population tier |
Sources and status
The mass enhancement is Varon et al. (2018), as implemented by plumax.geo.IMEEstimate. The column plume, the line density and the treatment of the wind follow plumax’s docs/design/01_tier1_image_fit.md. Lines marked today call names that exist in plumax at 290f31f, newer than the submodule pin; user marks what the sketch defines. The running example’s IME numbers are the explainer kit’s; the transport wind and the fit’s relative error are illustrative, and the error budget is computed from them.