Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Matched filter: derivation, covariance flavours and the link to 3D-Var

Matched filter for hyperspectral methane retrieval

Ported from plumax 0.1.2 (28f257e); module and link paths updated for radtrax.

The matched filter (MF) is the maximum-SNR linear detector for a known target signature in additive Gaussian noise. In hyperspectral methane retrieval it is the workhorse baseline: it is fast, it has a closed form, and it is surprisingly competitive with full variational retrievals when the signal is weak and the scene is statistically homogeneous. This note derives the MF from scratch, lays out the four covariance flavours implemented in radtrax.retrieval.matched_filter, and shows the exact sense in which the MF is the limit of the dual (PSAS) 3D-Var solution of the companion 3D-Var derivation for a one-dimensional state with a flat prior.

The derivation borrows from Funk et al. [1], Theiler & Foy [2] and Thompson et al. [3]; the operator-based implementation follows the structured linear algebra of Golub & Van Loan [4] and the Woodbury-friendly design of gaussx.

Symbols

SymbolMeaningShapeUnit
BBnumber of instrument bandsscalardimensionless
NNnumber of background pixels the clutter is estimated fromscalardimensionless
y\vect{y}one pixel’s band radiance (the observation)RB\mathbb{R}^{B}radiance
μy\gvect{\mu}_ymean of plume-free spectra (the background mean)RB\mathbb{R}^{B}radiance
Σy\gmat{\Sigma}_ycovariance of plume-free spectra (the background clutter: noise, surface variability, calibration residual)RB×B\mathbb{R}^{B \times B}radiance²
ε\gvect{\varepsilon}the pixel’s departure from the background meanRB\mathbb{R}^{B}radiance
α\alphaplume strength (the unknown)R≥0\mathbb{R}_{\ge 0}unit of the target, e.g. mol/m²
Jh\mat{J}_htarget signature: the change in y\vect{y} per unit α\alpha, a one-column Jacobian of the forward modelRB\mathbb{R}^{B}radiance per unit α\alpha
t\vect{t}unit absorption spectrum, tb=∂ln⁡yb/∂αt_b = \partial \ln y_b / \partial \alpha at α=0\alpha = 0; negative where the gas absorbsRB\mathbb{R}^{B}m²/mol
α^\hat\alphathe matched-filter score, an estimate of α\alphascalarunit of α\alpha
α0\alpha_0characteristic plume strength, the score’s standard deviation under the nullscalarunit of α\alpha
w\vect{w}, zzthe precomputed filter Σy−1Jh\gmat{\Sigma}_y^{-1} \mat{J}_h and its energy Jh⊤Σy−1Jh\mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_hRB\mathbb{R}^{B}, scalardimensionless
Φ\Phistandard normal CDFR→[0,1]\mathbb{R} \to [0, 1]dimensionless

The symbols of §4 are those of the 3D-Var page and are defined where they first appear.

1. The signal model

We observe one radiance spectrum y∈RB\vect{y} \in \mathbb{R}^{B} per pixel of the scene. The additive model says that a plume of strength α\alpha adds a fixed multiple of the target signature to the background, so we will have:

y=μy+αJh+ε\vect{y} = \gvect{\mu}_y + \alpha \mat{J}_h + \gvect{\varepsilon}
ε∼N(0,Σy)\gvect{\varepsilon} \sim \mathcal{N}(\vect{0}, \gmat{\Sigma}_y)

where μy\gvect{\mu}_y is the background mean spectrum (what we would observe at a pixel free of any plume enhancement), Jh\mat{J}_h is the target signature (the spectral shape that a unit enhancement leaves in y\vect{y}), α≥0\alpha \ge 0 is the plume strength (pixels with α=0\alpha = 0 are background, α>0\alpha > 0 is a plume) and Σy\gmat{\Sigma}_y is the background clutter covariance, assumed Gaussian. Under this model the log-likelihood of a pixel is, up to additive constants,

ℓ(α∣y)=−12(y−μy−αJh)⊤Σy−1(y−μy−αJh)\ell(\alpha \mid \vect{y}) = -\frac{1}{2} (\vect{y} - \gvect{\mu}_y - \alpha \mat{J}_h)^\top \gmat{\Sigma}_y^{-1} (\vect{y} - \gvect{\mu}_y - \alpha \mat{J}_h)

