colour.colorimetry.sd_to_XYZ_ASTME308

colour.colorimetry.sd_to_XYZ_ASTME308(sd, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), illuminant=SpectralDistribution(name='1 Constant', ...), use_practice_range=True, mi_5nm_omission_method=True, mi_20nm_interpolation_method=True, k=None)[source]

Converts given spectral distribution to CIE XYZ tristimulus values using given colour matching functions and illuminant according to practise ASTM E308-15 method.

Parameters
  • sd (SpectralDistribution) – Spectral distribution.

  • cmfs (XYZ_ColourMatchingFunctions) – Standard observer colour matching functions.

  • illuminant (SpectralDistribution, optional) – Illuminant spectral distribution.

  • use_practice_range (bool, optional) – Practise ASTM E308-15 working wavelengths range is [360, 780], if True this argument will trim the colour matching functions appropriately.

  • mi_5nm_omission_method (bool, optional) – 5 nm measurement intervals spectral distribution conversion to tristimulus values will use a 5 nm version of the colour matching functions instead of a table of tristimulus weighting factors.

  • mi_20nm_interpolation_method (bool, optional) – 20 nm measurement intervals spectral distribution conversion to tristimulus values will use a dedicated interpolation method instead of a table of tristimulus weighting factors.

  • k (numeric, optional) – Normalisation constant \(k\). For reflecting or transmitting object colours, \(k\) is chosen so that \(Y = 100\) for objects for which the spectral reflectance factor \(R(\lambda)\) of the object colour or the spectral transmittance factor \(\tau(\lambda)\) of the object is equal to unity for all wavelengths. For self-luminous objects and illuminants, the constants \(k\) is usually chosen on the grounds of convenience. If, however, in the CIE 1931 standard colorimetric system, the \(Y\) value is required to be numerically equal to the absolute value of a photometric quantity, the constant, \(k\), must be put equal to the numerical value of \(K_m\), the maximum spectral luminous efficacy (which is equal to 683 \(lm\cdot W^{-1}\)) and \(\Phi_\lambda(\lambda)\) must be the spectral concentration of the radiometric quantity corresponding to the photometric quantity required.

Returns

CIE XYZ tristimulus values.

Return type

ndarray, (3,)

Warning

  • The tables of tristimulus weighting factors are cached in colour.colorimetry.tristimulus._TRISTIMULUS_WEIGHTING_FACTORS_CACHE attribute. Their identifier key is defined by the colour matching functions and illuminant names along with the current shape and normalisation constant \(k\) such as: CIE 1964 10 Degree Standard Observer, A, (360.0, 830.0, 10.0), None Considering the above, one should be mindful that using similar colour matching functions and illuminant names but with different spectral data will lead to unexpected behaviour.

Notes

Range

Scale - Reference

Scale - 1

XYZ

[0, 100]

[0, 1]

References

[ASTMInternational15]

Examples

>>> from colour import (
...     CMFS, ILLUMINANTS_SDS, SpectralDistribution)
>>> cmfs = CMFS['CIE 1931 2 Degree Standard Observer']
>>> data = {
...     400: 0.0641,
...     420: 0.0645,
...     440: 0.0562,
...     460: 0.0537,
...     480: 0.0559,
...     500: 0.0651,
...     520: 0.0705,
...     540: 0.0772,
...     560: 0.0870,
...     580: 0.1128,
...     600: 0.1360,
...     620: 0.1511,
...     640: 0.1688,
...     660: 0.1996,
...     680: 0.2397,
...     700: 0.2852
... }
>>> sd = SpectralDistribution(data)
>>> illuminant = ILLUMINANTS_SDS['D65']
>>> sd_to_XYZ_ASTME308(sd, cmfs, illuminant)
... 
array([ 10.8399031...,   9.6840375...,   6.2164159...])