colour.colorimetry.spectral_to_XYZ_ASTME30815

colour.colorimetry.spectral_to_XYZ_ASTME30815(spd, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), illuminant=SpectralPowerDistribution(name='1 Constant', ...), use_practice_range=True, mi_5nm_omission_method=True, mi_20nm_interpolation_method=True)[source]

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

Parameters:
  • spd (SpectralPowerDistribution) – Spectral power distribution.
  • cmfs (XYZ_ColourMatchingFunctions) – Standard observer colour matching functions.
  • illuminant (SpectralPowerDistribution, optional) – Illuminant spectral power 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 power 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 power distribution conversion to tristimulus values will use a dedicated interpolation method instead of a table of tristimulus weighting factors.
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 the current shape such as: CIE 1964 10 Degree Standard Observer, A, (360.0, 830.0, 10.0) 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.
  • The output range of that definition is non standard!

Notes

  • Output CIE XYZ tristimulus values are in range [0, 100].

References

Examples

>>> from colour import (
...     CMFS, ILLUMINANTS_RELATIVE_SPDS, SpectralPowerDistribution)
>>> 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
... }
>>> spd = SpectralPowerDistribution(data)
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS['D50']
>>> spectral_to_XYZ_ASTME30815(spd, cmfs, illuminant)
... 
array([ 11.5290265...,   9.9502091...,   4.7098882...])