Setting ∂ℓ/∂α=0\partial \ell / \partial \alpha = 0 gives the maximum-likelihood estimator of the strength:

α^(y)=(y−μy)⊤Σy−1JhJh⊤Σy−1Jh\hat\alpha(\vect{y}) = \frac{(\vect{y} - \gvect{\mu}_y)^\top \gmat{\Sigma}_y^{-1} \mat{J}_h}{\mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h}

1.1 The SNR and detection threshold

Under the null (α=0\alpha = 0) the score α^(y)\hat\alpha(\vect{y}) is N(0,1/Jh⊤Σy−1Jh)\mathcal{N}(0, 1 / \mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h), and under an alternative with strength α\alpha it is N(α,1/Jh⊤Σy−1Jh)\mathcal{N}(\alpha, 1 / \mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h). So the detection SNR is

SNR(α)=αJh⊤Σy−1Jh\mathrm{SNR}(\alpha) = \alpha \sqrt{\mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h}

and the Gaussian threshold on α^\hat\alpha for a false-alarm rate (FAR) is

αFAR=Φ−1(1−FAR)Jh⊤Σy−1Jh\alpha_\text{FAR} = \frac{\Phi^{-1}(1 - \mathrm{FAR})}{\sqrt{\mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h}}

Both are implemented in matched_filter.core as matched_filter_snr and detection_threshold.

The score’s standard deviation under the null, α0=1/Jh⊤Σy−1Jh\alpha_0 = 1 / \sqrt{\mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h}, is what Theiler [5] calls the characteristic plume strength: a plume of strength nα0n \alpha_0 is an nn-sigma detection, SNR(α)=α/α0\mathrm{SNR}(\alpha) = \alpha / \alpha_0. It also shows how much whitening buys. At α0\alpha_0 the radiance itself changes by a fraction α0∥Jh∥2/∥μy∥2\alpha_0 \Vert \mat{J}_h \Vert_2 / \Vert \gvect{\mu}_y \Vert_2, which is below 10-3 on Theiler’s AVIRIS-NG and OMI scenes and about 2×10−42 \times 10^{-4} on the synthetic EMIT-like scene of Absorptive plume detection. So plumes that are invisible in the raw spectra are clear in the matched-filter map.

The same standard deviation becomes a map once the background varies, and a plume fit needs it to weight each pixel’s score by its own noise. score_std returns α0\alpha_0 for one global background, cluster_score_std gives each pixel the α0\alpha_0 of its cluster’s covariance, and adaptive_score_std gives each pixel (∑bJh,b2/(σb2+λ))−1/2(\sum_b J_{h,b}^2 / (\sigma_b^2 + \lambda))^{-1/2} from its window’s band variances and the ridge λ\lambda; the geo operators return the map as a second band, std, with return_std=True, and matched_filter_snr and detection_threshold are α/α0\alpha / \alpha_0 and Φ−1(1−FAR) α0\Phi^{-1}(1 - \mathrm{FAR}) \, \alpha_0. All of these assume the true Σy\gmat{\Sigma}_y. With the sample covariance of NN pixels in BB bands, the expected output SNR is lower by the factor (N+2−B)/(N+1)(N + 2 - B) / (N + 1) (Reed, Mallett and Brennan, 1974), so the plug-in α0\alpha_0 is too small by roughly the inverse square root of that factor: 0.3 % for 60 bands on 104 pixels, and 19 % for 60 bands on a 200-pixel cluster. A shrunk or low-rank covariance has no closed form for the factor, and the functions return the plug-in value.

1.2 What the score recovers

The filter is unbiased only for a pixel whose spectrum responds like the target. The score is linear in the spectrum, so adding an enhancement α\alpha to pixel nn shifts its score by exactly αAn(α)\alpha A_n(\alpha) for a fixed background, where the sensitivity is

