R/snowIndex.R

# snow index


ndsi <- function (green, nir) {
	result <- (green - nir)/(green + nir)
	result[is.infinite(result)] <- NA
    result[result < -1] <- -1
    result[result > 1] <- 1
	return(result)
}

Try the RemoteSensing package in your browser

Any scripts or data that you put into this service are public.

RemoteSensing documentation built on Feb. 7, 2020, 3 p.m.