Learn R Programming

hsdar (version 0.5.1)

spectralResampling: Spectral resampling

Description

Resample spectra to (satellite) sensors

Usage

spectralResampling(x, sensor, rm.NA = TRUE, continuousdata = "auto", response_function = TRUE)

Arguments

x
Object of class Speclib. Data to be spectrally resampled.
sensor
Character or data.frame containing definition of sensor characteristics. See details section for further information.
rm.NA
If TRUE, channels which are not covered by input data wavelength are removed
continuousdata
Definition if returned Speclib is containing continuous data or not.
response_function
If TRUE, the spectral response function of the sensor is used for integration, if FALSE a Gaussian distribution is assumed and if NA the mean value of spectra[min(ch):max(ch)] is calculated.

Value

Object of class Speclib

Details

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.

If sensor characteristics are defined manually, a Gaussian response is always assumed.

See Also

get.sensor.characteristics, get.gaussian.response

Examples

Run this code

## 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)

Run the code above in your browser using DataLab