# lightSpectra: compute standard light spectra In colorSpec: Color Calculations with Emphasis on Spectral Data

## Description

Two families of standard illuminants that depend on temperature are the Planckian spectra (black-body spectra), and daylight spectra. For the daylight spectra, a smoothed version is available. Illuminant E, a third and trivial spectrum, is also available.

## Usage

 ```1 2 3 4 5 6``` ```planckSpectra( temperature, wavelength=300:830, normalize=TRUE, c2=1.4388e7 ) daylightSpectra( temperature, wavelength=NULL, components=colorSpec::daylight1964, roundMs=FALSE ) illuminantE( energy=1, wavelength=380:780 ) ```

## Arguments

 `temperature` a vector of temperatures, in Kelvin `wavelength` a vector of wavelengths. For `planckSpectra()` and `illuminantE()` this is required. For `daylightSpectra()` this is optional. The default `wavelength=NULL` means to use the wavelengths in `components`, and otherwise `components` is resampled at the given `wavelength` vector. `normalize` a logical value. If `TRUE` the Planck spectra are normalized to have value 1 at 560nm. If `FALSE` then the quantity returned is radiant exitance with unit W * m^{-2} * nm^{-1}. `c2` the value of h*c/k in Planck's law. h is the Planck constant; c is the speed of light; and k is the Boltzmann constant. The default value of 1.4388e7 nm*K was recommended by the CIE in 2005; in 1986 the CIE recommended `c2`=1.438e7. If `c2='calc'` then `c2` is calculated directly from the 3 physical constants. `components` a colorSpec object with the daylight components S_0, S_1, and S_2. The default is `daylight1964` and a smoothed version `daylight2013` is also available. `roundMs` a logical value. The original CIE method for the daylight spectra requires rounding intermediate coefficients M1 and M2 to 3 decimal places. This rounding is necessary to reproduce the tabulated values in Table T.1 of the CIE publication in References. `energy` a vector of energy levels

## Details

For `daylightSpectra()` the valid range of temperatures is 4000 to 25000 K. For a temperature outside this range the spectrum is set to all `NA`s.

The equations for `daylightSpectra()` and `planckSpectra()` are complex and can be found in the References.

`IlluminantE()` is trivial - all constant energy.

## Value

For `planckSpectra()` and `daylightSpectra()` :
A colorSpec object with `quantity` equal to `'energy'`, and `organization` equal to `'matrix'` or `'vector'`. The `specname`s are `PNNNN` or `DNNNN` for `planckSpectra()` and `daylightSpectra()` respectively.
The number of spectra in the object is the number of temperatures = `length(temperature)`.

For `illuminantE()` :
A colorSpec object with `quantity` equal to `'energy'`.
The number of spectra in the object is the number of energy levels = `length(energy)`.

## References

Günther Wyszecki and W.S. Stiles. Color Science : Concepts and Methods, Quantitative Data and Formulae. Second Edition. Wiley-Interscience. 1982. page 146.

CIE 15: Technical Report: Colorimetry, 3rd edition. CIE 15:2004. Table T.1, pp 30-32, and Note 5 on page 69.

Schanda, Janos. CIE Colorimetry, in Colorimetry: Understanding the CIE System. Wiley Interscience. 2007. p. 42.

daylight, `resample`, `organization`, `quantity`, materialSpectra