color_matching_x#

colorsynth.color_matching_x(wavelength)[source]#

The CIE 1931 \(\overline{x}(\lambda)\) color matching function.

Calculated using the piecewise Gaussian fit method described in Wyman et al. [2013]

Parameters:

wavelength (Quantity) – the wavelengths at which to evaluate the color-matching function

Return type:

Quantity

Examples

Plot \(\overline{x}(\lambda)\) over the entire human visible wavelength range

import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
import astropy.visualization
import colorsynth

wavelength = np.linspace(380, 780, num=101) * u.nm
xbar = colorsynth.color_matching_x(wavelength)

with astropy.visualization.quantity_support():
    plt.figure()
    plt.plot(wavelength, xbar)
../_images/colorsynth.color_matching_x_0_0.png