NDMI
Resumen
Calculates the Normalized Difference Moisture Index (NDMI) from a multiband raster object and returns a raster object with the index values.
Debate
The Normalized Difference Moisture Index (NDMI) is sensitive to the moisture levels in vegetation. It is used to monitor droughts and fuel levels in fire-prone areas. It uses NIR and SWIR bands to create a ratio designed to mitigate illumination and atmospheric effects.
\(NDMI \space = \space (NIR \space - \space SWIR1)/(NIR \space + \space SWIR1)\)
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
NDMI(raster, {nir_band_id}, {swir1_band_id})
| El 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. The default value is 5. |
Integer |
|
swir1_band_id |
The band ID of the shortwave infrared band. The ID index uses one-based indexing. The default value is 6. |
Integer |
Valor de retorno
| Tipo de datos | Explicación |
|---|---|
|
Raster |
The output raster object with the NDMI values. |
Muestra de código
Calculates the Normalized Difference Moisture Index for a Landsat 8 image.
from arcpy.sa import *
out_ndmi_raster = NDMI("landsat8.tif", 5, 6)
out_ndmi_raster.save("C:/arcpyExamples/outputs/NDMI.tif")
Calculates the Normalized Difference Moisture Index for a Landsat 8 image.
# Import system modules
import arcpy
from arcpy.sa import *
# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"
# Set the local variables
in_raster = "landsat8.tif"
# Run NDMI function
out_ndmi_raster = NDMI(in_raster, 5, 6)
# Save the output
out_ndmi_raster.save("C:/arcpyExamples/outputs/NDMI.tif")