colour.colorimetry.sd_to_XYZ_ASTME308#

colour.colorimetry.sd_to_XYZ_ASTME308(sd: SpectralDistribution, cmfs: = None, illuminant: = None, use_practice_range: bool = True, mi_5nm_omission_method: bool = True, mi_20nm_interpolation_method: bool = True, k: Optional[Number] = None) [source]#

Convert 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 (Optional[MultiSpectralDistributions]) – Standard observer colour matching functions, default to the CIE 1931 2 Degree Standard Observer.

• illuminant (Optional[SpectralDistribution]) – Illuminant spectral distribution, default to CIE Illuminant E.

• use_practice_range (bool) – 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) – 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) – 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 (Optional[Number]) – 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:

numpy.ndarray

Notes

Range

Scale - Reference

Scale - 1

XYZ

[0, 100]

[0, 1]

• When $$k$$ is set to a value other than None, the computed CIE XYZ tristimulus values are assumed to be absolute and are thus converted from percentages by a final division by 100.

References

Examples

>>> from colour import MSDS_CMFS, SDS_ILLUMINANTS, SpectralDistribution
>>> cmfs = MSDS_CMFS["CIE 1931 2 Degree Standard Observer"]
>>> illuminant = SDS_ILLUMINANTS["D65"]
>>> shape = SpectralShape(400, 700, 20)
>>> data = np.array(
...     [
...         0.0641,
...         0.0645,
...         0.0562,
...         0.0537,
...         0.0559,
...         0.0651,
...         0.0705,
...         0.0772,
...         0.0870,
...         0.1128,
...         0.1360,
...         0.1511,
...         0.1688,
...         0.1996,
...         0.2397,
...         0.2852,
...     ]
... )
>>> sd = SpectralDistribution(data, shape)
>>> sd_to_XYZ_ASTME308(sd, cmfs, illuminant)
...
array([ 10.8401953...,   9.6841740...,   6.2158913...])


The default CMFS are the CIE 1931 2 Degree Standard Observer, and the default illuminant is CIE Illuminant E:

>>> sd_to_XYZ_ASTME308(sd)
...
array([ 11.7781589...,   9.9585580...,   5.7408602...])