varSAVI: Calculates the soil-adjusted vegetation index (SAVI)

Description Usage Arguments Details Value References Examples

View source: R/varSAVI.R

Description

varSAVI Calculate the soil-adjusted vegetation index (SAVI) from the red and near-infrared (NIR) bands.

Usage

1
2
3
varSAVI(red, nir, L = 0.5, scfun = function(r) {
    r
})

Arguments

red

a raster with the red band of the capture.

nir

a raster with the NIR band of the capture.

L

a constant to remove soil background effect. A value of 0.5 is recommended in the literature.

scfun

a function to re-scale the original pixel values into reflectance (0-1).

Details

The soil adjusted vegetation index (SAVI) is an indicator engineered to remove the influence of the soil background effect \insertCitehuete1988soilRGISTools. This function is used within ls7FolderToVar, ls8FolderToVar, modFolderToVar and senFolderToVar.

Value

A SAVI image in raster format.

References

\insertRef

huete1988soilRGISTools

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# path to the cropped and cutted MODIS images for the region of Navarre
wdir <- system.file("ExNavarreVar", package = "RGISTools")
# list all the tif files
files.mod <- list.files(wdir, pattern="\\.tif$", recursive = TRUE, full.names = TRUE)
# print the MOD09 bands
getRGISToolsOpt("MOD09BANDS")

# select the red and NIR bands
img.mod.red <- raster(files.mod[1])
img.mod.nir <- raster(files.mod[2])
# calculate the SAVI image
img.mod.savi <- varSAVI(img.mod.red,img.mod.nir,scfun=getRGISToolsOpt("MOD09SCL"))
# plot the image
spplot(img.mod.savi,col.regions=rev(topo.colors(20)))

RGISTools documentation built on July 2, 2020, 3:58 a.m.