Skip to content

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 *_idx band 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.

0
red BandRef

Red band: an integer position or a band name. Default 2.

2
nir BandRef

NIR band: an integer position or a band name. Default 3.

3
gamma float

Aerosol-correction strength. Default 1.0.

1.0
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class ARVI(Operator):
    r"""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``.

    Args:
        blue: Blue band: an integer position or a band name. Default ``0``.
        red: Red band: an integer position or a band name. Default ``2``.
        nir: NIR band: an integer position or a band name. Default ``3``.
        gamma: Aerosol-correction strength. Default ``1.0``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        blue: BandRef = 0,
        red: BandRef = 2,
        nir: BandRef = 3,
        gamma: float = 1.0,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.blue = blue
        self.red = red
        self.nir = nir
        self.gamma = gamma
        self.dim = band_dim(dim, axis, "ARVI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            arvi,
            gt,
            (self.nir, self.red, self.blue),
            dim=self.dim,
            name="ARVI",
            gamma=self.gamma,
            eps=self.eps,
        )

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. NDVI(), EVI()). Must return a GeoArray whose band-axis is collapsed.

required
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

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
class AppendIndex(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.

    Args:
        index_op: An index operator (e.g. ``NDVI()``, ``EVI()``). Must
            return a `GeoArray` whose band-axis is collapsed.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.

    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)
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy",)
    # the input bands, plus one index computed across them
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "expand"}
    )

    def __init__(
        self, *, index_op: Operator, dim: str = "band", axis: int | None = None
    ) -> None:
        self.index_op = index_op
        self.dim = band_dim(dim, axis, "AppendIndex")

    def _apply(self, gt: GeoArray | np.ndarray) -> GeoArray | np.ndarray:
        axis = dim_axis(gt, self.dim, name="AppendIndex")
        index = self.index_op(gt)
        index_arr = np.asarray(index)
        # Expand back to (..., 1, ..., H, W) along the configured axis so
        # concatenation lines up. np.expand_dims handles negative axes
        # correctly.
        arr = np.asarray(gt)
        index_3d = (
            index_arr
            if index_arr.ndim == arr.ndim
            else np.expand_dims(index_arr, axis=axis)
        )
        stacked = np.concatenate([arr, index_3d], axis=axis)
        # Band-name lists gain the index operator's name; per-band values
        # with no meaning for an index (wavelengths) are dropped.
        src_attrs = getattr(gt, "attrs", None)
        attrs = strip_band_attrs(src_attrs)
        name = type(self.index_op).__name__
        for key in BAND_NAME_KEYS:
            names = per_band_values(src_attrs, key, arr.shape[axis])
            if names is not None:
                attrs[key] = [*names, name]
        # The stacked bands keep the input's values, so the fill follows
        # the input's (NaN once integer bands are promoted by the float index).
        return wrap_filled(
            gt,
            stacked,
            fill_value=carried_fill(gt, stacked.dtype),
            attrs=attrs,
        )

    def get_config(self) -> dict[str, Any]:
        return {"index_op": nested_config(self.index_op), "dim": self.dim}

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.

2
red_edge1 BandRef

first red-edge band: an integer position or a band name. Default 4.

4
red_edge2 BandRef

second red-edge band: an integer position or a band name. Default 5.

5
nir BandRef

narrow-NIR band: an integer position or a band name. Default 7.

7
swir2 BandRef

SWIR-2 band: an integer position or a band name. Default 9.

9
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class BAIS2(Operator):
    r"""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``.

    Args:
        red: Red band: an integer position or a band name. Default ``2``.
        red_edge1: first red-edge band: an integer position or a band name. Default ``4``.
        red_edge2: second red-edge band: an integer position or a band name. Default ``5``.
        nir: narrow-NIR band: an integer position or a band name. Default ``7``.
        swir2: SWIR-2 band: an integer position or a band name. Default ``9``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        red: BandRef = 2,
        red_edge1: BandRef = 4,
        red_edge2: BandRef = 5,
        nir: BandRef = 7,
        swir2: BandRef = 9,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.red = red
        self.red_edge1 = red_edge1
        self.red_edge2 = red_edge2
        self.nir = nir
        self.swir2 = swir2
        self.dim = band_dim(dim, axis, "BAIS2")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            bais2,
            gt,
            (self.red, self.red_edge1, self.red_edge2, self.nir, self.swir2),
            dim=self.dim,
            name="BAIS2",
            eps=self.eps,
        )

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.