An(α)=w⊤δn(α)α w⊤JhA_n(\alpha) = \frac{\vect{w}^\top \gvect{\delta}_n(\alpha)}{\alpha \, \vect{w}^\top \mat{J}_h}

with w=Σy−1Jh\vect{w} = \gmat{\Sigma}_y^{-1} \mat{J}_h and δn(α)\gvect{\delta}_n(\alpha) the radiance change of the pixel. With k=∂ln⁡y/∂ΔX\vect{k} = \partial \ln \vect{y} / \partial \Delta X the unit absorption spectrum, Beer–Lambert gives δn(α)=yn⊙(exp⁡(αk)−1)\gvect{\delta}_n(\alpha) = \vect{y}_n \odot (\exp(\alpha \vect{k}) - 1), and as α→0\alpha \to 0 the sensitivity tends to An=w⊤(yn⊙k)/w⊤JhA_n = \vect{w}^\top (\vect{y}_n \odot \vect{k}) / \vect{w}^\top \mat{J}_h.

Two effects follow. The first is the albedo effect: with the radiance target Jh=μy⊙k\mat{J}_h = \gvect{\mu}_y \odot \vect{k} and a pixel that is the mean scaled by a brightness ρn\rho_n, yn=ρnμy\vect{y}_n = \rho_n \gvect{\mu}_y, the sensitivity is An=ρnA_n = \rho_n, so a pixel twice as bright as the scene reports twice the enhancement. The second is saturation: expanding the exponential,

An(α)=w⊤(yn⊙k)w⊤Jh+α2w⊤(yn⊙k⊙k)w⊤Jh+O(α2)A_n(\alpha) = \frac{\vect{w}^\top (\vect{y}_n \odot \vect{k})}{\vect{w}^\top \mat{J}_h} + \frac{\alpha}{2} \frac{\vect{w}^\top (\vect{y}_n \odot \vect{k} \odot \vect{k})}{\vect{w}^\top \mat{J}_h} + \mathcal{O}(\alpha^2)

and the second term is negative for an absorbing gas when the filter weights follow the absorption, so the sensitivity falls as the plume strengthens. A plume fit compares AnA_n times its modelled enhancement with the score, α^n=Anαn+εn\hat\alpha_n = A_n \alpha_n + \varepsilon_n. score_sensitivity computes (7) in the Beer–Lambert form (with enhancement= for the saturated value), response_sensitivity takes any δn/α\gvect{\delta}_n / \alpha from a forward model, cluster_score_sensitivity uses each pixel’s cluster covariance, and the geo operator MatchedFilterSensitivity returns the map on the input’s carrier. With the log-radiance form of the filter (a cube of ln⁡y\ln \vect{y} and target k\vect{k}) the response is αk\alpha \vect{k} for every pixel and An=1A_n = 1, so the map matters only for the radiance form. The definition holds μy\gvect{\mu}_y and Σy\gmat{\Sigma}_y fixed; a plume that covers much of the scene also enters the background statistics, which AnA_n does not see.

2. Practical decomposition: precompute once, apply per pixel

Equation (4) is deceptively cheap. Per pixel it is a dot product of length BB, except that Σy−1\gmat{\Sigma}_y^{-1} appears. Done naively we would invert a B×BB \times B matrix once, but that throws away the chance to exploit any structure in Σy\gmat{\Sigma}_y. The right decomposition precomputes the filter and its energy once per scene, so we will have:

w=Σy−1Jh\vect{w} = \gmat{\Sigma}_y^{-1} \mat{J}_h
z=Jh⊤w=Jh⊤Σy−1Jhz = \mat{J}_h^\top \vect{w} = \mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h

and then, per pixel,

α^(y)=(y−μy)⊤wz\hat\alpha(\vect{y}) = \frac{(\vect{y} - \gvect{\mu}_y)^\top \vect{w}}{z}

That is one linear solve and one dot product per scene, followed by one dot product per pixel (a single BLAS call when vectorised over the image). This is what apply_image in core.py does; the sketch below leaves out its check that z>0z > 0, and it gives the same scores as apply_image to the last bit on a random cube:

import gaussx_linalg
import gaussx_sketch
import jax.numpy as jnp
import lineax as lx
from jaxtyping import Array, Float

# Shapes: H, W image rows and columns; B bands


def apply_image(
    cube: Float[Array, "H W B"],
    mean: Float[Array, " B"],
    cov_op: lx.AbstractLinearOperator,
    target: Float[Array, " B"],
) -> Float[Array, "H W"]:
    # today (gaussx)
    # w = Σ_y⁻¹ J_h, one structured solve per scene
    w = gaussx_linalg.solve(cov_op, target)                             # (B,) → (B,)
    # z = J_hᵀ Σ_y⁻¹ J_h
    z = jnp.dot(target, w)                                   # (B,) → ()
    # r = y − μ_y, for every pixel
    residual = cube - mean                                   # (H, W, B) → (H, W, B)
    # α̂ = rᵀ w / z
    scores = jnp.einsum("hwb,b->hw", residual, w)            # (H, W, B) → (H, W)
    return scores / z                                        # (H, W) → (H, W)

The key move is gaussx_linalg.solve(cov_op, target). Since cov_op is an abstract lineax.AbstractLinearOperator, the solve dispatches on structure: a dense operator triggers a Cholesky, a diagonal operator a per-element divide, and a low-rank update σtik2I+Vdiag(σ2)V⊤\sigma_\text{tik}^2 \mat{I} + \mat{V} \op{diag}(\gvect{\sigma}^2) \mat{V}^\top triggers Woodbury, with no change to the kernel above.

3. Four flavours of Σy\gmat{\Sigma}_y

The four reference files in jej_vc_snippets/methane_retrieval/ originally wrote out four separate implementations of (4), one per covariance model. In the operator-based view they collapse into four estimation routines that all return the same type, a lineax.AbstractLinearOperator. Below, yn\vect{y}_n for n=1,…,Nn = 1, \ldots, N are the background pixels, β∈[0,1]\beta \in [0, 1] is the shrinkage weight, V∈RB×r\mat{V} \in \mathbb{R}^{B \times r} holds the top rr spectral directions with variances σ2∈R≥0r\gvect{\sigma}^2 \in \mathbb{R}^{r}_{\ge 0}, σtik2>0\sigma_\text{tik}^2 > 0 is the Tikhonov floor (the tikhonov argument) and KK is the number of clusters.

Covariance estimators and the operators they produce.

Estimator

Formula

Operator type

Per-pixel cost

estimate_cov_empirical

Σ^y=1N∑n=1N(yn−μy)(yn−μy)⊤\hat{\gmat{\Sigma}}_y = \frac{1}{N} \sum_{n=1}^{N} (\vect{y}_n - \gvect{\mu}_y)(\vect{y}_n - \gvect{\mu}_y)^\top

MatrixLinearOperator (dense)

O(B2)\mathcal{O}(B^2) once, then O(B)\mathcal{O}(B)

estimate_cov_shrunk (Ledoit–Wolf, OAS)

(1−β)Σ^y+βtr(Σ^y)BI(1 - \beta) \hat{\gmat{\Sigma}}_y + \beta \frac{\op{tr}(\hat{\gmat{\Sigma}}_y)}{B} \mat{I}

MatrixLinearOperator (dense, PD)

same

estimate_cov_lowrank

σtik2I+Vdiag(σ2)V⊤\sigma_\text{tik}^2 \mat{I} + \mat{V} \op{diag}(\gvect{\sigma}^2) \mat{V}^\top, V\mat{V} from a randomised SVD

gaussx_linalg.LowRankUpdate (Woodbury)

O(Br+r3)\mathcal{O}(B r + r^3) once, then O(B)\mathcal{O}(B)

gmm_cluster_background

(μy(k),Σy(k))(\gvect{\mu}_y^{(k)}, \gmat{\Sigma}_y^{(k)}) per GMM cluster k=1,…,Kk = 1, \ldots, K

list of the operators above, one per cluster

per-cluster amortised

