Indices¶
Spectral indices for vegetation, water, fire, urban, and mineral mapping. Each operator accepts band
identifiers as either integer axis indices or string band names (resolved against
attrs under band_names, then descriptions, then bands — see
Band names).
- Vegetation:
NDVI,EVI,EVI2,SAVI,GCI,kNDVI,ARVI - Water:
NDWI,MNDWI,NDMI - Fire / burn:
NBR,NBR2,dNBR - Snow / urban:
NDSI,NDBI,BSI,CIRI - Burned area (S2):
BAIS2 - Minerals:
ClayMinerals,IronOxide - Custom:
NormalizedDifference,AppendIndex - Tier-A primitives (integer
*_idxband positions):normalized_difference,ndvi,evi,evi2,savi,gci,kndvi,arvi,ndwi_mcfeeters,mndwi,ndmi,nbr,nbr2,ndsi,ndbi,bsi,ciri,bais2,clay_minerals,iron_oxide
geoops.indices
¶
Spectral indices for remote sensing.
The classics — NDVI, NDWI, NDBI, NBR, SAVI, EVI — plus the generic
NormalizedDifference they all specialise, and AppendIndex for
stacking an index back as a new channel of the carrier.
Each Operator runs an element-wise kernel from
:mod:geoops.indices._src.array through pipekit-array's KernelOp,
so the same operator works on a NumPy or JAX GeoArray (under
jax.jit too), on a lazy dask-backed xr.DataArray and on a plain
array. Users who want the maths without a carrier call the kernels
directly, one array per band. The Operators round-trip get_config()
for Hydra-zen builds().
Examples:
Eager mode::
import geoops as gz
ndvi = gz.indices.NDVI(nir=7, red=3) # S2 band order
v = ndvi(reflectance_geoarray) # GeoArray (H, W)
Composition::
pipeline = (
gz.radiometry.DNToReflectance(scale=1e-4)
| gz.indices.NDVI(nir=7, red=3)
)
v = pipeline(dn_geoarray)
The same operator on a lazy cube and under jax.jit::
cube = xr.open_zarr(store)["reflectance"] # (time, band, y, x), dask
ndvi = gz.indices.NDVI(nir="B8", red="B4")(cube) # lazy (time, y, x)
step = jax.jit(gz.indices.NDVI(nir=7, red=3))
v = step(reflectance_geoarray.to_jax()) # GeoArray (H, W), JAX
Stack the index back as an extra channel::
op = gz.indices.AppendIndex(index_op=gz.indices.NDVI())
stacked = op(reflectance_geoarray) # shape (C+1, H, W)
ARVI
¶
Bases: Operator
Atmospherically Resistant Vegetation Index — Kaufman & Tanre 1992.
.. math::
\mathrm{ARVI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{rb}}
{\rho_{\mathrm{NIR}} + \rho_{rb} + \varepsilon}
\quad\text{where}\quad
\rho_{rb} = \rho_{\mathrm{Red}} - \gamma\,(\rho_{\mathrm{Blue}}
- \rho_{\mathrm{Red}})
Extends NDVI with a Blue-band correction (rb) that cancels the
aerosol-driven inflation of the red signal. gamma=1 is the
standard value derived from MODIS Rayleigh-scattering simulations.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blue
|
BandRef
|
Blue band: an integer position or a band name. Default |
0
|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
gamma
|
float
|
Aerosol-correction strength. Default |
1.0
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import ARVI
>>> # Sentinel-2: B02=Blue (1), B04=Red (3), B08=NIR (7).
>>> arvi_op = ARVI(blue=1, red=3, nir=7)
>>> v = arvi_op(toa_reflectance_geoarray)
References
Kaufman, Y. J., & Tanre, D. (1992). "Atmospherically resistant vegetation index (ARVI) for EOS-MODIS." IEEE Trans. Geosci. Remote Sens., 30(2), 261–270.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
AppendIndex
¶
Bases: Operator
Run an index operator and concatenate its output back as a new band.
Most index operators collapse the band axis: NDVI of a (C, H, W)
carrier returns (H, W). AppendIndex runs the wrapped operator,
expands the result to (1, H, W), and concatenates it back onto
the original carrier along the band axis — so the output has shape
(C+1, H, W) with the index sitting as the last channel.
Nodata pixels come out of index_op holding the fill value; the
original bands are passed through unchanged.
Useful when the index is a feature for a downstream model that expects a fixed multi-channel input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_op
|
Operator
|
An index operator (e.g. |
required |
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
Examples:
>>> from geoops.indices import AppendIndex, NDVI
>>> bands_plus_ndvi = AppendIndex(index_op=NDVI(nir=3, red=2))
>>> stacked = bands_plus_ndvi(reflectance_geoarray) # (C+1, H, W)
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | |
BAIS2
¶
Bases: Operator
Burned Area Index for Sentinel-2 — Filipponi 2018.
.. math::
\mathrm{BAIS2} \;=\;
\Bigl(1 - \sqrt{\tfrac{\rho_{6}\,\rho_{7}\,\rho_{8\mathrm{A}}}
{\rho_{4}}}\Bigr)
\cdot
\Bigl(\tfrac{\rho_{12} - \rho_{8\mathrm{A}}}
{\sqrt{\rho_{12} + \rho_{8\mathrm{A}}}} + 1\Bigr)
Filipponi designed BAIS2 to maximise contrast between recently burned and unburned land using the rich red-edge sampling available on Sentinel-2 (B05/B06/B07) plus the narrow-NIR (B8A) and SWIR-2 (B12). The first factor exploits the post-fire collapse of red-edge reflectance; the second factor uses the SWIR-2/narrowNIR shift characteristic of charred surfaces.
Defaults assume a Sentinel-2 stack ordered as
B02, B03, B04, B05, B06, B07, B08, B8A, B11, B12 (10 bands,
skipping the cirrus/aerosol bands). For different stacking
conventions, pass explicit indices or named bands.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
red_edge1
|
BandRef
|
first red-edge band: an integer position or a band name. Default |
4
|
red_edge2
|
BandRef
|
second red-edge band: an integer position or a band name. Default |
5
|
nir
|
BandRef
|
narrow-NIR band: an integer position or a band name. Default |
7
|
swir2
|
BandRef
|
SWIR-2 band: an integer position or a band name. Default |
9
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import BAIS2
>>> bais2_op = BAIS2() # S2-stack default ordering
>>> burn_score = bais2_op(reflectance_geoarray)
References
Filipponi, F. (2018). "BAIS2: Burned Area Index for Sentinel-2." Proceedings, 2(7), 364.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 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 | |
BSI
¶
Bases: Operator
Bare Soil Index — Rikimaru et al. 2002.
.. math::
\mathrm{BSI} \;=\;
\frac{(\rho_{\mathrm{SWIR1}} + \rho_{\mathrm{Red}}) -
(\rho_{\mathrm{NIR}} + \rho_{\mathrm{Blue}})}
{(\rho_{\mathrm{SWIR1}} + \rho_{\mathrm{Red}}) +
(\rho_{\mathrm{NIR}} + \rho_{\mathrm{Blue}}) + \varepsilon}
Highlights exposed soil by combining the soil-bright (SWIR1+Red) and soil-dark (NIR+Blue) shoulders. Positive over dry soil, near zero over mixed vegetation/soil, negative over dense canopy. The Rikimaru variant is the most widely cited; other "BSI" variants in the literature exist — pick deliberately if comparing studies.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blue
|
BandRef
|
Blue band: an integer position or a band name. Default |
0
|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
swir
|
BandRef
|
SWIR-1 band: an integer position or a band name. Default |
5
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import BSI
>>> # Sentinel-2: B2=Blue, B4=Red, B8=NIR, B11=SWIR1.
>>> bsi_op = BSI(blue=1, red=3, nir=7, swir=10)
>>> v = bsi_op(reflectance_geoarray)
References
Rikimaru, A., Roy, P. S., & Miyatake, S. (2002). "Tropical forest cover density mapping." Tropical Ecology, 43(1), 39–47.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 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 | |
CIRI
¶
Bases: Operator
Cirrus Reflectance Index — Sentinel-2 B10 passthrough.
.. math::
\mathrm{CIRI} \;=\; \rho_{\mathrm{cirrus}}
The Sentinel-2 B10 cirrus channel (1.36–1.39 µm) sits inside a
strong water-vapour absorption window: at sea level virtually no
surface signal reaches the sensor, so any non-trivial reflectance
is high-altitude (cirrus) cloud. A simple threshold on B10
therefore yields an effective cirrus mask — popular for the
s2cloudless and Fmask cirrus screens.
The default cirrus=9 matches Sentinel-2 B10 in a stack
ordered by band number as
B01, B02, B03, B04, B05, B06, B07, B08, B8A, B10, B11, B12.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cirrus
|
BandRef
|
cirrus band: an integer position or a band name. Default |
9
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
Examples:
>>> from geoops.indices import CIRI
>>> ciri_op = CIRI() # defaults to S2 B10
>>> cirrus_score = ciri_op(reflectance_geoarray)
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
ClayMinerals
¶
Bases: Operator
Clay Minerals ratio — Sabins 1999 / Crowley et al. 1989.
.. math::
\mathrm{ClayMinerals} \;=\; \frac{\rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{SWIR2}} + \varepsilon}
OH-bearing minerals (kaolinite, montmorillonite, illite, alunite) have a diagnostic 2.2 µm absorption feature that sits inside SWIR-2 while SWIR-1 (~1.6 µm) lies in a relative reflectance high. Their SWIR1/SWIR2 ratio is therefore well above unity over clay-rich exposures and near unity elsewhere.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swir1
|
BandRef
|
SWIR-1 band: an integer position or a band name. Default |
5
|
swir2
|
BandRef
|
SWIR-2 band: an integer position or a band name. Default |
6
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import ClayMinerals
>>> clay_op = ClayMinerals(swir1=10, swir2=11) # S2 B11/B12
>>> v = clay_op(reflectance_geoarray)
References
Crowley, J. K., Brickey, D. W., & Rowan, L. C. (1989). "Airborne imaging spectrometer data of the Ruby Mountains, Montana: mineral discrimination using relative absorption band-depth images." Remote Sensing of Environment, 29(2), 121–134.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
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 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 | |
EVI
¶
Bases: Operator
Enhanced Vegetation Index — Huete et al. 2002.
.. math::
\mathrm{EVI} \;=\; G \cdot \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + C_1 \rho_{\mathrm{Red}} - C_2 \rho_{\mathrm{Blue}} + L}
Designed for MODIS to address NDVI saturation in dense canopies and atmospheric-aerosol bias in the red band. The Blue-band correction cancels Rayleigh-scattering noise; the L-term decouples canopy background.
Standard MODIS / S2 / L8 coefficients: G=2.5, C1=6, C2=7.5, L=1.
See :func:~geoops.indices._src.array.evi for physics.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
blue
|
BandRef
|
Blue band: an integer position or a band name. Default |
0
|
G
|
float
|
Gain factor. Default |
2.5
|
C1
|
float
|
Red aerosol-resistance coefficient. Default |
6.0
|
C2
|
float
|
Blue aerosol-resistance coefficient. Default |
7.5
|
L
|
float
|
Canopy-background correction. Default |
1.0
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
Examples:
>>> from geoops.indices import EVI
>>> # Sentinel-2: B2=Blue, B4=Red, B8=NIR.
>>> evi_op = EVI(nir=7, red=3, blue=1)
>>> v = evi_op(boa_reflectance_geoarray)
>>>
>>> # EVI assumes surface reflectance (BOA). Apply atmospheric
>>> # correction first for cross-scene comparability.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
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 | |
EVI2
¶
Bases: Operator
Two-band Enhanced Vegetation Index — Jiang et al. 2008.
.. math::
\mathrm{EVI2} \;=\; 2.5 \cdot
\frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + 2.4\,\rho_{\mathrm{Red}} + 1}
Drops EVI's Blue-band aerosol-resistance term so the index can be
computed when Blue is unavailable or noisy (e.g. AVHRR, sensors
with poor blue calibration). The fixed coefficients 2.4 and
1 are tuned to track EVI within a few percent on most cover
types. See :func:~geoops.indices._src.array.evi2 for physics.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import EVI2
>>> evi2_op = EVI2(nir=7, red=3) # S2 band order
>>> v = evi2_op(reflectance_geoarray)
References
Jiang, Z., Huete, A. R., Didan, K., & Miura, T. (2008). "Development of a two-band enhanced vegetation index without a blue band." Remote Sensing of Environment, 112(10), 3833–3845.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
GCI
¶
Bases: Operator
Green Chlorophyll Index — Gitelson et al. 2003.
.. math::
\mathrm{GCI} \;=\; \frac{\rho_{\mathrm{NIR}}}
{\rho_{\mathrm{Green}} + \varepsilon} - 1
Linearly proportional to canopy chlorophyll content over a broader dynamic range than NDVI. Saturates much later — useful for dense crops and forests where NDVI plateaus.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
green
|
BandRef
|
Green band: an integer position or a band name. Default |
1
|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import GCI
>>> gci_op = GCI(green=2, nir=7) # S2 band order
>>> v = gci_op(reflectance_geoarray)
References
Gitelson, A. A., Vina, A., Arkebauer, T. J., Rundquist, D. C., Keydan, G., & Leavitt, B. (2003). "Remote estimation of leaf area index and green leaf biomass in maize canopies." Geophys. Res. Lett., 30(5).
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
IronOxide
¶
Bases: Operator
Iron Oxide ratio — Segal 1982 / Sabins 1999.
.. math::
\mathrm{IronOxide} \;=\; \frac{\rho_{\mathrm{Red}}}
{\rho_{\mathrm{Blue}} + \varepsilon}
A simple ferric-iron mineral discriminator: hematite, goethite, and other Fe(III) oxides absorb strongly in the blue and reflect in the red, giving Red/Blue ratios well above unity over iron-oxide-rich soils, weathered surfaces, and lateritic crusts.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
blue
|
BandRef
|
Blue band: an integer position or a band name. Default |
0
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import IronOxide
>>> # Sentinel-2: B2=Blue (1), B4=Red (3).
>>> iron_op = IronOxide(red=3, blue=1)
>>> v = iron_op(reflectance_geoarray)
References
Sabins, F. F. (1999). "Remote sensing for mineral exploration." Ore Geology Reviews, 14(3-4), 157–183.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
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 | |
MNDWI
¶
Bases: Operator
Modified Normalized Difference Water Index — Xu 2006.
.. math::
\mathrm{MNDWI} \;=\; \frac{\rho_{\mathrm{Green}} - \rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{Green}} + \rho_{\mathrm{SWIR1}}
+ \varepsilon}
Replaces NDWI's NIR with SWIR-1, which is far more strongly absorbed by water and far more reflective over built-up land. The result is sharper water/non-water contrast and reduced confusion with urban surfaces. Same arithmetic form as NDSI — the Green/SWIR1 ratio happens to separate snow from rock just as it separates water from soil, so the two indices share a formula but are interpreted differently.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
green
|
BandRef
|
Green band: an integer position or a band name. Default |
1
|
swir
|
BandRef
|
SWIR-1 band: an integer position or a band name. Default |
5
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import MNDWI
>>> mndwi_op = MNDWI(green=2, swir=10) # S2 B3, B11
>>> v = mndwi_op(reflectance_geoarray)
References
Xu, H. (2006). "Modification of normalised difference water index (NDWI) to enhance open water features in remotely sensed imagery." International Journal of Remote Sensing, 27(14), 3025–3033.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
NBR
¶
Bases: Operator
Normalized Burn Ratio — Key & Benson 2006.
.. math::
\mathrm{NBR} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{SWIR2}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{SWIR2}} + \varepsilon}
High over healthy vegetation, low / negative over recently-burned
surfaces. dNBR (pre - post) is the standard burn-severity
quantitative measure. See
:func:~geoops.indices._src.array.nbr for physics.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
swir2
|
BandRef
|
SWIR-2 band: an integer position or a band name. Default |
6
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. |
1e-10
|
Examples:
>>> from geoops.indices import NBR
>>> import numpy as np
>>> nbr_op = NBR(nir=7, swir2=11) # Sentinel-2 B8, B12
>>>
>>> # dNBR — burn severity from pre- vs post-fire scenes.
>>> dnbr = np.asarray(nbr_op(pre_fire_geoarray)) - np.asarray(
... nbr_op(post_fire_geoarray)
... )
>>> # Key & Benson thresholds: > 0.66 high severity, 0.27-0.44 low.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
NBR2
¶
Bases: Operator
Normalized Burn Ratio 2 — USGS Landsat product.
.. math::
\mathrm{NBR2} \;=\; \frac{\rho_{\mathrm{SWIR1}} - \rho_{\mathrm{SWIR2}}}
{\rho_{\mathrm{SWIR1}} + \rho_{\mathrm{SWIR2}}
+ \varepsilon}
Complements NBR by sharpening sensitivity to burned-area moisture differences in the SWIR window. Published by USGS alongside NBR as part of the Landsat Analysis-Ready burn-severity stack.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swir1
|
BandRef
|
SWIR-1 band: an integer position or a band name. Default |
5
|
swir2
|
BandRef
|
SWIR-2 band: an integer position or a band name. Default |
6
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import NBR2
>>> nbr2_op = NBR2(swir1=10, swir2=11) # S2 B11, B12
>>> v = nbr2_op(reflectance_geoarray)
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
NDBI
¶
Bases: Operator
Normalized Difference Built-up Index — Zha et al. 2003.
.. math::
\mathrm{NDBI} \;=\; \frac{\rho_{\mathrm{SWIR}} - \rho_{\mathrm{NIR}}}
{\rho_{\mathrm{SWIR}} + \rho_{\mathrm{NIR}} + \varepsilon}
High over impervious surfaces (concrete, asphalt). Pair with NDVI
as NDBI - NDVI to suppress bare-soil confounders. See
:func:~geoops.indices._src.array.ndbi for physics.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swir
|
BandRef
|
SWIR-1 band: an integer position or a band name. Default |
5
|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. |
1e-10
|
Examples:
>>> from geoops.indices import NDBI, NDVI
>>> ndbi_op = NDBI(swir=10, nir=7) # Sentinel-2 B11, B8
>>> built_up_raw = ndbi_op(reflectance_geoarray)
>>>
>>> # Zha's recipe: subtract NDVI to suppress soil confounders.
>>> import numpy as np
>>> ndvi_op = NDVI(nir=7, red=3)
>>> built_up = np.asarray(ndbi_op(reflectance_geoarray)) - np.asarray(
... ndvi_op(reflectance_geoarray)
... )
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
NDMI
¶
Bases: Operator
Normalized Difference Moisture Index — Gao 1996.
.. math::
\mathrm{NDMI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{SWIR1}}
+ \varepsilon}
Tracks vegetation liquid-water content, not surface water — high
over moist canopies, low over water-stressed or dry vegetation.
Sometimes also called "Gao's NDWI"; we use NDMI here to keep
the McFeeters surface-water NDWI distinct.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
swir1
|
BandRef
|
SWIR-1 band: an integer position or a band name. Default |
5
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import NDMI
>>> ndmi_op = NDMI(nir=7, swir1=10) # S2 B8, B11
>>> v = ndmi_op(reflectance_geoarray)
References
Gao, B. C. (1996). "NDWI - A normalized difference water index for remote sensing of vegetation liquid water from space." Remote Sensing of Environment, 58(3), 257–266.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
NDSI
¶
Bases: Operator
Normalized Difference Snow Index — Hall et al. 1995.
.. math::
\mathrm{NDSI} \;=\; \frac{\rho_{\mathrm{Green}} - \rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{Green}} + \rho_{\mathrm{SWIR1}}
+ \varepsilon}
Snow is highly reflective in visible green but strongly absorbs in SWIR-1 (~1.6 µm); the Green/SWIR1 ratio therefore lights up snow and ice while suppressing clouds, which are bright in both. NDSI > 0.4 is the MODIS / Sentinel-2 default snow threshold. Shares the arithmetic form of MNDWI — same formula, different physics target.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
green
|
BandRef
|
Green band: an integer position or a band name. Default |
1
|
swir
|
BandRef
|
SWIR-1 band: an integer position or a band name. Default |
5
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import NDSI
>>> ndsi_op = NDSI(green=2, swir=10) # S2 B3, B11
>>> snow_mask = (ndsi_op(reflectance_geoarray) > 0.4)
References
Hall, D. K., Riggs, G. A., & Salomonson, V. V. (1995). "Development of methods for mapping global snow cover using moderate resolution imaging spectroradiometer data." Remote Sensing of Environment, 54(2), 127–140.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 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 | |
NDVI
¶
Bases: Operator
Normalized Difference Vegetation Index — Rouse et al. 1974.
.. math::
\mathrm{NDVI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{Red}} + \varepsilon}
Returns a single-channel GeoArray of NDVI values in
[-1, +1]. See :func:~geoops.indices._src.array.ndvi for the
physics; this Operator just plumbs the primitive through carriers.
The default nir=3, red=2 matches a 4-band BGRN
convention. For Sentinel-2 imagery stacked in band-number order use
NDVI(nir=7, red=3) (B8 NIR, B4 Red after 0-indexing past
B1/B2/B3); for Landsat-8 use NDVI(nir=4, red=3)
(B5 NIR, B4 Red).
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import NDVI
>>> ndvi_op = NDVI(nir=7, red=3) # Sentinel-2 band order
>>> ndvi_map = ndvi_op(reflectance_geoarray) # GeoArray (H, W)
>>>
>>> # Chain with reflectance conversion:
>>> import geoops as gz
>>> pipe = (
... gz.radiometry.DNToReflectance(scale=1e-4)
... | NDVI(nir=7, red=3)
... )
>>> ndvi_map = pipe(dn_geoarray)
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
NDWI
¶
Bases: Operator
Normalized Difference Water Index — McFeeters 1996.
.. math::
\mathrm{NDWI} \;=\; \frac{\rho_{\mathrm{Green}} - \rho_{\mathrm{NIR}}}
{\rho_{\mathrm{Green}} + \rho_{\mathrm{NIR}} + \varepsilon}
For surface water delineation; not to be confused with Gao's
leaf-water NDWI (SWIR/NIR). High over open water, low over
vegetation. See :func:~geoops.indices._src.array.ndwi_mcfeeters
for physics.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
green
|
BandRef
|
Green band: an integer position or a band name. Default |
1
|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. |
1e-10
|
Examples:
>>> from geoops.indices import NDWI
>>> water_idx = NDWI(green=2, nir=7) # Sentinel-2 B3, B8
>>> ndwi_map = water_idx(reflectance_geoarray)
>>> water_mask = np.asarray(ndwi_map) > 0 # rough surface-water mask
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
NormalizedDifference
¶
Bases: Operator
Generic normalized-difference index (a - b) / (a + b + eps).
Use this when none of the named indices (NDVI/NDWI/NDBI/NBR/...) matches your band pair. Equivalent in math to all of them; the named subclasses are pinned-argument convenience wrappers.
The package's one normalized-difference operator (also the top-level
geoops.NormalizedDifference). Bands a / b are each an
integer position or a band name resolved against gt.attrs by the
package-wide resolver (:func:geoops._src.bands.resolve_band). Names
need a GeoArray carrying band-name attrs; on a plain np.ndarray
a name raises TypeError and integer positions work.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN. On a (T, C, H, W) stack the result is
(T, 1, H, W).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
BandRef
|
Index or name of the "high" band (numerator-positive term). |
required |
b
|
BandRef
|
Index or name of the "low" band. |
required |
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import NormalizedDifference
>>> # A custom water/snow index using SWIR vs Green.
>>> swsi = NormalizedDifference(a=2, b=10) # Green=2, SWIR1=10
>>> result = swsi(reflectance_geoarray)
>>> # By band name (resolved against gt.attrs["band_names"]).
>>> ndvi = NormalizedDifference(a="B8", b="B4")(reflectance_geoarray)
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
SAVI
¶
Bases: Operator
Soil-Adjusted Vegetation Index — Huete 1988.
.. math::
\mathrm{SAVI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{Red}} + L}
\,(1 + L)
Works in sparsely-vegetated scenes where NDVI overweights soil
brightness. L shifts the soil line. L=0 recovers NDVI;
L=0.5 (Huete default) is good for intermediate cover; L=1
for very sparse cover.
See :func:~geoops.indices._src.array.savi for physics.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
L
|
float
|
Soil-adjustment factor in |
0.5
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
Examples:
>>> from geoops.indices import SAVI
>>> # Default L=0.5 for intermediate cover.
>>> savi_op = SAVI(nir=7, red=3, L=0.5)
>>> v = savi_op(reflectance_geoarray)
>>>
>>> # Sparse drylands -> larger L:
>>> dryland_savi = SAVI(nir=7, red=3, L=1.0)
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
dNBR
¶
Bases: Operator
Differenced Normalized Burn Ratio — Key & Benson 2006.
.. math::
\mathrm{dNBR} \;=\; \mathrm{NBR}_{\mathrm{pre}} -
\mathrm{NBR}_{\mathrm{post}}
Standard quantitative burn-severity index. Pre- and post-fire NBR
rasters must share grid (shape, transform, CRS) — co-register
upstream (e.g. with geoops.geom.ReprojectLike)
before passing them in. The output GeoArray inherits the
pre-fire raster's spatial metadata. Plain np.ndarray inputs are
also accepted (only shapes can be checked then) and return a plain
ndarray.
Typical thresholds (Key & Benson 2006): < 0.1 unburned, 0.27–0.44 low severity, 0.44–0.66 moderate, > 0.66 high severity.
Nodata pixels (non-finite, or equal to that raster's
fill_value, in either input) hold NaN in the output,
which declares fill_value=NaN.
Examples:
>>> from geoops.indices import NBR, dNBR
>>> nbr_op = NBR(nir=7, swir2=11)
>>> pre_nbr = nbr_op(pre_fire_geoarray)
>>> post_nbr = nbr_op(post_fire_geoarray)
>>> severity = dNBR()(pre_nbr, post_nbr)
References
Key, C. H., & Benson, N. C. (2006). "Landscape assessment (LA): sampling and analysis methods." USDA Forest Service General Technical Report RMRS-GTR-164-CD.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
kNDVI
¶
Bases: Operator
Kernel NDVI — Camps-Valls et al. 2021.
.. math::
\mathrm{kNDVI} \;=\; \tanh\!\bigl(\mathrm{NDVI}^2\bigr)
A kernel-method-inspired non-linear transform of NDVI that is more resilient to saturation, more linearly related to gross primary productivity, and more robust to atmospheric noise than NDVI on most cover types.
Nodata pixels (any band it reads non-finite or equal to the input's
fill_value) hold NaN in the output, which declares
fill_value=NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
red
|
BandRef
|
Red band: an integer position or a band name. Default |
2
|
nir
|
BandRef
|
NIR band: an integer position or a band name. Default |
3
|
dim
|
str
|
Name of the band dim (default |
'band'
|
axis
|
int | None
|
Deprecated: the band axis position. |
None
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Examples:
>>> from geoops.indices import kNDVI
>>> kndvi_op = kNDVI(nir=7, red=3)
>>> v = kndvi_op(reflectance_geoarray)
References
Camps-Valls, G., Campos-Taberner, M., Moreno-Martinez, A., et al. (2021). "A unified vegetation index for quantifying the terrestrial biosphere." Science Advances, 7(9), eabc7447.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/operators.py
arvi(nir, red, blue, *, gamma=1.0, eps=1e-10)
¶
Atmospherically Resistant Vegetation Index (Kaufman & Tanre 1992).
.. math::
\rho_{rb} = \rho_{\mathrm{Red}}
- \gamma\,(\rho_{\mathrm{Blue}} - \rho_{\mathrm{Red}}),
\quad
\mathrm{ARVI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{rb}}
{\rho_{\mathrm{NIR}} + \rho_{rb} + \varepsilon}
The Blue-band correction cancels aerosol-driven red inflation.
Pass gamma=1 for the original MODIS-derived value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
red
|
Num[ndarray, '*s']
|
Red band. |
required |
blue
|
Num[ndarray, '*s']
|
Blue band. |
required |
gamma
|
float
|
Aerosol-correction strength. Default |
1.0
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape. |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
bais2(red, red_edge1, red_edge2, nir, swir2, *, eps=1e-10)
¶
Burned Area Index for Sentinel-2 (Filipponi 2018).
.. math::
\mathrm{BAIS2} \;=\;
\Bigl(1 - \sqrt{\tfrac{\rho_{6}\,\rho_{7}\,\rho_{8\mathrm{A}}}
{\rho_{4} + \varepsilon}}\Bigr)
\cdot
\Bigl(\tfrac{\rho_{12} - \rho_{8\mathrm{A}}}
{\sqrt{\rho_{12} + \rho_{8\mathrm{A}} + \varepsilon}} + 1\Bigr)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
red
|
Num[ndarray, '*s']
|
Red (B04) reflectance; every band non-negative, or the square roots produce NaN. |
required |
red_edge1
|
Num[ndarray, '*s']
|
First red-edge (B06). |
required |
red_edge2
|
Num[ndarray, '*s']
|
Second red-edge (B07). |
required |
nir
|
Num[ndarray, '*s']
|
Narrow-NIR (B8A). |
required |
swir2
|
Num[ndarray, '*s']
|
SWIR-2 (B12). |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape. |
References
Filipponi, F. (2018). Proceedings, 2(7), 364.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
bsi(blue, red, nir, swir, *, eps=1e-10)
¶
Bare Soil Index (Rikimaru et al. 2002).
.. math::
\mathrm{BSI} \;=\;
\frac{(\rho_{\mathrm{SWIR1}} + \rho_{\mathrm{Red}}) -
(\rho_{\mathrm{NIR}} + \rho_{\mathrm{Blue}})}
{(\rho_{\mathrm{SWIR1}} + \rho_{\mathrm{Red}}) +
(\rho_{\mathrm{NIR}} + \rho_{\mathrm{Blue}}) + \varepsilon}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blue
|
Num[ndarray, '*s']
|
Blue band. |
required |
red
|
Num[ndarray, '*s']
|
Red band. |
required |
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
swir
|
Num[ndarray, '*s']
|
SWIR-1 band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
ciri(cirrus)
¶
Cirrus Reflectance Index (Sentinel-2 B10 passthrough).
.. math::
\mathrm{CIRI} \;=\; \rho_{\mathrm{cirrus}}
The 1.36–1.39 µm cirrus channel is opaque to surface signal due to water-vapour absorption; any non-trivial reflectance comes from high-altitude cloud.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cirrus
|
Num[ndarray, '*s']
|
Cirrus band (Sentinel-2 B10). |
required |
Returns:
| Type | Description |
|---|---|
Num[ndarray, '*s']
|
An array of the inputs' shape — the cirrus band itself, |
Num[ndarray, '*s']
|
dtype preserved. |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
clay_minerals(swir1, swir2, *, eps=1e-10)
¶
Clay Minerals ratio (Sabins 1999; Crowley et al. 1989).
.. math::
\mathrm{ClayMinerals} \;=\; \frac{\rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{SWIR2}} + \varepsilon}
OH-bearing minerals (kaolinite, illite, montmorillonite, alunite) have a diagnostic 2.2 µm absorption inside SWIR-2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swir1
|
Num[ndarray, '*s']
|
SWIR-1 band. |
required |
swir2
|
Num[ndarray, '*s']
|
SWIR-2 band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; a SWIR1/SWIR2 band ratio. |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
dnbr(nbr_pre, nbr_post)
¶
Differenced Normalized Burn Ratio (Key & Benson 2006).
.. math::
\mathrm{dNBR} \;=\; \mathrm{NBR}_{\mathrm{pre}} - \mathrm{NBR}_{\mathrm{post}}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nbr_pre
|
Float[ndarray, '*s']
|
NBR before the fire (see :func: |
required |
nbr_post
|
Float[ndarray, '*s']
|
NBR after the fire, on the same shape. |
required |
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape, floating point; positive where the |
Float[ndarray, '*s']
|
fire lowered NBR. |
Example
dnbr(np.array([0.6, 0.2]), np.array([0.1, 0.2])) array([0.5, 0. ])
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
evi(nir, red, blue, *, G=2.5, C1=6.0, C2=7.5, L=1.0, eps=1e-10)
¶
Enhanced Vegetation Index (Huete et al. 2002).
.. math::
\mathrm{EVI} \;=\; G \cdot \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + C_1 \rho_{\mathrm{Red}} - C_2 \rho_{\mathrm{Blue}} + L}
EVI was designed for MODIS to address two NDVI limitations: NDVI
saturates over dense canopies, and atmospheric aerosols inflate
red-band reflectance. The Blue-band correction term
(:math:-C_2 \rho_{\mathrm{Blue}}) cancels Rayleigh-scattering
bias, and the L-term decouples canopy background. The result is
far more sensitive in high-LAI regimes (rainforest, plantations).
MODIS / Landsat / Sentinel-2 defaults: G=2.5, C1=6, C2=7.5, L=1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
red
|
Num[ndarray, '*s']
|
Red band. |
required |
blue
|
Num[ndarray, '*s']
|
Blue band. |
required |
G
|
float
|
Gain factor. Default |
2.5
|
C1
|
float
|
Red aerosol-resistance coefficient. Default |
6.0
|
C2
|
float
|
Blue aerosol-resistance coefficient. Default |
7.5
|
L
|
float
|
Canopy-background correction. Default |
1.0
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Float[ndarray, '*s']
|
physically-reasonable reflectance inputs. |
References
Huete, A., Didan, K., Miura, T., Rodriguez, E. P., Gao, X., & Ferreira, L. G. (2002). "Overview of the radiometric and biophysical performance of the MODIS vegetation indices." Remote Sensing of Environment, 83(1-2), 195–213.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
evi2(nir, red, *, eps=1e-10)
¶
Two-band Enhanced Vegetation Index (Jiang et al. 2008).
.. math::
\mathrm{EVI2} \;=\; 2.5 \cdot
\frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + 2.4\,\rho_{\mathrm{Red}} + 1 + \varepsilon}
A blue-band-free approximation to EVI tuned to track it within a few percent over most cover types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
red
|
Num[ndarray, '*s']
|
Red band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape. |
References
Jiang, Z., Huete, A. R., Didan, K., & Miura, T. (2008). Remote Sensing of Environment, 112(10), 3833–3845.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
gci(nir, green, *, eps=1e-10)
¶
Green Chlorophyll Index (Gitelson et al. 2003).
.. math::
\mathrm{GCI} \;=\; \frac{\rho_{\mathrm{NIR}}}
{\rho_{\mathrm{Green}} + \varepsilon} - 1
Roughly linear in canopy chlorophyll content; saturates much later than NDVI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
green
|
Num[ndarray, '*s']
|
Green band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape. |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
iron_oxide(red, blue, *, eps=1e-10)
¶
Iron Oxide ratio (Sabins 1999).
.. math::
\mathrm{IronOxide} \;=\; \frac{\rho_{\mathrm{Red}}}
{\rho_{\mathrm{Blue}} + \varepsilon}
Hematite/goethite and related Fe(III) oxides absorb blue and reflect red.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
red
|
Num[ndarray, '*s']
|
Red band. |
required |
blue
|
Num[ndarray, '*s']
|
Blue band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; a Red/Blue band ratio. |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
kndvi(nir, red, *, eps=1e-10)
¶
Kernel NDVI (Camps-Valls et al. 2021).
.. math::
\mathrm{kNDVI} \;=\; \tanh\!\bigl(\mathrm{NDVI}^2\bigr)
Non-linear transform of NDVI with reduced saturation and a closer-to-linear relationship to GPP.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
red
|
Num[ndarray, '*s']
|
Red band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
mndwi(green, swir, *, eps=1e-10)
¶
Modified Normalized Difference Water Index (Xu 2006).
.. math::
\mathrm{MNDWI} \;=\; \frac{\rho_{\mathrm{Green}} - \rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{Green}} + \rho_{\mathrm{SWIR1}}
+ \varepsilon}
Sharper water/non-water separation than McFeeters NDWI; reduces urban-surface confusion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
green
|
Num[ndarray, '*s']
|
Green band. |
required |
swir
|
Num[ndarray, '*s']
|
SWIR-1 band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
nbr(nir, swir2, *, eps=1e-10)
¶
Normalized Burn Ratio (Key & Benson 2006).
.. math::
\mathrm{NBR} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{SWIR2}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{SWIR2}} + \varepsilon}
Live vegetation reflects strongly in NIR and weakly in SWIR-2
(~2200 nm); fire-affected surfaces have the opposite signature
(collapsed cell structure → lower NIR; exposed soil/char → higher
SWIR). Pre/post-fire differences (dNBR = NBR_pre − NBR_post)
are the standard quantitative measure of burn severity in the
USGS / EROS Landsat-based burn-severity products.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
The NIR band (S2 B8, L8 B5). |
required |
swir2
|
Num[ndarray, '*s']
|
The SWIR-2 band (S2 B12, L8 B7). |
required |
eps
|
float
|
Denominator stabiliser. |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; high over healthy vegetation, |
Float[ndarray, '*s']
|
low (or negative) over recently-burned surfaces. |
References
Key, C. H., & Benson, N. C. (2006). "Landscape assessment (LA): sampling and analysis methods." USDA Forest Service General Technical Report RMRS-GTR-164-CD, LA-1 to LA-55.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
nbr2(swir1, swir2, *, eps=1e-10)
¶
Normalized Burn Ratio 2 (USGS Landsat product).
.. math::
\mathrm{NBR2} \;=\; \frac{\rho_{\mathrm{SWIR1}} - \rho_{\mathrm{SWIR2}}}
{\rho_{\mathrm{SWIR1}} + \rho_{\mathrm{SWIR2}}
+ \varepsilon}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swir1
|
Num[ndarray, '*s']
|
SWIR-1 band. |
required |
swir2
|
Num[ndarray, '*s']
|
SWIR-2 band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
ndbi(swir, nir, *, eps=1e-10)
¶
Normalized Difference Built-up Index (Zha et al. 2003).
.. math::
\mathrm{NDBI} \;=\; \frac{\rho_{\mathrm{SWIR}} - \rho_{\mathrm{NIR}}}
{\rho_{\mathrm{SWIR}} + \rho_{\mathrm{NIR}} + \varepsilon}
Built-up surfaces (concrete, asphalt, rooftops) tend to be brighter in SWIR (~1600 nm) than in NIR, while vegetation is the inverse (see NDVI). The ratio is therefore positive over urban material and negative over vegetation; bare soil sits near zero.
Often paired with NDVI in urban-mapping pipelines as
built_up = NDBI - NDVI (Zha's original recipe) to suppress
soil's confounder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swir
|
Num[ndarray, '*s']
|
The SWIR-1 band (S2 B11, L8 B6). |
required |
nir
|
Num[ndarray, '*s']
|
The NIR band (S2 B8, L8 B5). |
required |
eps
|
float
|
Denominator stabiliser. |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape. |
References
Zha, Y., Gao, J., & Ni, S. (2003). "Use of normalized difference built-up index in automatically mapping urban areas from TM imagery." Int. J. Remote Sens., 24(3), 583–594.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
ndmi(nir, swir1, *, eps=1e-10)
¶
Normalized Difference Moisture Index (Gao 1996).
.. math::
\mathrm{NDMI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{SWIR1}}
+ \varepsilon}
Tracks vegetation liquid-water content (not surface water).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
swir1
|
Num[ndarray, '*s']
|
SWIR-1 band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
ndsi(green, swir, *, eps=1e-10)
¶
Normalized Difference Snow Index (Hall et al. 1995).
.. math::
\mathrm{NDSI} \;=\; \frac{\rho_{\mathrm{Green}} - \rho_{\mathrm{SWIR1}}}
{\rho_{\mathrm{Green}} + \rho_{\mathrm{SWIR1}}
+ \varepsilon}
Snow / ice mapping (NDSI > 0.4 is the standard MODIS threshold). Shares its arithmetic form with MNDWI; the two indices are interpreted differently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
green
|
Num[ndarray, '*s']
|
Green band. |
required |
swir
|
Num[ndarray, '*s']
|
SWIR-1 band. |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
ndvi(nir, red, *, eps=1e-10)
¶
Normalized Difference Vegetation Index (Rouse et al. 1974).
.. math::
\mathrm{NDVI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{Red}} + \varepsilon}
Healthy vegetation reflects strongly in the near-infrared (the "red-edge plateau" caused by spongy mesophyll cell-wall scattering) and absorbs strongly in the red (chlorophyll-a/b absorption peak at ~680 nm). The ratio amplifies that contrast and normalises out illumination differences — a pixel with twice the brightness but the same NIR/Red ratio has the same NDVI.
Typical values: bare soil 0.0–0.2, sparse vegetation 0.2–0.5, dense canopy 0.6–0.9, water and clouds < 0 (clouds reflect roughly equally in both bands, water absorbs NIR strongly).
Saturates above LAI ≈ 3 — for high-biomass canopies prefer EVI or
SAVI (see :func:evi, :func:savi).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
The NIR band (Sentinel-2 B8, Landsat-8 B5). Reflectance (0–1) for the formula to be physically meaningful; DN values work but the result is sensor-specific. |
required |
red
|
Num[ndarray, '*s']
|
The Red band (Sentinel-2 B4, Landsat-8 B4). |
required |
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
ndwi_mcfeeters(green, nir, *, eps=1e-10)
¶
Normalized Difference Water Index (McFeeters 1996).
.. math::
\mathrm{NDWI} \;=\; \frac{\rho_{\mathrm{Green}} - \rho_{\mathrm{NIR}}}
{\rho_{\mathrm{Green}} + \rho_{\mathrm{NIR}} + \varepsilon}
Open water reflects modestly in green (~550 nm) and absorbs nearly everything in the NIR. Healthy vegetation does the opposite. The index is therefore strongly positive over water and negative over vegetation / soil.
McFeeters' NDWI is for surface-water delineation, not leaf-water content. The leaf-water-content index (sometimes also called NDWI) uses SWIR and NIR — Gao (1996). Pick deliberately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
green
|
Num[ndarray, '*s']
|
The Green band (S2 B3, L8 B3). |
required |
nir
|
Num[ndarray, '*s']
|
The NIR band (S2 B8, L8 B5). |
required |
eps
|
float
|
Denominator stabiliser. |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape; values in |
Float[ndarray, '*s']
|
typically > 0 over water, < 0 elsewhere. |
References
McFeeters, S. K. (1996). "The use of the Normalized Difference Water Index (NDWI) in the delineation of open water features." International Journal of Remote Sensing, 17(7), 1425–1432.
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
normalized_difference(a, b, *, eps=1e-10)
¶
Generic normalized-difference band ratio.
Computes
.. math::
\mathrm{ND}(a, b) \;=\; \frac{a - b}{a + b + \varepsilon}
where :math:a and :math:b are two bands on one shape.
The denominator's :math:\varepsilon shadows division by zero when
both bands are exactly zero (no-data fill, sensor saturation
bottoming out, etc.) and biases the result toward zero in that
degenerate case rather than NaN.
The normalized-difference family (NDVI, NDWI, NDBI, NBR, …) shares
this exact form; concrete indices are named convenience aliases that
pin which two bands play the role of :math:a and :math:b.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
Num[ndarray, '*s']
|
The "high" band (numerator-positive term). For NDVI this is NIR; for NDWI (McFeeters) this is Green; for NDBI this is SWIR. |
required |
b
|
Num[ndarray, '*s']
|
The "low" band. NDVI: Red; NDWI: NIR; NDBI: NIR. |
required |
eps
|
float
|
Small constant added to the denominator. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape. Output range is |
Float[ndarray, '*s']
|
math: |
Float[ndarray, '*s']
|
range only occur when one of |
Float[ndarray, '*s']
|
(atmospheric-correction artifacts). |
References
Rouse, J. W., Haas, R. H., Schell, J. A., & Deering, D. W. (1974). "Monitoring vegetation systems in the Great Plains with ERTS." Third ERTS Symposium, NASA SP-351, 309–317. (The original normalized-difference vegetation index paper — the form generalises to any two bands.)
Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
savi(nir, red, *, L=0.5, eps=1e-10)
¶
Soil-Adjusted Vegetation Index (Huete 1988).
.. math::
\mathrm{SAVI} \;=\; \frac{\rho_{\mathrm{NIR}} - \rho_{\mathrm{Red}}}
{\rho_{\mathrm{NIR}} + \rho_{\mathrm{Red}} + L}
\,(1 + L)
NDVI overweights soil background brightness in sparsely-vegetated
scenes (drylands, agricultural fields between rows). SAVI's
L-parameter shifts the "soil line" in NIR/Red space; the
(1 + L) factor restores the index range to [-1, +1].
L = 0 recovers NDVI exactly. L = 0.5 (Huete's default) is
appropriate for intermediate vegetation cover; L = 1 for very
sparse cover; L = 0.25 for dense cover. For unknown cover, the
self-adjusting variant MSAVI2 (not provided here) replaces the
constant with a closed-form scene-adaptive term.
eps is added to the denominator like the other ratio indices,
so L = 0 with NIR + Red = 0 stays finite; for L > 0 and
non-negative reflectance it is negligible. Pass reflectance, not DN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nir
|
Num[ndarray, '*s']
|
NIR band. |
required |
red
|
Num[ndarray, '*s']
|
Red band. |
required |
L
|
float
|
Soil-adjustment factor in |
0.5
|
eps
|
float
|
Denominator stabiliser. Default |
1e-10
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '*s']
|
An array of the inputs' shape. |
References
Huete, A. R. (1988). "A soil-adjusted vegetation index (SAVI)." Remote Sensing of Environment, 25(3), 295–309.