0
red BandRef

Red band: an integer position or a band name. Default 2.

2
nir BandRef

NIR band: an integer position or a band name. Default 3.

3
swir BandRef

SWIR-1 band: an integer position or a band name. Default 5.

5
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class BSI(Operator):
    r"""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``.

    Args:
        blue: Blue band: an integer position or a band name. Default ``0``.
        red: Red band: an integer position or a band name. Default ``2``.
        nir: NIR band: an integer position or a band name. Default ``3``.
        swir: SWIR-1 band: an integer position or a band name. Default ``5``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        blue: BandRef = 0,
        red: BandRef = 2,
        nir: BandRef = 3,
        swir: BandRef = 5,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.blue = blue
        self.red = red
        self.nir = nir
        self.swir = swir
        self.dim = band_dim(dim, axis, "BSI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            bsi,
            gt,
            (self.blue, self.red, self.nir, self.swir),
            dim=self.dim,
            name="BSI",
            eps=self.eps,
        )

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.

9
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

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
class CIRI(Operator):
    r"""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``.

    Args:
        cirrus: cirrus band: an integer position or a band name. Default ``9``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.

    Examples:
        >>> from geoops.indices import CIRI
        >>> ciri_op = CIRI()  # defaults to S2 B10
        >>> cirrus_score = ciri_op(reflectance_geoarray)
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    # the cirrus band, passed through
    coupling: ClassVar[Coupling] = Coupling(effects={"band": "select"})

    def __init__(
        self,
        *,
        cirrus: BandRef = 9,
        dim: str = "band",
        axis: int | None = None,
    ) -> None:
        self.cirrus = cirrus
        self.dim = band_dim(dim, axis, "CIRI")

    def _apply(self, gt: Any) -> Any:
        return band_kernel(ciri, gt, (self.cirrus,), dim=self.dim, name="CIRI")

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.

5
swir2 BandRef

SWIR-2 band: an integer position or a band name. Default 6.

6
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class ClayMinerals(Operator):
    r"""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``.

    Args:
        swir1: SWIR-1 band: an integer position or a band name. Default ``5``.
        swir2: SWIR-2 band: an integer position or a band name. Default ``6``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        swir1: BandRef = 5,
        swir2: BandRef = 6,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.swir1 = swir1
        self.swir2 = swir2
        self.dim = band_dim(dim, axis, "ClayMinerals")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            clay_minerals,
            gt,
            (self.swir1, self.swir2),
            dim=self.dim,
            name="ClayMinerals",
            eps=self.eps,
        )

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.

3
red BandRef

Red band: an integer position or a band name. Default 2.

2
blue BandRef

Blue band: an integer position or a band name. Default 0.

0
G float

Gain factor. Default 2.5.

2.5
C1 float

Red aerosol-resistance coefficient. Default 6.

6.0
C2 float

Blue aerosol-resistance coefficient. Default 7.5.

7.5
L float

Canopy-background correction. Default 1.

1.0
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

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
class EVI(Operator):
    r"""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``.

    Args:
        nir: NIR band: an integer position or a band name. Default ``3``.
        red: Red band: an integer position or a band name. Default ``2``.
        blue: Blue band: an integer position or a band name. Default ``0``.
        G: Gain factor. Default ``2.5``.
        C1: Red aerosol-resistance coefficient. Default ``6``.
        C2: Blue aerosol-resistance coefficient. Default ``7.5``.
        L: Canopy-background correction. Default ``1``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.

    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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        blue: BandRef = 0,
        red: BandRef = 2,
        nir: BandRef = 3,
        G: float = 2.5,
        C1: float = 6.0,
        C2: float = 7.5,
        L: float = 1.0,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.nir = nir
        self.red = red
        self.blue = blue
        self.G = G
        self.C1 = C1
        self.C2 = C2
        self.L = L
        self.dim = band_dim(dim, axis, "EVI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            evi,
            gt,
            (self.nir, self.red, self.blue),
            dim=self.dim,
            name="EVI",
            G=self.G,
            C1=self.C1,
            C2=self.C2,
            L=self.L,
            eps=self.eps,
        )

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.

2
nir BandRef

NIR band: an integer position or a band name. Default 3.

3
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class EVI2(Operator):
    r"""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``.

    Args:
        red: Red band: an integer position or a band name. Default ``2``.
        nir: NIR band: an integer position or a band name. Default ``3``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        red: BandRef = 2,
        nir: BandRef = 3,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.red = red
        self.nir = nir
        self.dim = band_dim(dim, axis, "EVI2")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            evi2,
            gt,
            (self.nir, self.red),
            dim=self.dim,
            name="EVI2",
            eps=self.eps,
        )

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.

1
nir BandRef

NIR band: an integer position or a band name. Default 3.

3
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class GCI(Operator):
    r"""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``.

    Args:
        green: Green band: an integer position or a band name. Default ``1``.
        nir: NIR band: an integer position or a band name. Default ``3``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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).
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        green: BandRef = 1,
        nir: BandRef = 3,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.green = green
        self.nir = nir
        self.dim = band_dim(dim, axis, "GCI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            gci,
            gt,
            (self.nir, self.green),
            dim=self.dim,
            name="GCI",
            eps=self.eps,
        )

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.

2
blue BandRef

Blue band: an integer position or a band name. Default 0.

0
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class IronOxide(Operator):
    r"""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``.

    Args:
        red: Red band: an integer position or a band name. Default ``2``.
        blue: Blue band: an integer position or a band name. Default ``0``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        red: BandRef = 2,
        blue: BandRef = 0,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.red = red
        self.blue = blue
        self.dim = band_dim(dim, axis, "IronOxide")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            iron_oxide,
            gt,
            (self.red, self.blue),
            dim=self.dim,
            name="IronOxide",
            eps=self.eps,
        )

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.

1
swir BandRef

SWIR-1 band: an integer position or a band name. Default 5.

5
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class MNDWI(Operator):
    r"""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``.

    Args:
        green: Green band: an integer position or a band name. Default ``1``.
        swir: SWIR-1 band: an integer position or a band name. Default ``5``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        green: BandRef = 1,
        swir: BandRef = 5,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.green = green
        self.swir = swir
        self.dim = band_dim(dim, axis, "MNDWI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            mndwi,
            gt,
            (self.green, self.swir),
            dim=self.dim,
            name="MNDWI",
            eps=self.eps,
        )

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.

3
swir2 BandRef

SWIR-2 band: an integer position or a band name. Default 6.

6
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

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
class NBR(Operator):
    r"""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``.

    Args:
        nir: NIR band: an integer position or a band name. Default ``3``.
        swir2: SWIR-2 band: an integer position or a band name. Default ``6``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: Denominator stabiliser.

    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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        nir: BandRef = 3,
        swir2: BandRef = 6,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.nir = nir
        self.swir2 = swir2
        self.dim = band_dim(dim, axis, "NBR")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            nbr,
            gt,
            (self.nir, self.swir2),
            dim=self.dim,
            name="NBR",
            eps=self.eps,
        )

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.

5
swir2 BandRef

SWIR-2 band: an integer position or a band name. Default 6.

6
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class NBR2(Operator):
    r"""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``.

    Args:
        swir1: SWIR-1 band: an integer position or a band name. Default ``5``.
        swir2: SWIR-2 band: an integer position or a band name. Default ``6``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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)
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        swir1: BandRef = 5,
        swir2: BandRef = 6,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.swir1 = swir1
        self.swir2 = swir2
        self.dim = band_dim(dim, axis, "NBR2")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            nbr2,
            gt,
            (self.swir1, self.swir2),
            dim=self.dim,
            name="NBR2",
            eps=self.eps,
        )

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.

5
nir BandRef

NIR band: an integer position or a band name. Default 3.

3
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

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
class NDBI(Operator):
    r"""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``.

    Args:
        swir: SWIR-1 band: an integer position or a band name. Default ``5``.
        nir: NIR band: an integer position or a band name. Default ``3``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: Denominator stabiliser.

    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)
        ... )
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        swir: BandRef = 5,
        nir: BandRef = 3,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.swir = swir
        self.nir = nir
        self.dim = band_dim(dim, axis, "NDBI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            ndbi,
            gt,
            (self.swir, self.nir),
            dim=self.dim,
            name="NDBI",
            eps=self.eps,
        )

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.

3
swir1 BandRef

SWIR-1 band: an integer position or a band name. Default 5.

5
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class NDMI(Operator):
    r"""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``.

    Args:
        nir: NIR band: an integer position or a band name. Default ``3``.
        swir1: SWIR-1 band: an integer position or a band name. Default ``5``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        nir: BandRef = 3,
        swir1: BandRef = 5,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.nir = nir
        self.swir1 = swir1
        self.dim = band_dim(dim, axis, "NDMI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            ndmi,
            gt,
            (self.nir, self.swir1),
            dim=self.dim,
            name="NDMI",
            eps=self.eps,
        )

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.

1
swir BandRef

SWIR-1 band: an integer position or a band name. Default 5.

5
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class NDSI(Operator):
    r"""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``.

    Args:
        green: Green band: an integer position or a band name. Default ``1``.
        swir: SWIR-1 band: an integer position or a band name. Default ``5``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        green: BandRef = 1,
        swir: BandRef = 5,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.green = green
        self.swir = swir
        self.dim = band_dim(dim, axis, "NDSI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            ndsi,
            gt,
            (self.green, self.swir),
            dim=self.dim,
            name="NDSI",
            eps=self.eps,
        )

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.

3
red BandRef

Red band: an integer position or a band name. Default 2.

2
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class NDVI(Operator):
    r"""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``.

    Args:
        nir: NIR band: an integer position or a band name. Default ``3``.
        red: Red band: an integer position or a band name. Default ``2``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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)
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    # two bands at one pixel -> one band
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        red: BandRef = 2,
        nir: BandRef = 3,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.nir = nir
        self.red = red
        self.dim = band_dim(dim, axis, "NDVI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            ndvi,
            gt,
            (self.nir, self.red),
            dim=self.dim,
            name="NDVI",
            eps=self.eps,
        )

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.

1
nir BandRef

NIR band: an integer position or a band name. Default 3.

3
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

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
class NDWI(Operator):
    r"""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``.

    Args:
        green: Green band: an integer position or a band name. Default ``1``.
        nir: NIR band: an integer position or a band name. Default ``3``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: Denominator stabiliser.

    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
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        green: BandRef = 1,
        nir: BandRef = 3,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.green = green
        self.nir = nir
        self.dim = band_dim(dim, axis, "NDWI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            ndwi_mcfeeters,
            gt,
            (self.green, self.nir),
            dim=self.dim,
            name="NDWI",
            eps=self.eps,
        )

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"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10, the package-wide value (see :mod:geoops.indices._src.array).

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
class NormalizedDifference(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)``.

    Args:
        a: Index or name of the "high" band (numerator-positive term).
        b: Index or name of the "low" band.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: Denominator stabiliser. Default ``1e-10``, the package-wide
            value (see :mod:`geoops.indices._src.array`).

    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)
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        a: BandRef,
        b: BandRef,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.a = a
        self.b = b
        self.dim = band_dim(dim, axis, "NormalizedDifference")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            normalized_difference,
            gt,
            (self.a, self.b),
            dim=self.dim,
            name="NormalizedDifference",
            eps=self.eps,
        )

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.

3
red BandRef

Red band: an integer position or a band name. Default 2.

2
L float

Soil-adjustment factor in [0, 1]. Default 0.5.

0.5
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

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
class SAVI(Operator):
    r"""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``.

    Args:
        nir: NIR band: an integer position or a band name. Default ``3``.
        red: Red band: an integer position or a band name. Default ``2``.
        L: Soil-adjustment factor in ``[0, 1]``. Default ``0.5``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.

    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)
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        red: BandRef = 2,
        nir: BandRef = 3,
        L: float = 0.5,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.nir = nir
        self.red = red
        self.L = L
        self.dim = band_dim(dim, axis, "SAVI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            savi,
            gt,
            (self.nir, self.red),
            dim=self.dim,
            name="SAVI",
            L=self.L,
            eps=self.eps,
        )

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
class dNBR(Operator):
    r"""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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    # NBR(pre) - NBR(post): bands and the two dates mix
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band", "time"}, effects={"band": "reduce", "time": "reduce"}
    )

    def _apply(self, pre: Any, post: Any) -> Any:
        return carrier_kernel(dnbr, pre, post, name="dNBR")

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.

2
nir BandRef

NIR band: an integer position or a band name. Default 3.

3
dim str

Name of the band dim (default "band"); its position is read from the carrier's dims.

'band'
axis int | None

Deprecated: the band axis position. -3 maps to dim="band"; removed in the next minor release.

None
eps float

Denominator stabiliser. Default 1e-10.

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
class kNDVI(Operator):
    r"""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``.

    Args:
        red: Red band: an integer position or a band name. Default ``2``.
        nir: NIR band: an integer position or a band name. Default ``3``.
        dim: Name of the band dim (default ``"band"``); its position is read
            from the carrier's dims.
        axis: Deprecated: the band axis position. ``-3`` maps to
            ``dim="band"``; removed in the next minor release.
        eps: 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.
    """

    backends: ClassVar[tuple[str, ...]] = ("numpy", "jax", "dask")
    coupling: ClassVar[Coupling] = Coupling(
        couples={"band"}, effects={"band": "reduce"}
    )

    def __init__(
        self,
        *,
        red: BandRef = 2,
        nir: BandRef = 3,
        dim: str = "band",
        eps: float = 1e-10,
        axis: int | None = None,
    ) -> None:
        self.red = red
        self.nir = nir
        self.dim = band_dim(dim, axis, "kNDVI")
        self.eps = eps

    def _apply(self, gt: Any) -> Any:
        return band_kernel(
            kndvi,
            gt,
            (self.nir, self.red),
            dim=self.dim,
            name="kNDVI",
            eps=self.eps,
        )

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.

1.0
eps float

Denominator stabiliser. Default 1e-10.

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
def arvi(
    nir: Num[np.ndarray, "*s"],
    red: Num[np.ndarray, "*s"],
    blue: Num[np.ndarray, "*s"],
    *,
    gamma: float = 1.0,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        nir: NIR band.
        red: Red band.
        blue: Blue band.
        gamma: Aerosol-correction strength. Default ``1.0``.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape.
    """
    nir = as_float(nir)
    red = as_float(red)
    blue = as_float(blue)
    rb = red - gamma * (blue - red)
    return (nir - rb) / (nir + rb + eps)

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.

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
def bais2(
    red: Num[np.ndarray, "*s"],
    red_edge1: Num[np.ndarray, "*s"],
    red_edge2: Num[np.ndarray, "*s"],
    nir: Num[np.ndarray, "*s"],
    swir2: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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)

    Args:
        red: Red (B04) reflectance; every band non-negative, or the
            square roots produce NaN.
        red_edge1: First red-edge (B06).
        red_edge2: Second red-edge (B07).
        nir: Narrow-NIR (B8A).
        swir2: SWIR-2 (B12).
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape.

    References:
        Filipponi, F. (2018). *Proceedings*, 2(7), 364.
    """
    xp = array_namespace(red)
    red = as_float(red)
    red_edge1 = as_float(red_edge1)
    red_edge2 = as_float(red_edge2)
    nir = as_float(nir)
    swir2 = as_float(swir2)
    return (1.0 - xp.sqrt((red_edge1 * red_edge2 * nir) / (red + eps))) * (
        (swir2 - nir) / xp.sqrt(swir2 + nir + eps) + 1.0
    )

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.

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [-1, +1].

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def bsi(
    blue: Num[np.ndarray, "*s"],
    red: Num[np.ndarray, "*s"],
    nir: Num[np.ndarray, "*s"],
    swir: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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}

    Args:
        blue: Blue band.
        red: Red band.
        nir: NIR band.
        swir: SWIR-1 band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]``.
    """
    blue = as_float(blue)
    red = as_float(red)
    nir = as_float(nir)
    swir = as_float(swir)
    return ((swir + red) - (nir + blue)) / ((swir + red) + (nir + blue) + eps)

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
def ciri(
    cirrus: Num[np.ndarray, "*s"],
) -> Num[np.ndarray, "*s"]:
    r"""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.

    Args:
        cirrus: Cirrus band (Sentinel-2 B10).

    Returns:
        An array of the inputs' shape — the cirrus band itself,
        dtype preserved.
    """
    return cirrus

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.

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
def clay_minerals(
    swir1: Num[np.ndarray, "*s"],
    swir2: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        swir1: SWIR-1 band.
        swir2: SWIR-2 band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; a SWIR1/SWIR2 band ratio.
    """
    swir1 = as_float(swir1)
    swir2 = as_float(swir2)
    return swir1 / (swir2 + eps)

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:nbr).

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
def dnbr(
    nbr_pre: Float[np.ndarray, "*s"],
    nbr_post: Float[np.ndarray, "*s"],
) -> Float[np.ndarray, "*s"]:
    r"""Differenced Normalized Burn Ratio (Key & Benson 2006).

    .. math::

        \mathrm{dNBR} \;=\; \mathrm{NBR}_{\mathrm{pre}} - \mathrm{NBR}_{\mathrm{post}}

    Args:
        nbr_pre: NBR before the fire (see :func:`nbr`).
        nbr_post: NBR after the fire, on the same shape.

    Returns:
        An array of the inputs' shape, floating point; positive where the
        fire lowered NBR.

    Example:
        >>> dnbr(np.array([0.6, 0.2]), np.array([0.1, 0.2]))
        array([0.5, 0. ])
    """
    return as_float(nbr_pre) - as_float(nbr_post)

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 (MODIS convention).

2.5
C1 float

Red aerosol-resistance coefficient. Default 6.

6.0
C2 float

Blue aerosol-resistance coefficient. Default 7.5.

7.5
L float

Canopy-background correction. Default 1.

1.0

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [-1, +1] for

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
def evi(
    nir: Num[np.ndarray, "*s"],
    red: Num[np.ndarray, "*s"],
    blue: Num[np.ndarray, "*s"],
    *,
    G: float = 2.5,
    C1: float = 6.0,
    C2: float = 7.5,
    L: float = 1.0,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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``.

    Args:
        nir: NIR band.
        red: Red band.
        blue: Blue band.
        G: Gain factor. Default ``2.5`` (MODIS convention).
        C1: Red aerosol-resistance coefficient. Default ``6``.
        C2: Blue aerosol-resistance coefficient. Default ``7.5``.
        L: Canopy-background correction. Default ``1``.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]`` for
        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.
    """
    nir = as_float(nir)
    red = as_float(red)
    blue = as_float(blue)
    return G * (nir - red) / (nir + C1 * red - C2 * blue + L + eps)

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.

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
def evi2(
    nir: Num[np.ndarray, "*s"],
    red: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        nir: NIR band.
        red: Red band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        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.
    """
    nir = as_float(nir)
    red = as_float(red)
    return 2.5 * (nir - red) / (nir + 2.4 * red + 1.0 + eps)

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.

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
def gci(
    nir: Num[np.ndarray, "*s"],
    green: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        nir: NIR band.
        green: Green band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape.
    """
    nir = as_float(nir)
    green = as_float(green)
    return nir / (green + eps) - 1.0

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.

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
def iron_oxide(
    red: Num[np.ndarray, "*s"],
    blue: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        red: Red band.
        blue: Blue band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; a Red/Blue band ratio.
    """
    red = as_float(red)
    blue = as_float(blue)
    return red / (blue + eps)

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.

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [0, 1).

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def kndvi(
    nir: Num[np.ndarray, "*s"],
    red: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        nir: NIR band.
        red: Red band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; values in ``[0, 1)``.
    """
    value = ndvi(nir, red, eps=eps)
    return array_namespace(value).tanh(value**2)

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.

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [-1, +1].

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def mndwi(
    green: Num[np.ndarray, "*s"],
    swir: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        green: Green band.
        swir: SWIR-1 band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]``.
    """
    return normalized_difference(green, swir, eps=eps)

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
def nbr(
    nir: Num[np.ndarray, "*s"],
    swir2: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        nir: The NIR band (S2 B8, L8 B5).
        swir2: The SWIR-2 band (S2 B12, L8 B7).
        eps: Denominator stabiliser.

    Returns:
        An array of the inputs' shape; high over healthy vegetation,
        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.
    """
    return normalized_difference(nir, swir2, eps=eps)

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.

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [-1, +1].

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def nbr2(
    swir1: Num[np.ndarray, "*s"],
    swir2: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""Normalized Burn Ratio 2 (USGS Landsat product).

    .. math::

        \mathrm{NBR2} \;=\; \frac{\rho_{\mathrm{SWIR1}} - \rho_{\mathrm{SWIR2}}}
                                 {\rho_{\mathrm{SWIR1}} + \rho_{\mathrm{SWIR2}}
                                  + \varepsilon}

    Args:
        swir1: SWIR-1 band.
        swir2: SWIR-2 band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]``.
    """
    return normalized_difference(swir1, swir2, eps=eps)

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
def ndbi(
    swir: Num[np.ndarray, "*s"],
    nir: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        swir: The SWIR-1 band (S2 B11, L8 B6).
        nir: The NIR band (S2 B8, L8 B5).
        eps: Denominator stabiliser.

    Returns:
        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.
    """
    return normalized_difference(swir, nir, eps=eps)

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.

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [-1, +1].

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def ndmi(
    nir: Num[np.ndarray, "*s"],
    swir1: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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).

    Args:
        nir: NIR band.
        swir1: SWIR-1 band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]``.
    """
    return normalized_difference(nir, swir1, eps=eps)

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.

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [-1, +1].

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def ndsi(
    green: Num[np.ndarray, "*s"],
    swir: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        green: Green band.
        swir: SWIR-1 band.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]``.
    """
    return normalized_difference(green, swir, eps=eps)

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.

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape; values in [-1, +1].

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def ndvi(
    nir: Num[np.ndarray, "*s"],
    red: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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`).

    Args:
        nir: 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.
        red: The Red band (Sentinel-2 B4, Landsat-8 B4).
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]``.
    """
    return normalized_difference(nir, red, eps=eps)

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 [-1, +1],

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
def ndwi_mcfeeters(
    green: Num[np.ndarray, "*s"],
    nir: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        green: The Green band (S2 B3, L8 B3).
        nir: The NIR band (S2 B8, L8 B5).
        eps: Denominator stabiliser.

    Returns:
        An array of the inputs' shape; values in ``[-1, +1]``,
        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.
    """
    return normalized_difference(green, nir, eps=eps)

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. Pass 0.0 if you'd rather see inf/nan on zero pixels (useful when debugging masking issues).

1e-10

Returns:

Type Description
Float[ndarray, '*s']

An array of the inputs' shape. Output range is

Float[ndarray, '*s']

math:(-1, +1) for any non-negative input; values outside that

Float[ndarray, '*s']

range only occur when one of a or b is negative

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
def normalized_difference(
    a: Num[np.ndarray, "*s"],
    b: Num[np.ndarray, "*s"],
    *,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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`.

    Args:
        a: The "high" band (numerator-positive term). For
            NDVI this is NIR; for NDWI (McFeeters) this is Green; for
            NDBI this is SWIR.
        b: The "low" band. NDVI: Red; NDWI: NIR; NDBI: NIR.
        eps: Small constant added to the denominator. Default ``1e-10``.
            Pass ``0.0`` if you'd rather see ``inf``/``nan`` on zero
            pixels (useful when debugging masking issues).

    Returns:
        An array of the inputs' shape. Output range is
        :math:`(-1, +1)` for any non-negative input; values outside that
        range only occur when one of ``a`` or ``b`` is negative
        (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.)
    """
    a = as_float(a)
    b = as_float(b)
    return (a - b) / (a + b + eps)

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, 1]. Default 0.5.

0.5
eps float

Denominator stabiliser. Default 1e-10.

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.

Source code in packages/geotoolz-ops/src/geoops/indices/_src/array.py
def savi(
    nir: Num[np.ndarray, "*s"],
    red: Num[np.ndarray, "*s"],
    *,
    L: float = 0.5,
    eps: float = 1e-10,
) -> Float[np.ndarray, "*s"]:
    r"""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.

    Args:
        nir: NIR band.
        red: Red band.
        L: Soil-adjustment factor in ``[0, 1]``. Default ``0.5``.
        eps: Denominator stabiliser. Default ``1e-10``.

    Returns:
        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.
    """
    nir = as_float(nir)
    red = as_float(red)
    return (nir - red) / (nir + red + L + eps) * (1.0 + L)