The Ledoit–Wolf and OAS estimators come from sklearn.covariance, and both shrink toward the scaled identity in the table; the randomised SVD of the low-rank estimator is gaussx_sketch.randomized_svd (Halko–Martinsson–Tropp, in JAX). The background estimation is off the JAX gradient path (the background is treated as a fixed input), so we lean on scikit-learn freely there. Only the per-pixel application stays in JAX, vectorised with jax.vmap or einsum for GPU-friendly batching.

3.1 Why low-rank plus Tikhonov matters

For N≫BN \gg B and a homogeneous scene, the spectral covariance is close to low rank: a handful of surface-reflectance principal components explain most of the variance. Writing Σy=σtik2I+Vdiag(σ2)V⊤\gmat{\Sigma}_y = \sigma_\text{tik}^2 \mat{I} + \mat{V} \op{diag}(\gvect{\sigma}^2) \mat{V}^\top lets us apply Woodbury, so we will have:

Σy−1=σtik−2I−σtik−4V(diag(σ2)−1+σtik−2V⊤V)−1V⊤\gmat{\Sigma}_y^{-1} = \sigma_\text{tik}^{-2} \mat{I} - \sigma_\text{tik}^{-4} \mat{V} \left(\op{diag}(\gvect{\sigma}^2)^{-1} + \sigma_\text{tik}^{-2} \mat{V}^\top \mat{V}\right)^{-1} \mat{V}^\top

The inner inverse is r×rr \times r, so w=Σy−1Jh\vect{w} = \gmat{\Sigma}_y^{-1} \mat{J}_h costs O(Br+r3)\mathcal{O}(B r + r^3) instead of O(B3)\mathcal{O}(B^3). For a typical hyperspectral methane setup (B=400B = 400, r=16r = 16) this is a ~1000× speedup on the MF precompute, which the user only sees in that estimate_cov_lowrank returns a gaussx_linalg.LowRankUpdate instead of a dense operator.

4. Relationship to 3D-Var

In the notation of the 3D-Var page, x∈RNx\vect{x} \in \mathbb{R}^{N_x} is the state with prior mean μx\gvect{\mu}_x and covariance Σx\gmat{\Sigma}_x, y∈RM\vect{y} \in \mathbb{R}^{M} the observations with error covariance Σε\gmat{\Sigma}_\varepsilon, hh the observation operator and H=Jh(μx)\mat{H} = \mat{J}_h(\gvect{\mu}_x) its tangent-linear, d=y−h(μx)\vect{d} = \vect{y} - h(\gvect{\mu}_x) the innovation and δx=x−μx\delta\vect{x} = \vect{x} - \gvect{\mu}_x the increment. (Here NxN_x and MM are the sizes of the state and of the observations, written NN and MM on that page; NN on this page counts background pixels.) Incremental 3D-Var minimises

J(δx)=12δx⊤Σx−1δx+12(d−Hδx)⊤Σε−1(d−Hδx)\mathcal{J}(\delta\vect{x}) = \frac{1}{2} \delta\vect{x}^\top \gmat{\Sigma}_x^{-1} \delta\vect{x} + \frac{1}{2} (\vect{d} - \mat{H} \delta\vect{x})^\top \gmat{\Sigma}_\varepsilon^{-1} (\vect{d} - \mat{H} \delta\vect{x})

and the PSAS (dual) path solves for a dual variable y†∈RM\vect{y}^\dagger \in \mathbb{R}^{M} in observation space, then maps it back to the state:

(HΣxH⊤+Σε)y†=d(\mat{H} \gmat{\Sigma}_x \mat{H}^\top + \gmat{\Sigma}_\varepsilon) \vect{y}^\dagger = \vect{d}
δx^=ΣxH⊤y†\delta\hat{\vect{x}} = \gmat{\Sigma}_x \mat{H}^\top \vect{y}^\dagger

The MF is the PSAS analysis of a one-dimensional state, the plume strength itself, under a flat prior. Let’s take δx=α\delta\vect{x} = \alpha, so the tangent-linear is the target signature, H=Jh\mat{H} = \mat{J}_h, and the innovation of one pixel is d=y−μy\vect{d} = \vect{y} - \gvect{\mu}_y. Let’s also take the prior variance Σx=σx2\gmat{\Sigma}_x = \sigma_x^2 and the observation error Σε=Σy\gmat{\Sigma}_\varepsilon = \gmat{\Sigma}_y. Then (14) is a rank-one update of Σy\gmat{\Sigma}_y, and the Sherman–Morrison formula solves it in closed form, so we will have:

(σx2JhJh⊤+Σy)y†=d(\sigma_x^2 \mat{J}_h \mat{J}_h^\top + \gmat{\Sigma}_y) \vect{y}^\dagger = \vect{d}
y†=Σy−1d−Σy−1JhJh⊤Σy−1dσx−2+Jh⊤Σy−1Jh\vect{y}^\dagger = \gmat{\Sigma}_y^{-1} \vect{d} - \frac{\gmat{\Sigma}_y^{-1} \mat{J}_h \mat{J}_h^\top \gmat{\Sigma}_y^{-1} \vect{d}}{\sigma_x^{-2} + \mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h}
α^=σx2Jh⊤y†=Jh⊤Σy−1dJh⊤Σy−1Jh+σx−2\hat\alpha = \sigma_x^2 \mat{J}_h^\top \vect{y}^\dagger = \frac{\mat{J}_h^\top \gmat{\Sigma}_y^{-1} \vect{d}}{\mat{J}_h^\top \gmat{\Sigma}_y^{-1} \mat{J}_h + \sigma_x^{-2}}

As σx→∞\sigma_x \to \infty the σx−2\sigma_x^{-2} in the denominator vanishes and α^\hat\alpha is the matched filter (4) at y=μy+d\vect{y} = \gvect{\mu}_y + \vect{d}. For a finite σx\sigma_x the same algebra gives the matched filter shrunk toward zero by its prior, which is the one-pixel version of what the full retrieval does. So the MF is not a heuristic: it is the exact, closed-form, flat-prior dual 3D-Var solution, and for this one-dimensional problem the dual solve needs no iterations at all; the SNR and threshold formulas follow without further work. run_dual_psas solves the same system with CG for a full field.

The corollary is that when Σx\gmat{\Sigma}_x is not flat, i.e. when we have real prior information about the VMR field (spatial smoothness, a climatological mean, etc.), the full 3D-Var retrieval uses information the MF throws away, and it does better whenever that prior is right. See plumax’s 01_mf_vs_3dvar.ipynb for a numerical comparison on the same scene (it lives in plumax because it simulates the plume).

5. Where the target signature comes from

For methane, Jh\mat{J}_h is the spectral signature of a unit VMR enhancement. Let’s write the Beer–Lambert forward model per wavenumber ν\nu as L(ν)=L0(ν)exp⁡(−a(ν)ΔVMR)L(\nu) = L_0(\nu) \exp(-a(\nu) \Delta\mathrm{VMR}), where L0(ν)L_0(\nu) is the background radiance and a(ν)≥0a(\nu) \ge 0 the absorption per unit enhancement. Its Taylor expansion at the background state gives

Jh(ν)=∂L∂ΔVMR∣ΔVMR=0=−L0(ν)a(ν)J_h(\nu) = \left. \frac{\partial L}{\partial \Delta\mathrm{VMR}} \right|_{\Delta\mathrm{VMR} = 0} = -L_0(\nu) a(\nu)

where −a(ν)-a(\nu) is the unit absorption tt at that wavenumber, so the target is the background radiance times the unit absorption. Rather than hard-coding this, we take the JVP of the existing observation operator: linear_target_from_obs differentiates the forward model with jax.jvp along a perturbation pattern of the state and reads the result at one output pixel.

from radtrax.retrieval.matched_filter import linear_target_from_obs

# Shapes: H, W rows and columns of the state grid; B bands

# today (radtrax)
# J_h = ∂h(μ_x + α δx) / ∂α at α = 0, with δx uniform over the scene
target = linear_target_from_obs(                             # (H, W) → (B,)
    obs, vmr_background, pattern="uniform"
)

