# colour.colorimetry.multi_sds_to_XYZ_integration¶

colour.colorimetry.multi_sds_to_XYZ_integration(msd, shape, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), illuminant=SpectralDistribution(name='1 Constant', ...), k=None)[source]

Converts given multi-spectral distribution array $$msd$$ with given spectral shape to CIE XYZ tristimulus values using given colour matching functions and illuminant.

Parameters: msa (array_like) – Multi-spectral distribution array $$msd$$, the wavelengths are expected to be in the last axis, e.g. for a 512x384 multi-spectral image with 77 bins, msd shape should be (384, 512, 77). shape (SpectralShape, optional) – Spectral shape of the multi-spectral distribution array $$msd$$, cmfs and illuminant will be aligned with it. cmfs (XYZ_ColourMatchingFunctions) – Standard observer colour matching functions. illuminant (SpectralDistribution, optional) – Illuminant spectral distribution. k (numeric, optional) – 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. CIE XYZ tristimulus values, for a 512x384 multi-spectral image with 77 bins, the output shape will be (384, 512, 3). array_like

Notes

Range Scale - Reference Scale - 1
XYZ [0, 100] [0, 1]

References

[WS00f]

Examples

>>> from colour import ILLUMINANTS_SDS
>>> msd = np.array([
...     [
...         [0.0137, 0.0913, 0.0152, 0.0281, 0.1918, 0.0430],
...         [0.0159, 0.3145, 0.0842, 0.0907, 0.7103, 0.0437],
...         [0.0096, 0.2582, 0.4139, 0.2228, 0.0041, 0.3744],
...         [0.0111, 0.0709, 0.0220, 0.1249, 0.1817, 0.0020],
...         [0.0179, 0.2971, 0.5630, 0.2375, 0.0024, 0.5819],
...         [0.1057, 0.4620, 0.1918, 0.5625, 0.4209, 0.0027],
...     ],
...     [
...         [0.0433, 0.2683, 0.2373, 0.0518, 0.0118, 0.0823],
...         [0.0258, 0.0831, 0.0430, 0.3230, 0.2302, 0.0081],
...         [0.0248, 0.1203, 0.0054, 0.0065, 0.1860, 0.3625],
...         [0.0186, 0.1292, 0.0079, 0.4006, 0.9404, 0.3213],
...         [0.0310, 0.1682, 0.3719, 0.0861, 0.0041, 0.7849],
...         [0.0473, 0.3221, 0.2268, 0.3161, 0.1124, 0.0024],
...     ],
... ])
>>> D65 = ILLUMINANTS_SDS['D65']
>>> multi_sds_to_XYZ(
... msd, SpectralShape(400, 700, 60), illuminant=D65)
... # doctest: +ELLIPSIS
array([[[  7.1958378...,   3.8605390...,  10.1016398...],
[ 25.5738615...,  14.7200581...,  34.8440007...],
[ 17.5854414...,  28.5668344...,  30.1806687...],
[ 11.3271912...,   8.4598177...,   7.9015758...],
[ 19.6581831...,  35.5918480...,  35.1430220...],
[ 45.8212491...,  39.2600939...,  51.7907710...]],
<BLANKLINE>
[[  8.8287837...,  13.3870357...,  30.5702050...],
[ 22.3324362...,  18.9560919...,   9.3952305...],
[  6.6887212...,   2.5728891...,  13.2618778...],
[ 41.8166227...,  27.1191979...,  14.2627944...],
[  9.2414098...,  20.2056200...,  20.1992502...],
[ 24.7830551...,  26.2221584...,  36.4430633...]]])