Photoreceptor sensitivity matrix for colourvision
Source:R/colourvision_interop.R
species_sensitivity_matrix.RdAssembles a species' validated chromatic receptors into the sensitivity
matrix C that colourvision models consume (a data frame whose
first column is wavelength and whose remaining columns are one photoreceptor
each). The receptors and their Govardovskii templates are exactly those
colour_jnd uses, so a colourvision model built on this matrix
reproduces luxR's own quantum catches.
Arguments
- species
Character scalar naming a species in
species_sensitivitieswith at least one validated chromatic receptor.- lambda
Numeric wavelength grid (nm); must be finite, strictly increasing, and unique. Defaults to
seq(300, 700, 1), colourvision's defaultnm.- receptor
Optional character vector selecting a subset of the species' validated chromatic receptors; passed through to the same channel resolution
colour_jnduses.- weight
One of
"photon"(default, columns \(S\lambda\)) or"energy"(columns \(S\)).
Value
A data.frame with a wl column plus one column per
receptor, named and ordered as luxR's channel definitions.
Details
luxR integrates photon catch (proportional to \(E\lambda\)) while
colourvision integrates energy (\(\int I R C\)). With
weight = "photon" (the default) the columns are the sensitivities
multiplied by wavelength (\(S\lambda\)), so colourvision's energy integral
reproduces luxR's photon catch; the proportionality constant cancels in the
log RNL model. Use weight = "energy" for the raw sensitivities.