ndvi#

geowombat.ndvi(data, nodata=None, mask=False, sensor=None, scale_factor=None)#

Calculates the normalized difference vegetation index

Parameters:
  • data (DataArray) – The xarray.DataArray to process.

  • nodata (Optional[int or float]) – A ‘no data’ value to fill NAs with. If None, the ‘no data’ value is taken from the xarray.DataArray attributes.

  • mask (Optional[bool]) – Whether to mask the results.

  • sensor (Optional[str]) – The data’s sensor. If None, the band names should reflect the index being calculated.

  • scale_factor (Optional[float]) – A scale factor to apply to the data. If None, the scale value is taken from the xarray.DataArray attributes.

Equation:

\[NDVI = \frac{NIR - red}{NIR + red}\]
Returns:

Data range: -1 to 1

Return type:

xarray.DataArray