Plume¶
Trace-gas retrieval post-processing for methane / CO₂ plumes — SBMP retrieval, detection masks, footprint vectorisation, integrated mass enhancement, and cross-sectional flux. Algorithm sources are cited in the operator docstrings (Varon et al., Frankenberg et al., Krings et al.).
- Retrieval:
SBMP(Sentinel-2 SWIR ratio, Varon 2021) - Detection / segmentation:
PlumeMask,PlumeContours,PlumeFootprint(polygons fromgeoreader.vectorize.get_polygons,measure.DEFAULT_REGIONPROPSmetadata in pixel units) - Instance QA:
PlumeShapeFilter(fiber-shape morphology gate),PlumeColumnStats(in-mask vs background statistics),PlumeQNDFeatures(quantile-normality-deviation features) - Quantification:
ColumnToMass,IMEEstimate,CrossSectionalFlux,WindAdvectionCone - Tier-A primitives:
plume_mask,convert_column_units,wind_advection_cone
Second carriers are positional call arguments on the primary carrier's pixel grid, never constructor
kwargs (see Multi-input operators):
IMEEstimate(wind_speed=3.5)(kg_m2, plume_mask), CrossSectionalFlux(...)(kg_m2, plume_mask),
PlumeFootprint()(mask, kg_m2), SBMP()(scene, reference_scene),
PlumeColumnStats()(labels, column), PlumeQNDFeatures()(labels, column, albedo).
geoops.plume
¶
Trace-gas plume detection, footprints, and emission estimators.
ColumnToMass
¶
Bases: Operator
Convert column enhancement units (ppm m / mol m^-2 / kg m^-2).
Thin wrapper over :func:convert_column_units. The ppm m conversion
assumes a standard molar volume (298.15 K, 1 atm); see that
function's docstring for the exact relation and caveats. Nodata
pixels (non-finite or equal to the fill value) are not converted:
they hold NaN and the output declares fill_value=NaN
(a converted column is a new quantity, so the input's fill -- e.g.
-9999 ppm m -- is not carried over).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gas
|
str
|
|
'CH4'
|
units_in
|
ColumnUnit
|
Units of the input carrier. |
'ppm_m'
|
units_out
|
ColumnUnit
|
Desired output units. |
'kg_m2'
|
Examples:
>>> kg_m2 = gz.plume.ColumnToMass(
... gas="CH4", units_in="ppm_m", units_out="kg_m2",
... )(enhancement)
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
CrossSectionalFlux
¶
Bases: Operator
Estimate cross-sectional flux at downwind transects.
For each transect at downwind distance :math:d_k, the operator
integrates column mass across the plume:
.. math::
Q_k \;=\; U \int_{-\infty}^{\infty}
\Omega(d_k, y) \, dy
\;\approx\; U \sum_{i \in \mathrm{strip}_k}
\Omega_i \,\Delta y_i
where :math:\mathrm{strip}_k is the set of plume pixels whose
along-wind distance to the source falls within half a pixel of
:math:d_k. This is the cross-section method of Krings et al. (2011)
and Varon et al. (2018, appendix); a flat downwind profile of
:math:Q_k versus :math:d_k confirms a steady-state estimate.
The enhancement carrier MUST be in kg/m^2 (see :class:ColumnToMass).
Nodata enhancement pixels (non-finite or equal to the fill value) add
nothing to a transect's flux.
The implementation assumes (approximately) square pixels: it uses
:math:\Delta y = \sqrt{\mathrm{pixel\_area}} as the across-wind
pixel size. For strongly anisotropic pixel grids, reproject first.
Geo-dependent: transect placement and pixel size come from the
carrier's transform and CRS, so the input must be a georeferenced
GeoArray (plain arrays raise TypeError) in a projected CRS
with metre units; a geographic CRS raises ValueError (reproject
with :class:geoops.geom.Reproject first).
Called as op(enhancement, plume_mask): plume_mask is a boolean
plume carrier on the enhancement's pixel grid (ValueError
otherwise).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
tuple[float, float]
|
|
required |
wind_u
|
float
|
Eastward wind component (m/s). |
required |
wind_v
|
float
|
Northward wind component (m/s). |
required |
n_transects
|
int
|
Number of downwind transects to evaluate. |
5
|
transect_spacing_m
|
float
|
Along-wind distance between transects (m). |
100.0
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
One row per transect: |
Examples:
Evaluate fluxes at 100 m, 200 m, 300 m downwind::
gdf = gz.plume.CrossSectionalFlux(
source=(x0, y0),
wind_u=3.0, wind_v=1.0,
n_transects=3, transect_spacing_m=100.0,
)(kg_m2, mask)
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 | |
IMEEstimate
¶
Bases: Operator
Integrated Mass Enhancement (IME) flux estimator.
Implements the IME method of Varon et al. (2018), AMT Quantifying methane point sources from fine-scale satellite observations of atmospheric methane plumes:
.. math::
\mathrm{IME} \;=\; \sum_{i \in \mathrm{plume}}
\Omega_i \,\Delta A_i, \qquad
Q \;=\; \frac{U_{\mathrm{eff}}\,\mathrm{IME}}{L}
where :math:\Omega_i is the column enhancement (kg/m^2) of pixel
:math:i, :math:\Delta A_i is its area (m^2), :math:L is the
effective plume length (m) — see :func:plume_length — and
:math:U_{\mathrm{eff}} is the effective wind speed (m/s). Varon
et al. (2018) calibrate :math:U_{\mathrm{eff}} against LES
simulations; this operator takes the calibrated value as
wind_speed.
The enhancement carrier MUST be in kg/m^2. Use
:class:ColumnToMass upstream to convert from ppm m or mol/m^2:
passing other units silently produces nonsense. Nodata enhancement
pixels (non-finite or equal to the fill value) add nothing to the IME.
Geo-dependent: pixel area (m^2) and plume length (m) are derived from
the carrier's transform, so the input must be a georeferenced
GeoArray (plain arrays raise TypeError) in a projected CRS
with metre units; a geographic CRS raises ValueError (reproject
with :class:geoops.geom.Reproject first).
Called as op(enhancement, plume_mask): plume_mask is a boolean
carrier selecting plume pixels on the enhancement's pixel grid (same
shape, transform and CRS; ValueError otherwise -- a mask on another
grid would be indexed against the wrong pixels).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wind_speed
|
float
|
Effective wind speed :math: |
required |
length_method
|
Literal['max_axis', 'convex_hull', 'skeleton']
|
Length estimator: |
'max_axis'
|
pixel_area_m2
|
float | None
|
Override the pixel area (m^2); default is the absolute input transform determinant in the projected CRS's metres (exact on an equal-area projection; on UTM it ignores the projection's scale factor, a < 0.1 % error near the central meridian). |
None
|
return_uncertainty
|
bool
|
Append |
True
|
uncertainty_fraction
|
float
|
Fractional 1-sigma uncertainty on Q. The default 0.5 follows Varon et al. (2018) Table 3. |
0.5
|
Returns:
| Type | Description |
|---|---|
dict
|
Result with keys |
Examples:
Estimate Q in kg/s from a ppm m enhancement map::
import geoops as gz
kg_m2 = gz.plume.ColumnToMass(units_in="ppm_m")(enhancement)
mask = gz.plume.PlumeMask(threshold="percentile:99")(kg_m2)
result = gz.plume.IMEEstimate(
wind_speed=3.5,
length_method="convex_hull",
)(kg_m2, mask)
print(result["emission_rate_kg_s"])
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | |
PlumeColumnStats
¶
Bases: Operator
Per-instance in-mask vs background statistics of a column field.
Adapted from Pérez Carrasco et al. (2026), rfc_utils.xch4_metrics.
For every non-zero label in the input map, returns a row with the
in-mask mean, the out-of-mask (background) mean / std, and three
derived metrics used by the paper's Random-Forest false-plume
classifier:
contrast=mean_plume / mean_backgroundz_score=(mean_plume - mean_background) / std_backgroundintensity_per_area=(sum_plume - mean_background * n_plume) / n_plume
Nodata column pixels (non-finite or equal to the column carrier's fill value) are left out of every statistic.
Called as op(labels, column): column is the column field
(single-band GeoArray or plain array) on the label map's pixel
grid (ValueError otherwise).
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 | |
PlumeContours
¶
Bases: Operator
Connected-component labelling of a plume mask.
Returns either an int32 label image (default) or a boolean mask of
the retained components. Component size threshold and connectivity
follow :func:label_components.
Nodata pixels (non-finite -- e.g. a NaN score -- or equal to the
input's fill value) are never part of a contour. In the boolean
output they are False (fill_value=False). In the
label image they hold the input's fill value when it is a
non-positive int32 value (e.g. -9999, so it cannot collide with
a label); otherwise (NaN, no fill, or a
positive fill) they are 0 (background), and a GeoArray output
then carries fill_value=0.
Examples:
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
PlumeFootprint
¶
Bases: Operator
Vectorize a plume mask into polygons with per-plume metadata.
The region properties come from the same machinery as
:class:geoops.measure.RegionProps (defaults to
:data:geoops.measure.DEFAULT_REGIONPROPS, pixel units) and the
polygons from :func:georeader.vectorize.get_polygons. Returns a
GeoDataFrame with one row per surviving plume: geometry, area_m2,
centroid,
mean_enhancement / max_enhancement (if enhancement is
supplied), n_pixels, label_id, and skimage region properties such as
major_axis_length, orientation, eccentricity, solidity,
perimeter, bbox-*, and inertia_tensor_eigvals-*.
Nodata pixels of a boolean mask never form a polygon, non-positive
labels are background, and nodata enhancement pixels are ignored
by the per-polygon statistics.
Geo-dependent: polygonisation needs the carrier's transform and CRS,
so the input must be a georeferenced GeoArray (plain arrays
raise TypeError). Areas are in m^2 and the simplify tolerance in
m, so the CRS must be projected with metre units; a geographic CRS
raises ValueError (reproject with :class:geoops.geom.Reproject
first).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_area_m2
|
float
|
Drop polygons smaller than this area (m^2). |
500.0
|
simplify_tolerance
|
float | None
|
Douglas-Peucker tolerance (m) for polygon
simplification; |
15.0
|
properties
|
Sequence[str] | None
|
Region properties forwarded to |
None
|
extra_properties
|
Sequence[Callable[..., Any]] | None
|
User-defined |
None
|
Called as op(mask, enhancement=None). The optional enhancement
carrier must sit on the mask's pixel grid (ValueError otherwise);
it enables the mean_enhancement / max_enhancement statistics
per polygon.
Examples:
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
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 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 | |
PlumeMask
¶
Bases: Operator
Binary plume mask from a single-band score or enhancement map.
Thresholds the input (absolute number, Otsu, or percentile) and
drops connected components smaller than min_area_px pixels — the
Frankenberg et al. (2016) detection convention, also used by Varon
et al. (2018, 2021) for S2/AVIRIS plume identification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
ThresholdMode
|
|
'otsu'
|
min_area_px
|
int
|
Minimum component size in pixels. |
50
|
connectivity
|
Connectivity
|
4 or 8 connectivity for component labelling. |
8
|
nbins
|
int
|
Histogram bins for the |
256
|
Nodata pixels (non-finite or equal to the input's fill value) are
excluded from the Otsu / percentile threshold and are always
False in the mask, which declares fill_value=False.
Examples:
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
PlumeQNDFeatures
¶
Bases: Operator
Per-instance Quantile-Normality-Deviation features for plume QA.
Adapted from Pérez Carrasco et al. (2026) — the feature pipeline that
feeds the Random-Forest false-plume classifier
(rfc_utils.get_QND_df_cms / get_plume_info). For each non-zero
label in the input map this operator emits one row containing:
qnd_column_*— polynomial coefficients of the Kolmogorov-Smirnov distance between the in-mask CDF of the column field and a Gaussian fit to the full scene's column distribution, sampled across 100 percentiles in[0.01, 0.99].qnd_albedo_*— same construction over the optional albedo field.n_clumps— DBSCAN cluster count of in-mask pixels above theperc_thresholdpercentile (per the paper's clump-count signal).contrast/z_score/intensity_per_area— the same stats that :class:PlumeColumnStatsemits, included so a single call assembles the full feature vector used by the paper.
Nodata column / albedo pixels (non-finite or equal to the carrier's fill value) are left out of every feature.
Called as op(labels, column, albedo=None): column is the
column-enhancement carrier and albedo an optional albedo carrier,
both on the label map's pixel grid (ValueError otherwise). Without
albedo the qnd_albedo_* coefficients are NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
degree
|
int
|
Degree of the QND polynomial (paper default: 6). |
6
|
eps
|
float
|
DBSCAN |
50.0
|
min_samples
|
int
|
DBSCAN |
50
|
perc_threshold
|
float
|
Percentile (within the instance mask) above which pixels are eligible for clustering. |
98.0
|
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 | |
PlumeShapeFilter
¶
Bases: Operator
Drop instance labels that fail a fiber-shape morphology gate.
Adapted from Pérez Carrasco et al. (2026), physical_constraints.
apply_physical_constraints — a post-Mask R-CNN gate that distinguishes
elongated plume features from compact false positives. Per instance:
area = mask.sum(); drop when belowmin_area_px.fiber_length= longest Euclidean path through the skeleton, in pixel widths (diagonal steps countsqrt(2); see :func:geoops.measure.skeleton_length).major_axis=regionprops.axis_major_length— the PCA-based major axis of the equivalent ellipse. The original paper usescv2.minAreaRect(rotated minimum-area rectangle), avoided here to keep the optional-dependency surface unchanged; the two measures agree closely for typical plume morphologies.fiber_width = area / fiber_length.- Keep iff
min_fiber_to_major_ratio <= fiber_length / major_axis <= max_fiber_to_major_ratioANDmin_fiber_width <= fiber_width <= max_fiber_width.
Surviving instances keep their original integer labels; rejected
instances are mapped to background (0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_area_px
|
int
|
Minimum pixel count to consider an instance. |
50
|
min_fiber_to_major_ratio
|
float
|
Lower bound on |
1.0
|
max_fiber_to_major_ratio
|
float
|
Upper bound on |
10.0
|
min_fiber_width
|
float
|
Lower bound on |
1.0
|
max_fiber_width
|
float
|
Upper bound on |
100.0
|
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 | |
SBMP
¶
Bases: Operator
Single-band multi-pass Sentinel-2 SWIR ratio retrieval.
Emits a unitless methane "enhancement score" that highlights pixels where SWIR-2 (B12, ~2200 nm — a strong CH4 absorption window) is depressed relative to SWIR-1 (B11, ~1600 nm — weakly absorbing).
With a second positional carrier, the reference_scene (a clean-air
acquisition over the same geography and pixel grid), the operator
computes the log-ratio change
.. math::
\Delta \;=\; \log\!\Bigl(\tfrac{\rho_{B11} + \varepsilon}
{\rho_{B12} + \varepsilon}\Bigr)
- \log\!\Bigl(\tfrac{\rho^{ref}_{B11} + \varepsilon}
{\rho^{ref}_{B12} + \varepsilon}\Bigr)
following Varon et al. (2021) — Satellite discovery of anomalously
large methane point sources from oil/gas production (RSE, 251). The
reference-scene formulation cancels static surface signatures so
plume pixels dominate :math:\Delta.
Without a reference scene the operator falls back to the same-scene
normalized SWIR contrast
(SWIR1 - SWIR2) / (SWIR1 + SWIR2 + eps), which is a cheap
detection prefilter (Ehret et al., 2022, TGRS) but is not a
quantitative column retrieval — pair it with ColumnToMass only
when calibrated against a per-scene ppm m mapping.
Inputs are radiance or reflectance arrays with band axis axis;
negative values are clipped to zero before the log to keep the
operator finite over noisy radiances. The output is single-band;
nodata pixels (non-finite or equal to the fill value in any band of
the input or the reference scene) hold NaN, and a GeoArray
output declares fill_value=NaN.
Band names are resolved with the package-wide resolver
(:func:geoops._src.bands.resolve_band: attrs band_names,
then descriptions, then bands), so a GeoArray must name its
bands. Only a plain ndarray with exactly 12 bands falls back to the
Sentinel-2 L2A order (B1-B8, B8A, B9, B11,
B12; no B10); on any other unnamed input pass integer indices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swir1
|
BandRef
|
Index or band name of the SWIR-1 channel. Default |
'B11'
|
swir2
|
BandRef
|
Index or band name of the SWIR-2 channel. Default |
'B12'
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Numerical guard against division by zero. Default |
1e-10
|
Called as op(scene, reference_scene=None). The optional
reference_scene is a clean-air GeoArray or plain array on the
scene's pixel grid (ValueError otherwise) with the same band
layout; a GeoArray reference resolves the band names against its own
attrs, a plain array uses the scene's band positions. When
supplied, the output is the log-ratio change.
Examples:
Reference-scene retrieval over a single source::
import geoops as gz
score = gz.plume.SBMP()(post_event_s2, pre_event_s2)
mask = gz.plume.PlumeMask(threshold="percentile:99.5")(score)
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
117 118 119 120 121 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 | |
WindAdvectionCone
¶
Bases: Operator
Mask likely downwind plume extent from a source and wind vector.
Rasterizes a circular sector centered at source, oriented along
(wind_u, wind_v), with half-angle half_angle_deg and radius
max_distance. The mask is useful as a prior for plume
segmentation when the source location and wind are known (e.g. from
a reanalysis product), following the practice of Varon et al. (2018,
2021).
Geo-dependent: the cone is rasterised in CRS coordinates via the
carrier's transform, so the input must be a georeferenced
GeoArray (plain arrays raise TypeError). max_distance is
in metres and the cone angle is measured in the map plane, so the
carrier CRS must be projected with metre units; a geographic CRS
raises ValueError (reproject with :class:geoops.geom.Reproject
first).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
tuple[float, float]
|
|
required |
wind_u
|
float
|
Eastward wind component (m/s). |
required |
wind_v
|
float
|
Northward wind component (m/s). |
required |
half_angle_deg
|
float
|
Half-angle of the cone in degrees, in [0, 180];
|
30.0
|
max_distance
|
float
|
Radius of the cone (m). |
5000.0
|
crs
|
str | None
|
Optional CRS of |
None
|
Examples:
>>> cone = gz.plume.WindAdvectionCone(
... source=(x0, y0), wind_u=3.0, wind_v=1.0,
... half_angle_deg=30.0, max_distance=5000.0,
... )(enhancement)
Source code in packages/geotoolz-ops/src/geoops/plume/_src/operators.py
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | |
convert_column_units(values, *, gas='CH4', units_in='ppm_m', units_out='kg_m2', pressure_pa=STANDARD.standard_pressure, temperature_k=_NEAR_SURFACE_TEMPERATURE_K)
¶
Convert column enhancement among ppm m, mol/m^2, and kg/m^2.
The conversions are
.. math::
\Omega_{\mathrm{mol/m^2}} \;=\; \frac{X \cdot 10^{-6}}{V_m}, \qquad
\Omega_{\mathrm{kg/m^2}} \;=\; M_{\mathrm{gas}}
\cdot \Omega_{\mathrm{mol/m^2}}
where X is the column-integrated volume mixing ratio in ppm m,
:math:V_m = R T / p is the molar volume of an ideal gas at pressure
pressure_pa and temperature temperature_k (1 atm and 298.15 K by
default, :math:V_m \approx 0.024465 m^3/mol), and
:math:M_{\mathrm{gas}} is the molar mass (CH4: 0.0160425 kg/mol; CO2:
0.0440095 kg/mol). The maths is geophysix.columns.convert.
The ppm m branch therefore assumes near-surface conditions unless you
pass the air's pressure and temperature. Pass mol_m2 or kg_m2
inputs when retrieval-specific pressure and temperature corrections have
already been applied upstream (e.g. by a matched-filter retrieval per
Thompson 2015 / Foote 2020).
Source code in packages/geotoolz-ops/src/geoops/plume/_src/array.py
plume_mask(values, *, threshold='otsu', min_area_px=50, connectivity=8, nbins=256)
¶
Threshold an enhancement map and remove small connected components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
Num[ndarray, 'h w'] | Num[ndarray, '1 h w']
|
Single-band enhancement map, |
required |
threshold
|
ThresholdMode
|
Absolute number, |
'otsu'
|
min_area_px
|
int
|
Minimum connected-component size in pixels. |
50
|
connectivity
|
Connectivity
|
4 or 8 connectivity for component labelling. |
8
|
nbins
|
int
|
Histogram bins for the |
256
|
Returns:
| Type | Description |
|---|---|
Bool[ndarray, 'h w']
|
Boolean |
Source code in packages/geotoolz-ops/src/geoops/plume/_src/array.py
wind_advection_cone(shape, transform, *, source, wind_u, wind_v, half_angle_deg=30.0, max_distance=5000.0)
¶
Rasterize an analytical downwind sector mask.
Marks pixels whose center lies within max_distance of source
and whose bearing from the source is within half_angle_deg of the
wind direction (wind_u, wind_v) — a geometric prior for where an
advected plume can be. The source pixel itself is included.
With d = (x − x₀, y − y₀) the offset of a pixel center from the
source and ŵ = (u, v) / ‖(u, v)‖ the unit wind vector, a pixel is
inside when
‖d‖ ≤ max_distance and d·ŵ ≥ ‖d‖ · cos(half_angle_deg)
i.e. the angle between d and ŵ is at most half_angle_deg.
For half_angle_deg ≤ 90 the angle test alone keeps the sector in
the downwind half-plane (cos ≥ 0 ⇒ d·ŵ ≥ 0); half_angle_deg > 90
widens it past the crosswind line, and half_angle_deg = 180 is the
full disc of radius max_distance, upwind pixels included.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple[int, int]
|
Raster shape |
required |
transform
|
Any
|
Affine-like geotransform of the raster; its CRS units
must match |
required |
source
|
tuple[float, float]
|
|
required |
wind_u
|
float
|
Eastward wind component. |
required |
wind_v
|
float
|
Northward wind component. |
required |
half_angle_deg
|
float
|
Half-angle of the sector in degrees, in [0, 180]. |
30.0
|
max_distance
|
float
|
Sector radius in CRS units. |
5000.0
|
Returns:
| Type | Description |
|---|---|
Bool[ndarray, 'h w']
|
Boolean |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the wind vector is zero, |