Resumen
Calculates the Normalized Difference Water Index (NDWI) from a multiband raster object and returns a raster object with the index values.
Debate
El índice de agua de diferencia normalizada (NDWI) es un índice que sirve para definir y monitorizar los cambios de contenido en aguas superficiales. Se calcula con la banda infrarroja cercana (NIR) y la banda verde.
NDWI = (Green - NIR) / (Green + NIR)
For information about other multiband raster indexes, see the Band Arithmetic raster function.
The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.
Sintaxis
NDWI (raster, {nir_band_id}, {green_band_id})
Parámetro | Explicación | Tipo de datos |
raster | The input raster. | Raster |
nir_band_id | The band ID of the near-infrared band. The ID index uses one-based indexing. (El valor predeterminado es 5) | Integer |
green_band_id | The band ID of the green band. The ID index uses one-based indexing. (El valor predeterminado es 3) | Integer |
Tipo de datos | Explicación |
Raster | The output raster object with the NDWI index values. |
Muestra de código
Calculates the Normalized Difference Water Index for a Sentinel-2 image.
import arcpy
NDWI_raster = arcpy.sa.NDWI("Sentinel2.tif", 8, 3)