illuminance {photobiology} | R Documentation |
Irradiance
Description
Computes illuminance (lux), or the luminous flux incident on a surface, from
spectral irradiance stored in a source_spct
object.
Usage
illuminance(spct, std, scale.factor, allow.scaled, ...)
## Default S3 method:
illuminance(spct, std, scale.factor, allow.scaled, ...)
## S3 method for class 'source_spct'
illuminance(
spct,
std = "CIE2deg",
scale.factor = 1,
allow.scaled = FALSE,
naming = "default",
...
)
## S3 method for class 'source_mspct'
illuminance(
spct,
std = "CIE2deg",
scale.factor = 1,
allow.scaled = FALSE,
naming = "default",
...,
attr2tb = NULL,
idx = "spct.idx",
.parallel = FALSE,
.paropts = NULL
)
Arguments
spct |
an R object. |
std |
character The luminous efficiency function to use,
|
scale.factor |
numeric vector of length 1, or the character string
|
allow.scaled |
logical indicating whether scaled or normalized spectra as argument to spct are flagged as an error. |
... |
other arguments (possibly ignored) |
naming |
character one of |
attr2tb |
character vector, see |
idx |
character Name of the column with the names of the members of the collection of spectra. |
.parallel |
if TRUE, apply function in parallel, using parallel backend provided by foreach. |
.paropts |
a list of additional options passed into the foreach function when parallel computation is enabled. This is important if (for example) your code relies on external data or packages: use the .export and .packages arguments to supply them so that all cluster nodes have the correct environment set up for computing. |
Value
A named numeric
vector of length one in the case of methods
for individual spectra. A data.frame
in the case of collections of
spectra, containing one column with illuminance, an index column with the
names of the spectra, and optionally additional columns with metadata
values retrieved from the attributes of the member spectra.
The time.unit
attribute is always second. Units are as follows: if
time.unit of the argument passed to spct
is second, [W m-2 nm-1] ->
[lx], otherwise average value [lx] for the period unless
exposure = TRUE
.
Methods (by class)
-
illuminance(default)
: Default for generic function -
illuminance(source_spct)
: Calculates illuminance from asource_spct
object. -
illuminance(source_mspct)
: Calculates illuminance from asource_mspct
object.
Note
Formal parameter allow.scaled
is used internally for calculation
of ratios, as rescaling and normalization do not invalidate the calculation
of ratios within one spectrum.
References
Stockman, A. (2019) Cone fundamentals and CIE standards. Current Opinion in Behavioral Sciences, 30, 87-93. doi:10.1016/j.cobeha.2019.06.005
Examples
illuminance(sun.spct)
illuminance(sun.daily.spct)
illuminance(sun.daily.spct, scale.factor = "exposure")
illuminance(sun.daily.spct, scale.factor = 1e-3)