Learn R Programming

RGISTools (version 0.9.7)

varNDMI: Calculate normalized difference moisture (water) index (NDMI)

Description

varNDMI computes the normalized difference moisture index (NDMI) from the near-infrared (NIR) and shortwave-infrared 1 (SWIR1) bands.

Usage

varNDMI(nir, swir1)

Arguments

nir

a raster with the nir band of the capture.

swir1

a raster with the swir1 band of the capture.

Value

A NDMI image in raster format.

Details

The normalized difference moisture index (NDMI) is an index that represents the water stress levels of the canopy, using the NIR and SWIR gao1995normalizedRGISTools. This function is used within ls7FolderToVar, ls8FolderToVar, modFolderToVar and senFolderToVar.

References

gao1995normalizedRGISTools

Examples

Run this code
# NOT RUN {
# path to the cropped and cutted MODIS images for the region of Navarre
img.dir <- system.file("ExNavarreVar", package = "RGISTools")
# list all the tif files
img.files <- list.files(img.dir, pattern="\\.tif$", recursive = TRUE, full.names = TRUE)
# print the MOD09 bands
getRGISToolsOpt("MOD09BANDS")

# select the NIR and SWIR1 bands
nir <- raster(img.files[2])
swir1 <- raster(img.files[6])
# calculate the NDMI image
ndmi <- varNDMI(nir,swir1)
# plot the image
spplot(ndmi)
# }

Run the code above in your browser using DataLab