Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

interpolate_spectrum

Calculate spectral values at a different set of wavelengths


Description

Interpolate/re-express spectral irradiance (or other spectral quantity) values at new wavelengths values. This is a low-level function operating on numeric vectors and called by higher level functions in the package, such as mathematical operators for classes for spectral data.

Usage

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

Arguments

w.length.in

numeric vector of wavelengths (nm).

s.irrad

a numeric vector of spectral values.

w.length.out

numeric vector of wavelengths (nm).

fill

a value to be assigned to out of range wavelengths.

...

additional arguments passed to spline().

Value

a numeric vector 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.

See Also

Examples

my.w.length <- 300:700
with(sun.data, interpolate_spectrum(w.length, s.e.irrad, my.w.length))

photobiology

Photobiological Calculations

v0.10.10
GPL (>= 2)
Authors
Pedro J. Aphalo [aut, cre] (<https://orcid.org/0000-0003-3385-972X>), Titta K. Kotilainen [ctb] (<https://orcid.org/0000-0002-2822-9734>), Glenn Davis [ctb], Agnese Fazio [ctb]
Initial release
2022-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.