Spectral resampling
Resample spectra to (satellite) sensors
spectralResampling(x, sensor, rm.NA = TRUE, continuousdata = "auto",
response_function = TRUE)x |
Object of class |
sensor |
Character or |
rm.NA |
If |
continuousdata |
Definition if returned |
response_function |
If |
The characteristics of (satellite) sensor to integrate spectra can be chosen from a list of already implemented sensors. See get.sensor.characteristics for available sensors.
Otherwise the characteristics can be passed as a data.frame with two columns: first column with lower bounds of channels and second column with upper bounds. Alternatively, the data.frame may encompass band centre wavelength and full-width-half-maximum values of the sensor. Function will check the kind of data passed by partially matching the names of the data frame: If any column is named "fwhm" or "center", it is assumed that data are band centre and full-width-half-maximum values.
The third option is to use a Speclib containing the spectral response values instead of reflectances. In this case, the sensor-argument may be missing and the function automatically determines the sensor's central wavelength and the fwhm-values based on the spectral response values. See examples.
If sensor characteristics are defined manually and no Speclib with spectral response values is passed, a Gaussian response is assumed.
Object of class Speclib
The spectral response functions are kindly provided by the operators of the satellites. See hsdardocs("Copyright") for copyright information on spectral response functions.
Quickbird: Copyright by DigitalGlobe, Inc. All Rights Reserved
RapidEye: Copyright by RapidEye AG
WorldView-2: Copyright by DigitalGlobe, Inc. All Rights Reserved
Lukas Lehnert
## Load example data
data(spectral_data)
## Resample to RapidEye
data_RE <- spectralResampling(spectral_data, "RapidEye",
response_function = TRUE)
## Plot resampled spectra
plot(data_RE)
## Compare different methods of spectral resampling
par(mfrow=c(1,3))
ga <- spectralResampling(spectral_data, "RapidEye",
response_function = FALSE)
plot(ga)
re <- spectralResampling(spectral_data, "RapidEye",
response_function = TRUE)
plot(re)
no <- spectralResampling(spectral_data, "RapidEye",
response_function = NA)
plot(no)
## Usage of Speclib with spectral response values
## Define 3 bands (RGB)
center <- c(460, 530, 600)
fwhm <- 70
wl <- c(310:750)
## Create spectral response with gaussian density function
response <- speclib(t(sapply(center, function(center, wl, fwhm)
{
a <- dnorm(wl, mean = center, sd = fwhm/2)
a <- (a-min(a))/(max(a) - min(a))
return(a)
}, wl, fwhm)), wl)
## Plot response functions
for (i in 1:3)
plot(response[i,], new = i == 1, col = c("blue", "green", "red")[i])
## Perform resampling
rgb_data <- spectralResampling(spectral_data, response_function = response)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.