Learn R Programming

photobiology (version 0.9.6)

interpolate_spectrum: Calculate spectral values at a different set of wavelengths

Description

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

Usage

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

Examples

Run this code
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)

Run the code above in your browser using DataLab