check_wl_stepsize | R Documentation |
Check consistency of wavelength step size
check_wl_stepsize(x, span = Inf)
x |
numeric vector. Hint: to find valleys, change the sign of the
argument with the unary operator |
span |
odd integer A peak is defined as an element in a sequence which
is greater than all other elements within a moving window of width
|
As the search for peaks uses a window based on a fixed number of
observations at neighbouring wavelengths, if the wavelength step between
observations varies drastically, the window expressed in nanometres of
wavelength becomes very irregular. With the default span = 5
in
peaks()
, valleys()
, and wls_at_target()
the
search in most cases still works for "thinned" spectra, and the check is
skipped. With spikes()
and despike()
methods the check is
always done as these methods do not override span = Inf
.
The typical case when the step can vary strongly are spectra returned by
thin_wl()
. As when using default arguments thin_wl()
retains
the original local maxima, and a reasonably narrow wavelength maximum step
a call to peaks
with span = NULL
or span = 5
tends to discover the original peaks missing at most a few.
logical TRUE
if check is passed and otherwise FALSE
with a warning.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.