Convert luxR reflectance to a photobiology reflector_spct
Source:R/photobiology_interop.R
as_reflector_spct.RdBridges a reflectance lux_spectrum into photobiology as a
reflector_spct. luxR already constrains reflectance to [0, 1],
so values map onto Rfr directly.
Usage
as_reflector_spct(x, ...)
# S3 method for class 'lux_spectrum'
as_reflector_spct(x, Rfr.type = NULL, strict.range = TRUE, ...)
# S3 method for class 'list'
as_reflector_spct(x, ...)Arguments
- x
A reflectance
lux_spectrum, or a (named) list of them.- ...
Passed to
photobiology::reflector_spct().- Rfr.type
Either
"total"or"specular". Defaults tox$meta$Rfr_type; an error is raised if neither is supplied.- strict.range
Passed to
photobiology::reflector_spct(). Defaults toTRUE.
Details
Rfr.type is required. Whether a reflectance is total or specular is a
fact about how it was measured, which luxR does not otherwise carry;
defaulting it would silently mislabel the measurement inside another
package's ecosystem. Record it once in the spectrum's
meta$Rfr_type to have it picked up automatically.