sr {visa} | R Documentation |
Calculate Simple Ratio (SR).
Description
Simple Ratio is the ratio of the spectra (mostly reflectance) between two bands in the format of
SR = \lambda_i/\lambda_j
It is a normalization of SR by doing NSR = (1-SR)/(1+SR), with the same two spectral bands.
Usage
sr(s, b1, b2)
nsr(s, b1, b2)
lm.sr(s, b1, b2, y)
lm.nsr(s, b1, b2, y)
Arguments
s |
Spectral data in the format of visa's Spectra object, spectra.data.frame or spectra.matrix. |
b1 |
A integer number which defines the wavelength of the 1st spectral band. |
b2 |
A integer number which defines the wavelength of the 2nd spectral band. |
y |
A numeric variable to correlate with SR |
Details
Simple ratio and NDVI looking indices are the two groups of mostly used spectral indices in remote sensing.
As it exactly reads in its name, it is a normalization of the SR and ranges in (0,1).
Value
sr |
Returns a simple ratio index. |
nsr |
Returns a NSR index. |
p |
Returns a ggplot object. |
p |
Returns a ggplot object. |
Examples
library(visa)
s <- NSpec.DF$spectra
sr1 <- sr(s, 480, 550)
s <- NSpec.DF$spectra
nsr1 <- nsr(s, 480, 550)
s <- NSpec.DF
y <- NSpec.DF$N
lm.sr(s,600,500,y)
s <- NSpec.DF
y <- NSpec.DF$N
lm.nsr(s,600,500,y)