xlandsat.ndvi#
- xlandsat.ndvi(scene, red_band='red', nir_band='nir')[source]#
Normalized Difference Vegetation Index
Calculate the NDVI for the given scene, defined as:
\[NDVI = \dfrac{NIR - Red}{NIR + Red}\]- Parameters:
scene (
xarray.Dataset) – A Landsat scene, as read withxlandsat.load_scene.red_band (str) – The name of the variable in
scenethat corresponds to the red band.nir_band (str) – The name of the variable in
scenethat corresponds to the NIR band.
- Returns:
ndvi (
xarray.DataArray) – The calculated NDVI, with the metadata attributes from the original scene.