xrspatial.fire.rdnbr#

xrspatial.fire.rdnbr(dnbr_agg: DataArray, pre_nbr_agg: DataArray, name: str = 'rdnbr') DataArray[source]#

Relative differenced Normalized Burn Ratio (RdNBR).

Computes dNBR / sqrt(abs(pre_NBR / 1000)). Normalises dNBR by pre-fire vegetation density so that burn severity is comparable across different vegetation types.

Supports NumPy, CuPy, Dask with NumPy, and Dask with CuPy backed xarray DataArrays; the output backend matches the input.

Parameters:
  • dnbr_agg (xr.DataArray) – dNBR values (e.g. from dnbr()).

  • pre_nbr_agg (xr.DataArray) – Pre-fire NBR values.

  • name (str, default='rdnbr') – Name of output DataArray.

Returns:

RdNBR values (float32). Pixels where abs(pre_NBR) < 1e-7 are set to NaN to avoid division by near-zero.

Return type:

xr.DataArray

Examples

>>> import numpy as np, xarray as xr
>>> from xrspatial import rdnbr
>>> dnbr_agg = xr.DataArray(
...     np.array([[0.4, 0.3], [0.1, 0.2]], dtype='f4'))
>>> pre = xr.DataArray(
...     np.array([[500., 200.], [300., 400.]], dtype='f4'))
>>> rdnbr(dnbr_agg, pre).values
array([[0.56568545, 0.6708204 ],
       [0.18257418, 0.31622776]], dtype=float32)