colorsynth#
Create false-color images from spectral cubes.
colorsynth collapses the spectral axis of a numpy.ndarray
into red, green, and blue channels that can be displayed on a computer
monitor.
The spectrum at every point is mapped into the human visible range,
weighted by the CIE 1931 color-matching functions, integrated along the
spectral axis, and converted to the sRGB color space, so that the shape of
the spectrum controls the hue of each pixel and the total intensity
controls its brightness.
The main entry points are colorsynth.rgb(), which converts a spectral
cube into an RGB image that can be displayed with
matplotlib.pyplot.imshow() or matplotlib.pyplot.pcolormesh(),
and colorsynth.rgb_and_colorbar(), which additionally computes a 2D
colorbar relating color to wavelength and intensity.
Functions
|
Convert from a CIE \(xyY\) color space to a \(XYZ\) color space |
|
Normalize the luminance of a vector in the CIE 1931 \(XYZ\) color space. |
|
Calculate the CIE 1931 tristimulus values, \(XYZ\), for the given spectral power distribution. |
|
The CIE 1931 \(\overline{x}(\lambda)\) color matching function. |
|
The CIE 1931 \(\overline{x}(\lambda)\), \(\overline{y}(\lambda)\), and \(\overline{z}(\lambda)\) color matching functions. |
|
The CIE 1931 \(\overline{y}(\lambda)\) color matching function. |
|
The CIE 1931 \(\overline{z}(\lambda)\) color matching function. |
|
Calculate the colorbar corresponding to calling |
|
Spectral power distribution (SPD) of the CIE standard illuminant D65, which corresponds to average midday light in Western/Northern Europe. |
|
Convert a given spectral power distribution into a RGB array that can be plotted with matplotlib. |
|
Convenience function that calls |
|
Convert CIE 1931 tristimulus values, calculated using |
|
Convert from a CIE \(XYZ\) color space to a \(xyY\) color space |