spectrace_interpolate_spectra: Interpolate spectral data

View source: R/spectrace_interpolate_spectra.R

spectrace_interpolate_spectraR Documentation

Interpolate spectral data

Description

This function interpolates Spectrace's spectral irradiance output to visible range (380-780nm) with 1nm or 5nm resolution.

Usage

spectrace_interpolate_spectra(
  lightData,
  resolution = c("5nm", "1nm", "spectrace"),
  interp_method = c("pchip", "linear")
)

Arguments

lightData

Data frame containing the calibrated light data for the channels from 410nm to 730nm. Additional variables are allowed. Data needs to be in wide format (see spectrace_to_wide).

resolution

String specifying the resolution of the output spectrum. Can be "5nm" (default), "1nm", or "spectrace". The latter will result in the original 14 spectrace channels.

interp_method

The interpolation method. Can be either "pchip" (default) or "linear". Pchip (piecewise cubic hermetic interpolation) results in a smooth spectrum while preserving the source values as local minima/maxima.

Value

The original data frame with the spectral data replaced by the interpolated spectral data.


steffenhartmeyer/spectrace documentation built on Dec. 4, 2024, 4:13 p.m.