| interpolate_spectrum {photobiology} | R Documentation |
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.
interpolate_spectrum(w.length.in, s.irrad, w.length.out, fill = NA, ...)
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 |
a numeric vector of interpolated spectral values.
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.
Other low-level functions operating on numeric vectors.: as_energy,
as_quantum_mol,
calc_multipliers,
div_spectra,
energy_irradiance,
energy_ratio, insert_hinges,
integrate_xy, irradiance,
l_insert_hinges,
oper_spectra,
photon_irradiance,
photon_ratio,
photons_energy_ratio,
prod_spectra, s_e_irrad2rgb,
split_energy_irradiance,
split_photon_irradiance,
subt_spectra, sum_spectra,
trim_tails, v_insert_hinges
my.w.length <- 300:700 with(sun.data, interpolate_spectrum(w.length, s.e.irrad, my.w.length))