interpolate_spectrum: Calculate spectral values at a different set of wavelengths

Description Usage Arguments Value Note Examples

View source: R/interpolate.spectrum.R

Description

For example interpolate spectral irradiance (or spectral transmittance) values at new wavelengths values.

Usage

1
interpolate_spectrum(w.length.in, s.irrad, w.length.out, fill = NA)

Arguments

w.length.in

numeric array of wavelengths (nm)

s.irrad

a numeric array of spectral values

w.length.out

numeric array of wavelengths (nm)

fill

a value to be assigned to out of range wavelengths

Value

a numeric array of interpolated spectral values

Note

The current version of interpolate uses spline if fewer than 25 data points are available. Otherwise it uses approx. In the first case a cubic spline is used, in the second case linear interpolation, which should be faster.

Examples

1
2
3
4
5
my.w.length <- 300:700
my.s.e.irrad <-
  with(sun.data, interpolate_spectrum(w.length, s.e.irrad, my.w.length))
plot(my.s.e.irrad ~ my.w.length)
lines(s.e.irrad ~ w.length, data=sun.data)

photobiology documentation built on May 19, 2017, 9:54 p.m.

Search within the photobiology package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.