insert_spct_hinges: Insert new wavelength values into a spectrum

View source: R/spct.insert.spct.hinges.r

insert_spct_hingesR Documentation

Insert new wavelength values into a spectrum

Description

Insert new wavelength values into a spectrum interpolating the corresponding spectral data values.

Usage

insert_spct_hinges(spct, hinges = NULL, byref = FALSE)

Arguments

spct

an object of class "generic_spct"

hinges

numeric vector of wavelengths (nm) at which the s.irrad should be inserted by interpolation, no interpolation is indicated by an empty vector (numeric(0))

byref

logical indicating if new object will be created by reference or by copy of spct

Value

a generic_spct or a derived type with variables w.length and other numeric variables.

Note

Inserting wavelengths values "hinges" immediately before and after a discontinuity in the SWF, greatly reduces the errors caused by interpolating the weighted irradiance during integration of the effective spectral irradiance. This is specially true when data has a large wavelength step size.

Examples


insert_spct_hinges(sun.spct, c(399.99,400.00,699.99,700.00))
insert_spct_hinges(sun.spct,
                   c(199.99,200.00,399.50,399.99,400.00,699.99,
                         700.00,799.99,1000.00))

photobiology documentation built on Oct. 21, 2023, 1:06 a.m.