This guarantees the target is exactly consistent with whatever forward model (PSF, GSD, SRF) the retrieval uses, so there is no drift between a “target generator” and the forward model. For strong plumes, where Beer–Lambert saturation matters, nonlinear_target_from_obs(obs, vmr_background, amplitude=α) computes the exact finite-amplitude response h(μx+αδx)−h(μx)h(\gvect{\mu}_x + \alpha \delta\vect{x}) - h(\gvect{\mu}_x) instead. That turns the filter into the additive approximation of the clairvoyant detector at α\alpha, the optimal detector when the strength is known (Absorptive plume detection, Step 4), which is best near the chosen amplitude and not uniformly.

5.1 Three targets for one gas

On the layered ForwardModel, unit_absorption_target returns the gas’s unit absorption in log radiance, t\vect{t} with tb=∂ln⁡yb/∂αt_b = \partial \ln y_b / \partial \alpha, which is negative where the gas absorbs. Since Beer–Lambert is multiplicative, the additive target built from it depends on what the filter is applied to, and Theiler [5] and Schaum [6] compare three:

Matched-filter targets for an absorbing gas.

Target

Applied to

Assumes

radtrax

t\vect{t} on radiance (“t”)

y\vect{y}

a spectrally flat background

apply_image(cube, mean, cov, t); not recommended

μy⊙t\gvect{\mu}_y \odot \vect{t} (“Tμ”)

y\vect{y}

every pixel’s plume direction is the mean pixel’s

apply_image(cube, mean, cov, mean * t)

t\vect{t} on log radiance

ln⁡y\ln \vect{y}

lognormal clutter, so the plume is a shift in log space

apply_image(np.log(cube), mean_ln, cov_ln, t), with mean_ln, cov_ln estimated on np.log(cube)

The Tμ target beat the flat one on every scene in both papers, and the Beer–Lambert target (19) above is of the Tμ kind. The log-space filter is uniformly most powerful when the clutter is lognormal, but band integration and additive sensor noise break that model; on Theiler’s real scenes its fattened variants (log-ACE, log-EC) did well, while on the synthetic EMIT-like scene the plain Tμ filter beat it. Beyond Gaussian clutter has the details.

6. Summary

The pieces of radtrax.retrieval.matched_filter:

Module

Role

core.py

apply_pixel, apply_image, matched_filter_snr, detection_threshold: (4), (5) and (6). Dispatches on the structure of cov_op via gaussx_linalg.solve.

target.py

linear_target_from_obs (JVP), nonlinear_target_from_obs (finite amplitude) and unit_absorption_target (log radiance on the layered ForwardModel).

background.py

estimate_mean (robust variants) and estimate_cov_{empirical,shrunk,lowrank}: scikit-learn or gaussx_sketch.randomized_svd in, lineax/gaussx operators out.

cluster.py

gmm_cluster_background and adaptive_window_background: a spatially varying (μy,Σy)(\gvect{\mu}_y, \gmat{\Sigma}_y) when the scene is heterogeneous.

streaming.py

WelfordAccumulator and streaming_background, for background aggregation over many scenes or files.

io.py

apply_image_xarray and open_multi_scene: the xarray glue (dimensional metadata, Dask chunks, open_mfdataset).

The two companion notebooks:

Footnotes
  1. Funk, C. C., Theiler, J., Roberts, D. A., & Borel, C. C. (2001). Clustering to improve matched filter detection of weak gas plumes in hyperspectral thermal imagery. IEEE TGRS, 39(7).

  2. Theiler, J. & Foy, B. R. (2006). Effect of signal contamination in matched-filter detection of the signal on a cluttered background. IEEE GRSL, 3(1).

  3. Thompson, D. R., et al. (2015). Real-time remote detection and measurement for airborne imaging spectroscopy: a case study with methane. AMT, 8.

  4. Golub, G. H. & Van Loan, C. F. (2013). Matrix Computations (4th ed.). Johns Hopkins.

  5. Theiler, J. (2021). Absorptive weak plume detection on Gaussian and non-Gaussian background clutter. IEEE JSTARS, 14, 6842–6854. doi:10.1109/JSTARS.2021.3093820

  6. Schaum, A. (2021). A uniformly most powerful detector of gas plumes against a cluttered background. Remote Sensing of Environment, 260, 112443. doi:10.1016/j.rse.2021.112443