colour.characterisation.training_data_sds_to_XYZ#

colour.characterisation.training_data_sds_to_XYZ(training_data: MultiSpectralDistributions, cmfs: MultiSpectralDistributions, illuminant: SpectralDistribution, chromatic_adaptation_transform: Optional[Union[Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02 Brill 2008', 'CAT02', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'], str]] = 'CAT02') ndarray[source]#

Convert 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 (MultiSpectralDistributions) – Standard observer colour matching functions.

  • illuminant (SpectralDistribution) – Illuminant spectral distribution.

  • chromatic_adaptation_transform (Optional[Union[Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02 Brill 2008', 'CAT02', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'], str]]) – Chromatic adaptation transform, if None no chromatic adaptation is performed.

Returns:

Training data CIE XYZ tristimulus values.

Return type:

numpy.ndarray

Examples

>>> from colour import MSDS_CMFS
>>> 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...]])