NDSI

Synthèse

Calculates the Normalized Difference Snow Index (NDSI) from a multiband raster object and returns a raster object with the index values.

Discussion

The Normalized Difference Snow Index (NDSI) is designed to use MODIS (band 4 and band 6) and Landsat TM (band 2 and band 5) for identification of snow cover while ignoring cloud cover. Since it is ratio based, it also mitigates atmospheric effects.

 NDSI = (Green - SWIR) / (Green + SWIR)

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.

Syntaxe

NDSI (raster, {green_band_id}, {swir_band_id})
ParamètreExplicationType de données
raster

The input raster.

Raster
green_band_id

The band ID of the green band. The ID index uses one-based indexing.

(La valeur par défaut est 4)

Integer
swir_band_id

The band ID of the shortwave infrared band. The ID index uses one-based indexing.

(La valeur par défaut est 6)

Integer
Valeur renvoyée
Type de donnéesExplication
Raster

The output raster object with the NDSI values.

Exemple de code

NDSI example

Calculates the Normalized Difference Snow Index for a Landsat 8 image.

from arcpy.sa import *
out_ndsi_raster = NDSI("landsat8.tif", 4, 6)
out_ndsi_raster.save("C:/arcpyExamples/outputs/NDSI.tif")
NDSI example

Calculates the Normalized Difference Snow 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"

# Execute NDSI function
out_ndsi_raster = NDSI(in_raster, 4, 6)

# Save the output
out_ndsi_raster.save("C:/arcpyExamples/outputs/NDSI.tif")

Rubriques connexes