colour.characterisation.training_data_sds_to_XYZ

colour.characterisation.training_data_sds_to_XYZ(training_data, cmfs, illuminant, chromatic_adaptation_transform='CAT02')[source]

Converts given training data to CIE XYZ tristimulus values using given illuminant and given standard observer colour matching functions.

Parameters
  • training_data (MultiSpectralDistributions) – Training data multi-spectral distributions.

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

  • illuminant (SpectralDistribution) – Illuminant spectral distribution.

  • chromatic_adaptation_transform (unicode, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02 Brill 2008’, ‘Bianco 2010’, ‘Bianco PC 2010’, None}, Chromatic adaptation transform, if None no chromatic adaptation is performed.

Returns

Training data CIE XYZ tristimulus values.

Return type

ndarray

Examples

>>> path = os.path.join(
...     RESOURCES_DIRECTORY_RAWTOACES,
...     'CANON_EOS_5DMark_II_RGB_Sensitivities.csv')
>>> cmfs = MSDS_CMFS['CIE 1931 2 Degree Standard Observer']
>>> sensitivities = sds_and_msds_to_msds(
...     read_sds_from_csv_file(path).values())
>>> illuminant = normalise_illuminant(
...     SDS_ILLUMINANTS['D55'], sensitivities)
>>> training_data = read_training_data_rawtoaces_v1()
>>> training_data_sds_to_XYZ(training_data, cmfs, illuminant)[:5]
... 
array([[ 0.0174353...,  0.0179504...,  0.0196109...],
       [ 0.0855607...,  0.0895735...,  0.0901703...],
       [ 0.7455880...,  0.7817549...,  0.7834356...],
       [ 0.1900528...,  0.1995   ...,  0.2012606...],
       [ 0.5626319...,  0.5914544...,  0.5894500...]])