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 xrproducts. 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₄.
For the image fit, one plume rather than a whole scene:
- :func:
load_emit_plume_complex— one catalogued plume of an EMIT scene as a :class:PlumeScene: the window around its outline with the sensitivity as the averaging kernel, a per-pixel noise, the quality mask, the pseudo-origin and a starting direction. - :func:
matched_filter_scene— the same observation from radtrax's score, noise and sensitivity maps.
The files are read with xrproducts'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); |
PlumeScene
¶
Bases: Module
One plume: its observation, its outline and where the fit starts.
yₙ = Aₙ ΔΩₙ + εₙ, εₙ ~ 𝒩(0, σₙ²), with yₙ, Aₙ, σₙ² and the mask ωₙ
held by observation.
Attributes:
| Name | Type | Description |
|---|---|---|
observation |
ColumnObservation
|
Instrument (receptors, Aₙ, σₙ², ωₙ) and enhancement yₙ. |
origin |
Float[Array, ' axis']
|
Pseudo-origin s₀ in the local frame [m]. |
outline |
Float[Array, 'vertex axis']
|
Plume outline in the local frame [m], closed. |
in_plume |
Bool[Array, ' pixel']
|
Whether each kept pixel lies inside the outline. |
direction |
Float[Array, '']
|
Starting direction φ₀ [rad], origin to plume centroid, counter-clockwise from the frame's x axis. |
pixel_index |
Int[Array, 'pixel 2']
|
|
plume_id |
str
|
Identifier of the plume in its product. |
pixel_size |
float
|
Pixel side g [m]. |
window |
tuple[int, int, int, int]
|
|
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 xrproducts (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
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 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 | |
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
>>> from geophysix.columns import dry_air_column
>>> from geophysix.constants import STANDARD
>>> dry_air = dry_air_column(101_325.0) * STANDARD.avogadro
>>> 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, molar_mass: float = M_CH4) -> 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 |
molar_mass
|
float
|
Molar mass M of the gas [kg mol⁻¹]; CH₄ by default. |
M_CH4
|
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
Source code in src/plumax/_src/units.py
load_emit_plume_complex
¶
load_emit_plume_complex(enhancement_path: str | Path, outlines_path: str | Path, *, plume_id: str, frame: LocalFrame, sensitivity_path: str | Path | None = None, uncertainty_path: str | Path | None = None, quality_path: str | Path | None = None, glt_path: str | Path | None = None, margin_px: int = 10, uncertainty_of: Literal['truth', 'score'] = 'truth', retrieval_sigma_ppm_m: float | None = None, pressure_pa: float = P_STANDARD, temperature_k: float = T_STANDARD, clock: TimeAxis | None = None, name: str = 'EMIT') -> PlumeScene
One catalogued plume of an EMIT scene as a PlumeScene.
yₙ = κ Eₙ, Aₙ from the sensitivity raster, and σₙ = κ Aₙ uₙ
("truth") or σₙ = κ uₙ ("score"), with κ the ppm m to kg m⁻²
factor of :func:ppm_m_to_column_mass.
Algorithm
- Open the enhancement with its companions, and the outlines.
- Select the plume; crop to its bounding box plus the margin.
- Convert the enhancement and its noise to column mass.
- Build the mask from the fill values, the sensitivity and the quality raster.
- Project receptors, origin and outline into the local frame.
- Take the pixel side and the starting direction from them.
The stored enhancement is the raw matched-filter score, so it is
converted but never divided by the sensitivity. A pixel is masked
(ωₙ = 0) when its enhancement, sensitivity or uncertainty is missing,
its sensitivity is not positive, or the quality raster flags it as
cloud, cirrus, water (geoops.qa.EMITL2AMask) or saturated
(geoops.qa.EMITBandMask, dilated by 10 pixels). A masked pixel stays
in the arrays with yₙ = 0, Aₙ = 1 and the median σₙ² of the kept pixels,
so the window keeps its pixels for plotting; a pixel with no location,
or with none of the three fields, is dropped. The DAAC plume files carry
no pseudo-origin; the brightest in-plume pixel stands in for it then.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enhancement_path
|
str | Path
|
Enhancement raster E [ppm m] (NetCDF, see
|
required |
outlines_path
|
str | Path
|
Plume-complex GeoJSON. |
required |
plume_id
|
str
|
Identifier of the plume to load. |
required |
frame
|
LocalFrame
|
Local metre frame of the analysis. |
required |
sensitivity_path
|
str | Path | None
|
Sensitivity raster A; |
None
|
uncertainty_path
|
str | Path | None
|
Uncertainty raster u [ppm m]. |
None
|
quality_path
|
str | Path | None
|
EMIT L2A MASK NetCDF ( |
None
|
glt_path
|
str | Path | None
|
Geometric lookup table, for swath-geometry rasters; the quality flags are decoded in swath geometry and go through it too. |
None
|
margin_px
|
int
|
Margin around the outline's bounding box, in pixels. |
10
|
uncertainty_of
|
Literal['truth', 'score']
|
Whether u is the noise of the enhancement divided
by the sensitivity ( |
'truth'
|
retrieval_sigma_ppm_m
|
float | None
|
Constant u for files without an uncertainty raster. |
None
|
pressure_pa
|
float
|
Near-surface pressure p [Pa] for the conversion. |
P_STANDARD
|
temperature_k
|
float
|
Near-surface temperature T [K] for the conversion. |
T_STANDARD
|
clock
|
TimeAxis | None
|
Sets the instrument's observation time. |
None
|
name
|
str
|
Instrument name. |
'EMIT'
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
PlumeScene
|
class: |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
If the |
MissingVariableError
|
If |
GridMismatchError
|
If the outline's bounding box leaves the scene, or the quality raster is not on the scene's grid. |
ScreeningError
|
If no pixel survives the mask. |
ParameterError
|
If |
DomainError
|
If the plume's centroid is within a pixel of its origin. |
Examples:
On the files a catalogue lists for one plume::
scene = load_emit_plume_complex(
"scene_CH4ENH.nc",
"plume_complexes.json",
plume_id="CH4_PlumeComplex-1234",
frame=frame,
sensitivity_path="scene_CH4SENS.nc",
uncertainty_path="scene_CH4UNCERT.nc",
)
scene.instrument.averaging_kernel # Aₙ, shape (N_Ωy,)
Source code in src/plumax/obs/_src/plume_scene.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
matched_filter_scene
¶
matched_filter_scene(score: Float[ndarray, 'row col'], score_std: Float[ndarray, 'row col'] | float, *, lat: Float[ndarray, 'row col'], lon: Float[ndarray, 'row col'], frame: LocalFrame, sensitivity: Float[ndarray, 'row col'] | None = None, exclude: Bool[ndarray, 'row col'] | None = None, unit: Literal['mol_m2', 'ppm_m', 'kg_m2'] = 'mol_m2', pressure_pa: float = P_STANDARD, temperature_k: float = T_STANDARD, name: str = 'EMIT') -> ColumnObservation
A ColumnObservation from radtrax's score, noise and sensitivity maps.
yₙ = M α̂ₙ and σₙ = M σ_α,n for a score in mol m⁻², with M the molar
mass of methane; Aₙ is the sensitivity, or 1. A scalar score_std is
the noise of every pixel.
The noise is that of the raw score (radtrax's score_std), so it is
not multiplied by the sensitivity. For unit="ppm_m" the factor is κ
of :func:ppm_m_to_column_mass, and for "kg_m2" it is 1. Pixels
with a missing value or location, a non-positive sensitivity or set in
exclude get ω = 0 (with y = 0, A = 1 and the median σ² of the kept
pixels); pixels with no location or none of the fields are dropped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
score
|
Float[ndarray, 'row col']
|
Matched-filter score α̂ in |
required |
score_std
|
Float[ndarray, 'row col'] | float
|
Its standard deviation σ_α, per pixel or one for all. |
required |
lat
|
Float[ndarray, 'row col']
|
Pixel-centre latitudes [degrees]. |
required |
lon
|
Float[ndarray, 'row col']
|
Pixel-centre longitudes [degrees]. |
required |
frame
|
LocalFrame
|
Local metre frame of the analysis. |
required |
sensitivity
|
Float[ndarray, 'row col'] | None
|
Sensitivity A; |
None
|
exclude
|
Bool[ndarray, 'row col'] | None
|
Pixels to mask out, such as |
None
|
unit
|
Literal['mol_m2', 'ppm_m', 'kg_m2']
|
Unit of |
'mol_m2'
|
pressure_pa
|
float
|
Near-surface pressure p [Pa], for |
P_STANDARD
|
temperature_k
|
float
|
Near-surface temperature T [K], for |
T_STANDARD
|
name
|
str
|
Instrument name. |
'EMIT'
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
ColumnObservation
|
class: |
Raises:
| Type | Description |
|---|---|
UnitsError
|
If |
ScreeningError
|
If no pixel survives the mask. |
Examples:
>>> import numpy as np
>>> from plumax.met import LocalFrame
>>> frame = LocalFrame.at(31.95, -102.15)
>>> lat, lon = frame.to_latlon(*np.meshgrid([0.0, 60.0], [0.0, 60.0]))
>>> observation = matched_filter_scene(
... np.full((2, 2), 0.01), 0.002, lat=lat, lon=lon, frame=frame
... )
>>> observation.enhancement.tolist() # M α̂ = 0.0160425 × 0.01
[0.000160425, 0.000160425, 0.000160425, 0.000160425]
Source code in src/plumax/obs/_src/plume_scene.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | |
plume_scene: one plume for the image fit¶
load_emit_plume_complex loads one catalogued plume of an EMIT scene as a PlumeScene: the window around its outline (plus a margin), with the sensitivity as the averaging kernel, a per-pixel noise, the quality mask (cloud, cirrus and water from the L2A mask, and the saturation mask from the band mask, through geoops.qa), the pseudo-origin and a starting direction. matched_filter_scene builds the same observation from radtrax's score, noise and sensitivity maps. The enhancement is never divided by the sensitivity; the model is multiplied by it instead.
One plume from a matched-filter product (implementation in plumax.obs._src.plume_scene).
PlumeScene
¶
Bases: Module
One plume: its observation, its outline and where the fit starts.
yₙ = Aₙ ΔΩₙ + εₙ, εₙ ~ 𝒩(0, σₙ²), with yₙ, Aₙ, σₙ² and the mask ωₙ
held by observation.
Attributes:
| Name | Type | Description |
|---|---|---|
observation |
ColumnObservation
|
Instrument (receptors, Aₙ, σₙ², ωₙ) and enhancement yₙ. |
origin |
Float[Array, ' axis']
|
Pseudo-origin s₀ in the local frame [m]. |
outline |
Float[Array, 'vertex axis']
|
Plume outline in the local frame [m], closed. |
in_plume |
Bool[Array, ' pixel']
|
Whether each kept pixel lies inside the outline. |
direction |
Float[Array, '']
|
Starting direction φ₀ [rad], origin to plume centroid, counter-clockwise from the frame's x axis. |
pixel_index |
Int[Array, 'pixel 2']
|
|
plume_id |
str
|
Identifier of the plume in its product. |
pixel_size |
float
|
Pixel side g [m]. |
window |
tuple[int, int, int, int]
|
|
load_emit_plume_complex
¶
load_emit_plume_complex(enhancement_path: str | Path, outlines_path: str | Path, *, plume_id: str, frame: LocalFrame, sensitivity_path: str | Path | None = None, uncertainty_path: str | Path | None = None, quality_path: str | Path | None = None, glt_path: str | Path | None = None, margin_px: int = 10, uncertainty_of: Literal['truth', 'score'] = 'truth', retrieval_sigma_ppm_m: float | None = None, pressure_pa: float = P_STANDARD, temperature_k: float = T_STANDARD, clock: TimeAxis | None = None, name: str = 'EMIT') -> PlumeScene
One catalogued plume of an EMIT scene as a PlumeScene.
yₙ = κ Eₙ, Aₙ from the sensitivity raster, and σₙ = κ Aₙ uₙ
("truth") or σₙ = κ uₙ ("score"), with κ the ppm m to kg m⁻²
factor of :func:ppm_m_to_column_mass.
Algorithm
- Open the enhancement with its companions, and the outlines.
- Select the plume; crop to its bounding box plus the margin.
- Convert the enhancement and its noise to column mass.
- Build the mask from the fill values, the sensitivity and the quality raster.
- Project receptors, origin and outline into the local frame.
- Take the pixel side and the starting direction from them.
The stored enhancement is the raw matched-filter score, so it is
converted but never divided by the sensitivity. A pixel is masked
(ωₙ = 0) when its enhancement, sensitivity or uncertainty is missing,
its sensitivity is not positive, or the quality raster flags it as
cloud, cirrus, water (geoops.qa.EMITL2AMask) or saturated
(geoops.qa.EMITBandMask, dilated by 10 pixels). A masked pixel stays
in the arrays with yₙ = 0, Aₙ = 1 and the median σₙ² of the kept pixels,
so the window keeps its pixels for plotting; a pixel with no location,
or with none of the three fields, is dropped. The DAAC plume files carry
no pseudo-origin; the brightest in-plume pixel stands in for it then.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enhancement_path
|
str | Path
|
Enhancement raster E [ppm m] (NetCDF, see
|
required |
outlines_path
|
str | Path
|
Plume-complex GeoJSON. |
required |
plume_id
|
str
|
Identifier of the plume to load. |
required |
frame
|
LocalFrame
|
Local metre frame of the analysis. |
required |
sensitivity_path
|
str | Path | None
|
Sensitivity raster A; |
None
|
uncertainty_path
|
str | Path | None
|
Uncertainty raster u [ppm m]. |
None
|
quality_path
|
str | Path | None
|
EMIT L2A MASK NetCDF ( |
None
|
glt_path
|
str | Path | None
|
Geometric lookup table, for swath-geometry rasters; the quality flags are decoded in swath geometry and go through it too. |
None
|
margin_px
|
int
|
Margin around the outline's bounding box, in pixels. |
10
|
uncertainty_of
|
Literal['truth', 'score']
|
Whether u is the noise of the enhancement divided
by the sensitivity ( |
'truth'
|
retrieval_sigma_ppm_m
|
float | None
|
Constant u for files without an uncertainty raster. |
None
|
pressure_pa
|
float
|
Near-surface pressure p [Pa] for the conversion. |
P_STANDARD
|
temperature_k
|
float
|
Near-surface temperature T [K] for the conversion. |
T_STANDARD
|
clock
|
TimeAxis | None
|
Sets the instrument's observation time. |
None
|
name
|
str
|
Instrument name. |
'EMIT'
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
PlumeScene
|
class: |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
If the |
MissingVariableError
|
If |
GridMismatchError
|
If the outline's bounding box leaves the scene, or the quality raster is not on the scene's grid. |
ScreeningError
|
If no pixel survives the mask. |
ParameterError
|
If |
DomainError
|
If the plume's centroid is within a pixel of its origin. |
Examples:
On the files a catalogue lists for one plume::
scene = load_emit_plume_complex(
"scene_CH4ENH.nc",
"plume_complexes.json",
plume_id="CH4_PlumeComplex-1234",
frame=frame,
sensitivity_path="scene_CH4SENS.nc",
uncertainty_path="scene_CH4UNCERT.nc",
)
scene.instrument.averaging_kernel # Aₙ, shape (N_Ωy,)
Source code in src/plumax/obs/_src/plume_scene.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
matched_filter_scene
¶
matched_filter_scene(score: Float[ndarray, 'row col'], score_std: Float[ndarray, 'row col'] | float, *, lat: Float[ndarray, 'row col'], lon: Float[ndarray, 'row col'], frame: LocalFrame, sensitivity: Float[ndarray, 'row col'] | None = None, exclude: Bool[ndarray, 'row col'] | None = None, unit: Literal['mol_m2', 'ppm_m', 'kg_m2'] = 'mol_m2', pressure_pa: float = P_STANDARD, temperature_k: float = T_STANDARD, name: str = 'EMIT') -> ColumnObservation
A ColumnObservation from radtrax's score, noise and sensitivity maps.
yₙ = M α̂ₙ and σₙ = M σ_α,n for a score in mol m⁻², with M the molar
mass of methane; Aₙ is the sensitivity, or 1. A scalar score_std is
the noise of every pixel.
The noise is that of the raw score (radtrax's score_std), so it is
not multiplied by the sensitivity. For unit="ppm_m" the factor is κ
of :func:ppm_m_to_column_mass, and for "kg_m2" it is 1. Pixels
with a missing value or location, a non-positive sensitivity or set in
exclude get ω = 0 (with y = 0, A = 1 and the median σ² of the kept
pixels); pixels with no location or none of the fields are dropped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
score
|
Float[ndarray, 'row col']
|
Matched-filter score α̂ in |
required |
score_std
|
Float[ndarray, 'row col'] | float
|
Its standard deviation σ_α, per pixel or one for all. |
required |
lat
|
Float[ndarray, 'row col']
|
Pixel-centre latitudes [degrees]. |
required |
lon
|
Float[ndarray, 'row col']
|
Pixel-centre longitudes [degrees]. |
required |
frame
|
LocalFrame
|
Local metre frame of the analysis. |
required |
sensitivity
|
Float[ndarray, 'row col'] | None
|
Sensitivity A; |
None
|
exclude
|
Bool[ndarray, 'row col'] | None
|
Pixels to mask out, such as |
None
|
unit
|
Literal['mol_m2', 'ppm_m', 'kg_m2']
|
Unit of |
'mol_m2'
|
pressure_pa
|
float
|
Near-surface pressure p [Pa], for |
P_STANDARD
|
temperature_k
|
float
|
Near-surface temperature T [K], for |
T_STANDARD
|
name
|
str
|
Instrument name. |
'EMIT'
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
ColumnObservation
|
class: |
Raises:
| Type | Description |
|---|---|
UnitsError
|
If |
ScreeningError
|
If no pixel survives the mask. |
Examples:
>>> import numpy as np
>>> from plumax.met import LocalFrame
>>> frame = LocalFrame.at(31.95, -102.15)
>>> lat, lon = frame.to_latlon(*np.meshgrid([0.0, 60.0], [0.0, 60.0]))
>>> observation = matched_filter_scene(
... np.full((2, 2), 0.01), 0.002, lat=lat, lon=lon, frame=frame
... )
>>> observation.enhancement.tolist() # M α̂ = 0.0160425 × 0.01
[0.000160425, 0.000160425, 0.000160425, 0.000160425]
Source code in src/plumax/obs/_src/plume_scene.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | |