Observations¶
Satellite L2 methane products as coupled.Instruments on a LocalFrame, with the observed column-mass enhancement fuse_observations takes: TROPOMI, EMIT and GHGSat, read through xrreader. Tier 0. Needs pip install 'plumax[io]'.
obs
¶
Satellite L2 observations for the coupled inversion (Tier 0 prerequisites).
Loaders that turn one L2 methane product into a
:class:~plumax.coupled.Instrument (receptors on a
:class:~plumax.met.LocalFrame, a scalar averaging kernel, the retrieval
variance) plus the observed column-mass enhancement
:func:~plumax.coupled.fuse_observations takes:
- :func:
load_tropomi_l2— TROPOMI CH₄ (bias-corrected XCH₄, column averaging kernel, QA screening). - :func:
load_emit_l2b— EMIT L2B CH₄ enhancement (ppm·m). - :func:
load_ghgsat_l2— GHGSat per-plume XCH₄.
The files are read with xrreader's openers; needs the io extra.
ColumnObservation
¶
Bases: Module
One product's instrument and its observed enhancement.
Attributes:
| Name | Type | Description |
|---|---|---|
instrument |
Instrument
|
Receptors, scalar averaging kernel and retrieval variance,
ready for |
enhancement |
Float[Array, ' pixel']
|
Observed column-mass enhancement ΔΩ [kg m⁻²], aligned
with |
time |
datetime64
|
Observation timestamp (UTC); |
load_emit_l2b
¶
load_emit_l2b(path: str | Path, *, frame: LocalFrame, bbox: BBox | None = None, glt_path: str | Path | None = None, retrieval_sigma_ppm_m: float | None = None, pressure_pa: float = P_STANDARD, temperature_k: float = T_STANDARD, clock: TimeAxis | None = None, name: str = 'EMIT') -> ColumnObservation
An EMIT L2B CH₄ enhancement scene as an instrument and its enhancement.
ΔΩ = E · 10⁻⁶ · (p / (k_B T)) · M / N_A, A = 1.
The enhancement E (ppm·m) is already above background. Its uncertainty
comes from ch4_uncertainty when the file has it, else from
retrieval_sigma_ppm_m.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
NetCDF raster (see :func: |
required |
frame
|
LocalFrame
|
Analysis frame. |
required |
bbox
|
BBox | None
|
Optional |
None
|
glt_path
|
str | Path | None
|
Optional geometric lookup table for orthorectification. |
None
|
retrieval_sigma_ppm_m
|
float | None
|
Per-pixel 1-σ [ppm m] for files without
|
None
|
pressure_pa
|
float
|
Near-surface pressure p for the ppm·m conversion. |
P_STANDARD
|
temperature_k
|
float
|
Near-surface temperature T for the ppm·m conversion. |
T_STANDARD
|
clock
|
TimeAxis | None
|
Sets |
None
|
name
|
str
|
Instrument name. |
'EMIT'
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
ColumnObservation
|
class: |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
If the |
MissingVariableError
|
If neither an uncertainty field nor
|
ScreeningError
|
If no pixel survives the screening. |
Source code in src/plumax/obs/_src/ingest.py
load_ghgsat_l2
¶
load_ghgsat_l2(path: str | Path, *, frame: LocalFrame, retrieval_sigma_ppb: float, bbox: BBox | None = None, background_ppb: float | None = None, surface_pressure_pa: float = P_STANDARD, clock: TimeAxis | None = None, name: str = 'GHGSat') -> ColumnObservation
A GHGSat per-plume XCH₄ file as an instrument and its enhancement.
ΔΩ = (XCH₄ − b) · 10⁻⁹ · N_dry(p_s) · M / N_A, A = 1.
GHGSat files carry xch4 [ppb] without a kernel or a per-pixel
precision, so the precision is an argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Per-plume NetCDF (see :func: |
required |
frame
|
LocalFrame
|
Analysis frame. |
required |
retrieval_sigma_ppb
|
float
|
Per-pixel 1-σ [ppb]. |
required |
bbox
|
BBox | None
|
Optional |
None
|
background_ppb
|
float | None
|
Background XCH₄ b [ppb]; the median of the kept pixels
when |
None
|
surface_pressure_pa
|
float
|
Surface pressure p_s for N_dry. |
P_STANDARD
|
clock
|
TimeAxis | None
|
Sets |
None
|
name
|
str
|
Instrument name. |
'GHGSat'
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
ColumnObservation
|
class: |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
If the |
MissingVariableError
|
If the file has no |
ScreeningError
|
If no pixel survives the screening. |
Source code in src/plumax/obs/_src/ingest.py
load_tropomi_l2
¶
load_tropomi_l2(path: str | Path, *, frame: LocalFrame, bbox: BBox | None = None, background_ppb: float | None = None, qa_min: float = 0.5, surface_layer: int = -1, clock: TimeAxis | None = None, name: str = 'TROPOMI') -> ColumnObservation
A TROPOMI CH₄ L2 granule as an instrument and its enhancement.
ΔΩ = (XCH₄ − b) · 10⁻⁹ · N_dry(p_s) · M / N_A, σ_Ω = σ_χ · 10⁻⁹ · N_dry · M / N_A, A = A_{surface layer}.
Algorithm
- Open the granule with xrreader (QA screening at
qa_min) and add the dry-air column from the surface pressure. - Flatten the swath to pixels; drop NaNs and pixels outside
bbox. - Take the background (default: median of the kept XCH₄), convert XCH₄ and its precision to column mass, and pick the near-surface kernel layer.
- Place the kept pixel centres in the frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
|
required |
frame
|
LocalFrame
|
Analysis frame the receptors are placed in. |
required |
bbox
|
BBox | None
|
Optional |
None
|
background_ppb
|
float | None
|
Background XCH₄ b [ppb]; the median of the kept
pixels when |
None
|
qa_min
|
float
|
Minimum |
0.5
|
surface_layer
|
int
|
Index of the near-surface retrieval layer; layers run
top of atmosphere first, so the default is |
-1
|
clock
|
TimeAxis | None
|
Sets |
None
|
name
|
str
|
Instrument name. |
'TROPOMI'
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
ColumnObservation
|
class: |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
If the |
ScreeningError
|
If no pixel survives the screening. |
Source code in src/plumax/obs/_src/ingest.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
ppb_to_column_mass
¶
ppb_to_column_mass(delta_ppb: Float[ndarray, '*#pixel'] | float, dry_air_molecules: Float[ndarray, '*#pixel'] | float) -> Float[np.ndarray, ' ...']
Column-mass enhancement of a mixing-ratio enhancement.
ΔΩ = Δχ · 10⁻⁹ · N_dry · M / N_A.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delta_ppb
|
Float[ndarray, '*#pixel'] | float
|
Mixing-ratio enhancement Δχ [ppb]. |
required |
dry_air_molecules
|
Float[ndarray, '*#pixel'] | float
|
Dry-air column N_dry [molecules m⁻²]. |
required |
Returns:
| Type | Description |
|---|---|
Float[ndarray, ' ...']
|
ΔΩ [kg m⁻²]. |
Examples:
1 ppb over a 1013.25 hPa dry column is about 5.7 mg m⁻²:
>>> import numpy as np
>>> dry_air = 101_325.0 * 6.02214076e23 / (9.80665 * 0.0289644)
>>> bool(np.isclose(ppb_to_column_mass(1.0, dry_air), 5.72e-6, rtol=1e-3))
True
Linear in Δχ, elementwise over pixels:
Source code in src/plumax/obs/_src/ingest.py
ppm_m_to_column_mass
¶
ppm_m_to_column_mass(enhancement_ppm_m: Float[ndarray, '*#pixel'] | float, *, pressure_pa: float, temperature_k: float) -> Float[np.ndarray, ' ...']
Column-mass enhancement of a path-integrated enhancement.
ΔΩ = E · 10⁻⁶ · (p / (k_B T)) · M / N_A.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enhancement_ppm_m
|
Float[ndarray, '*#pixel'] | float
|
Path-integrated enhancement E [ppm m]. |
required |
pressure_pa
|
float
|
Layer pressure p [Pa]. |
required |
temperature_k
|
float
|
Layer temperature T [K]. |
required |
Returns:
| Type | Description |
|---|---|
Float[ndarray, ' ...']
|
ΔΩ [kg m⁻²]. |
Examples:
1000 ppm·m at 1013.25 hPa and 288.15 K: 42.3 mol m⁻³ · 1 mm · M:
>>> import numpy as np
>>> mass = ppm_m_to_column_mass(
... 1000.0, pressure_pa=101_325.0, temperature_k=288.15
... )
>>> bool(np.isclose(mass, 42.29e-3 * 0.0160425, rtol=1e-3))
True
Thinner air at altitude carries less mass for the same E:
>>> high = ppm_m_to_column_mass(
... 1000.0, pressure_pa=70_000.0, temperature_k=288.15
... )
>>> bool(high < mass)
True