range_check_Tfr {photobiology} | R Documentation |
Internal utility range-check functions
Description
Functions used in the different check_spct()
methods.
Usage
range_check_Tfr(x, strict.range)
range_check_Afr(x, strict.range)
range_check_Rfr(x, strict.range)
range_check_A(x, strict.range)
range_check_cps(x, cps.cols, strict.range)
range_check_s.irrad(x, strict.range)
range_check_irrad.mult(x, strict.range)
Arguments
x |
Spectral object to check. |
strict.range |
logical indicating the stringency of the test. |
Details
If strict.range
is NULL
the test is skipped, if
NA
the failed test is reported using message()
, if
FALSE
, using warning()
and if TRUE
, using
stop()
. Currently the test condition and the message text is the
same in all cases.
The test is failed only if more than 1/250 spectral values are off-range,
except for cps_spct
objects where 1/100 negative spectral values
are tolerated. The test for off-range values includes a small tolerance
to avoid failure in cases of loss of numerical precision.
The criteria are empirical (almost arbitrary) and may be adjusted in future versions. The difficulty is that measured spectral data can be noisy even when valid and error-free.
Note
NULL
is passed as argument to strict.range
internally
by methods that do not modify the data, but instead subset them. This
improves performance.