Learn R Programming

photobiology (version 0.11.3)

illuminance: 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, ...)

# S3 method for default illuminance(spct, std, scale.factor, allow.scaled, ...)

# S3 method for source_spct illuminance( spct, std = "CIE2deg", scale.factor = 1, allow.scaled = FALSE, naming = "default", ... )

# S3 method for source_mspct illuminance( spct, std = "CIE2deg", scale.factor = 1, allow.scaled = FALSE, naming = "default", ..., attr2tb = NULL, idx = "spct.idx", .parallel = FALSE, .paropts = NULL )

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.

Arguments

spct

an R object.

std

character The luminous efficiency function to use, "CIE2deg" or "CIE10deg".

scale.factor

numeric vector of length 1, or the character string exposure.

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 "long", "default", "short" or "none". Used to select the type of names to assign to returned value.

attr2tb

character vector, see add_attr2tb for the syntax for attr2tb passed as is to formal parameter col.names.

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.

Methods (by class)

  • illuminance(default): Default for generic function

  • illuminance(source_spct): Calculates illuminance from a source_spct object.

  • illuminance(source_mspct): Calculates illuminance from a source_mspct object.

References

Stockman, A. (2019) Cone fundamentals and CIE standards. Current Opinion in Behavioral Sciences, 30, 87-93. tools:::Rd_expr_doi("10.1016/j.cobeha.2019.06.005")

Examples

Run this code
illuminance(sun.spct)
illuminance(sun.daily.spct)
illuminance(sun.daily.spct, scale.factor = "exposure")
illuminance(sun.daily.spct, scale.factor = 1e-3)

Run the code above in your browser using DataLab