spectralInterpolation: Interpolate spectra

View source: R/spectralInterpolation.R

spectralInterpolationR Documentation

Interpolate spectra

Description

Interpolate spectra to user defined bands. Currently, only a linear interpolation is supported

Usage

  spectralInterpolation(x, sensor) 

Arguments

x

Object of class Speclib.

sensor

data.frame containing definition of sensor characteristics. See details section for further information.

Details

The characteristics must 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.

Value

Object of class Speclib containing the updated version of x.

Author(s)

Lukas Lehnert

See Also

spectralResampling

Examples

## Load example data
data(spectral_data)
## Create sensor featuring 10 times higher spectral resolution
bounds <- seq(min(wavelength(spectral_data)),
              max(wavelength(spectral_data)), 
              length.out = nbands(spectral_data)*10)
sensor <- data.frame(lb = bounds[-1*100 + 1], ub = bounds[-1])
## Interpolate first spectrum
inter <- spectralInterpolation(spectral_data[1,], sensor = sensor)

hsdar documentation built on March 18, 2022, 6:35 p.m.