colour.recovery.XYZ_to_sd_Meng2015

colour.recovery.XYZ_to_sd_Meng2015(XYZ, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), illuminant=SpectralDistribution(name='1 Constant', ...), optimisation_parameters=None)[source]

Recovers the spectral distribution of given CIE XYZ tristimulus values using Meng et al. (2015) method.

Parameters:
  • XYZ (array_like, (3,)) – CIE XYZ tristimulus values to recover the spectral distribution from.
  • cmfs (XYZ_ColourMatchingFunctions) – Standard observer colour matching functions. The wavelength \(\lambda_{i}\) range interval of the colour matching functions affects directly the time the computations take. The current default interval of 5 is a good compromise between precision and time spent.
  • illuminant (SpectralDistribution, optional) – Illuminant spectral distribution.
  • optimisation_parameters (dict_like, optional) – Parameters for scipy.optimize.minimize() definition.
Returns:

Recovered spectral distribution.

Return type:

SpectralDistribution

Notes

Domain Scale - Reference Scale - 1
XYZ [0, 1] [0, 1]
  • The definition used to convert spectrum to CIE XYZ tristimulus values is colour.colorimetry.spectral_to_XYZ_integration() definition because it processes any measurement interval opposed to colour.colorimetry.sd_to_XYZ_ASTME308() definition that handles only measurement interval of 1, 5, 10 or 20nm.

References

[Meng2015c]

Examples

>>> from colour.utilities import numpy_print_options
>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> cmfs = (
...     STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer'].
...     copy().align(SpectralShape(360, 780, 10))
... )
>>> sd = XYZ_to_sd_Meng2015(XYZ, cmfs)
>>> with numpy_print_options(suppress=True):
...     # Doctests skip for Python 2.x compatibility.
...     sd  # doctest: +SKIP
SpectralDistribution([[ 360.        ,    0.0780114...],
                      [ 370.        ,    0.0780316...],
                      [ 380.        ,    0.0780471...],
                      [ 390.        ,    0.0780351...],
                      [ 400.        ,    0.0779702...],
                      [ 410.        ,    0.0778033...],
                      [ 420.        ,    0.0770958...],
                      [ 430.        ,    0.0748008...],
                      [ 440.        ,    0.0693230...],
                      [ 450.        ,    0.0601136...],
                      [ 460.        ,    0.0477407...],
                      [ 470.        ,    0.0334964...],
                      [ 480.        ,    0.0193352...],
                      [ 490.        ,    0.0074858...],
                      [ 500.        ,    0.0001225...],
                      [ 510.        ,    0.       ...],
                      [ 520.        ,    0.       ...],
                      [ 530.        ,    0.       ...],
                      [ 540.        ,    0.0124896...],
                      [ 550.        ,    0.0389831...],
                      [ 560.        ,    0.0775105...],
                      [ 570.        ,    0.1247947...],
                      [ 580.        ,    0.1765339...],
                      [ 590.        ,    0.2281918...],
                      [ 600.        ,    0.2751347...],
                      [ 610.        ,    0.3140115...],
                      [ 620.        ,    0.3433561...],
                      [ 630.        ,    0.3635777...],
                      [ 640.        ,    0.3765428...],
                      [ 650.        ,    0.3841726...],
                      [ 660.        ,    0.3883633...],
                      [ 670.        ,    0.3905415...],
                      [ 680.        ,    0.3916742...],
                      [ 690.        ,    0.3922554...],
                      [ 700.        ,    0.3925427...],
                      [ 710.        ,    0.3926783...],
                      [ 720.        ,    0.3927330...],
                      [ 730.        ,    0.3927586...],
                      [ 740.        ,    0.3927548...],
                      [ 750.        ,    0.3927681...],
                      [ 760.        ,    0.3927813...],
                      [ 770.        ,    0.3927840...],
                      [ 780.        ,    0.3927536...]],
                     interpolator=SpragueInterpolator,
                     interpolator_args={},
                     extrapolator=Extrapolator,
                     extrapolator_args={...})
>>> sd_to_XYZ_integration(sd) / 100  # doctest: +ELLIPSIS
array([ 0.2065812...,  0.1219752...,  0.0514132...])