resample_spc | R Documentation |
Resamples (interpolates) different spectra types with
corresponding x-axis values that are both stored in list-columns of a spectra
tibble. A spectra tibble hosts spectra, x-axis vectors, metadata, and
further linked data with standardized naming conventions. Data input for
resampling can for example be generated with simplerspec::gather_spc()
.
Resampling is a key harmonizing step to process and later model spectra
measured at different resolutions and spectral ranges (i.e., different
spectrometer devices and/or measurement settings).
resample_spc(
spc_tbl,
column_in = "spc",
x_unit = c("wavenumber", "wavelength"),
wn_lower = 500,
wn_upper = 4000,
wn_interval = 2,
wl_lower = 350,
wl_upper = 2500,
wl_interval = 1,
interpol_method = c("linear", "spline")
)
spc_tbl |
Spectra data embedded in a tibble object (classes
|
column_in |
Character vector of length 1L or symbol/name specifying the name of list-column that contains the spectra to be resampled. |
x_unit |
Character vector of length 1L specifying the measurement unit
of the x-axis values (list-column) of the input spectra in |
wn_lower |
Numeric value of lowest wavenumber. This argument will only
be used if |
wn_upper |
Numeric value of highest wavenumber. This argument will only
be used if |
wn_interval |
Numeric value of the wavenumber increment for the new wavenumber sequence that the spectra will be resampled upon. Default value is 2 (i.e., in reciprocal centimeters). |
wl_lower |
Numeric value of lowest wavelength. This argument will only
be used if |
wl_upper |
Numeric value of highest wavelength. This argument will only
be used if |
wl_interval |
Numeric value of the wavelength increment for the new
wavenumber sequence that the spectra will be resampled upon. This argument
will only be used if |
interpol_method |
Character of |
A spectra tibble (spc_tbl
) containing two added list-columns:
spc_rs:
Resampled spectra as list of data.table
s
wavenumbers_rs
or wavelengths_rs
: Resampled x-axis values as list of
numeric vectors
The combinations of input spectrum types (column_in
) and
corresponding x-axis types are generated from a simple lookup list. The
following key-value(s) pairs can be matched at given key, which is the column
name from column_in
containing the spectra.
"spc"
: "wavenumbers"
or "wavelengths"
(raw spectra)
"spc_rs"
: "wavenumbers_rs"
or "wavelengths_rs"
) (resampled spectra)
"spc_mean"
: "wavenumbers_rs"
or "wavelengths_rs"
(mean spectra)
"spc_nocomp"
"wavenumbers"
or "wavelengths"
(spectra prior
atmospheric compensation)
"sc_sm" : c("wavenumbers_sc_sm", "wavelengths_sc_sm")
(single channel
sample spectra)
"sc_rf" : c("wavenumbers_sc_rf", "wavelengths_sc_rf")
(single channel
reference spectra)
"spc_pre" : "xvalues_pre"
(preprocessed spectra)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.