colour.recovery.MSDS_BASIS_FUNCTIONS_sRGB_MALLETT2019

colour.recovery.MSDS_BASIS_FUNCTIONS_sRGB_MALLETT2019 = MultiSpectralDistributions(name='Basis Functions - sRGB - Mallett 2019', ...)

the base object for multi spectral computations. It is used to model colour matching functions, display primaries, camera sensitivities, etc…

The multi-spectral distributions will be initialised according to CIE 15:2004 recommendation: the method developed by Sprague (1880) will be used for interpolating functions having a uniformly spaced independent variable and the Cubic Spline method for non-uniformly spaced independent variable. Extrapolation is performed according to CIE 167:2005 recommendation.

Important

Specific documentation about getting, setting, indexing and slicing the multi-spectral power distributions values is available in the Spectral Representation and Continuous Signal section.

Parameters
  • data (Series or Dataframe or Signal or MultiSignals or MultiSpectralDistributions or array_like or dict_like, optional) – Data to be stored in the multi-spectral distributions.

  • domain (array_like, optional) – Values to initialise the multiple colour.SpectralDistribution class instances colour.continuous.Signal.wavelengths attribute with. If both data and domain arguments are defined, the latter will be used to initialise the colour.continuous.Signal.wavelengths attribute.

  • labels (array_like, optional) – Names to use for the colour.SpectralDistribution class instances.

Other Parameters
  • name (unicode, optional) – Multi-spectral distributions name.

  • interpolator (object, optional) – Interpolator class type to use as interpolating function for the colour.SpectralDistribution class instances.

  • interpolator_kwargs (dict_like, optional) – Arguments to use when instantiating the interpolating function of the colour.SpectralDistribution class instances.

  • extrapolator (object, optional) – Extrapolator class type to use as extrapolating function for the colour.SpectralDistribution class instances.

  • extrapolator_kwargs (dict_like, optional) – Arguments to use when instantiating the extrapolating function of the colour.SpectralDistribution class instances.

  • strict_labels (array_like, optional) – Multi-spectral distributions labels for figures, default to colour.MultiSpectralDistributions.labels attribute value.

Attributes

Methods

References

[CIET13805a], [CIET13805c], [CIET14804h]

Examples

Instantiating the multi-spectral distributions with a uniformly spaced independent variable:

>>> from colour.utilities import numpy_print_options
>>> data = {
...     500: (0.004900, 0.323000, 0.272000),
...     510: (0.009300, 0.503000, 0.158200),
...     520: (0.063270, 0.710000, 0.078250),
...     530: (0.165500, 0.862000, 0.042160),
...     540: (0.290400, 0.954000, 0.020300),
...     550: (0.433450, 0.994950, 0.008750),
...     560: (0.594500, 0.995000, 0.003900)
... }
>>> labels = ('x_bar', 'y_bar', 'z_bar')
>>> with numpy_print_options(suppress=True):
...     MultiSpectralDistributions(data, labels=labels)
... 
MultiSpectral...([[ 500.     ,    0.0049 ,    0.323  ,    0.272  ],
             ...  [ 510.     ,    0.0093 ,    0.503  ,    0.1582 ],
             ...  [ 520.     ,    0.06327,    0.71   ,    0.07825],
             ...  [ 530.     ,    0.1655 ,    0.862  ,    0.04216],
             ...  [ 540.     ,    0.2904 ,    0.954  ,    0.0203 ],
             ...  [ 550.     ,    0.43345,    0.99495,    0.00875],
             ...  [ 560.     ,    0.5945 ,    0.995  ,    0.0039 ]],
             ... labels=[...'x_bar', ...'y_bar', ...'z_bar'],
             ... interpolator=SpragueInterpolator,
             ... interpolator_kwargs={},
             ... extrapolator=Extrapolator,
             ... extrapolator_kwargs={...})

Instantiating a spectral distribution with a non-uniformly spaced independent variable:

>>> data[511] = (0.00314, 0.31416, 0.03142)
>>> with numpy_print_options(suppress=True):
...     MultiSpectralDistributions(data, labels=labels)
... 
MultiSpectral...([[ 500.     ,    0.0049 ,    0.323  ,    0.272  ],
             ...  [ 510.     ,    0.0093 ,    0.503  ,    0.1582 ],
             ...  [ 511.     ,    0.00314,    0.31416,    0.03142],
             ...  [ 520.     ,    0.06327,    0.71   ,    0.07825],
             ...  [ 530.     ,    0.1655 ,    0.862  ,    0.04216],
             ...  [ 540.     ,    0.2904 ,    0.954  ,    0.0203 ],
             ...  [ 550.     ,    0.43345,    0.99495,    0.00875],
             ...  [ 560.     ,    0.5945 ,    0.995  ,    0.0039 ]],
             ... labels=[...'x_bar', ...'y_bar', ...'z_bar'],
             ... interpolator=CubicSplineInterpolator,
             ... interpolator_kwargs={},
             ... extrapolator=Extrapolator,
             ... extrapolator_kwargs={...})

Instantiation with a Pandas DataFrame:

>>> from colour.utilities import is_pandas_installed
>>> if is_pandas_installed():
...     from pandas import DataFrame
...     x_bar = [data[key][0] for key in sorted(data.keys())]
...     y_bar = [data[key][1] for key in sorted(data.keys())]
...     z_bar = [data[key][2] for key in sorted(data.keys())]
...     print(MultiSignals(  
...         DataFrame(
...             dict(zip(labels, [x_bar, y_bar, z_bar])), data.keys())))
[[  5.0000000...e+02   4.9000000...e-03   3.2300000...e-01   2.7200000...e-01]
 [  5.1000000...e+02   9.3000000...e-03   5.0300000...e-01   1.5820000...e-01]
 [  5.2000000...e+02   3.1400000...e-03   3.1416000...e-01   3.1420000...e-02]
 [  5.3000000...e+02   6.3270000...e-02   7.1000000...e-01   7.8250000...e-02]
 [  5.4000000...e+02   1.6550000...e-01   8.6200000...e-01   4.2160000...e-02]
 [  5.5000000...e+02   2.9040000...e-01   9.5400000...e-01   2.0300000...e-02]
 [  5.6000000...e+02   4.3345000...e-01   9.9495000...e-01   8.7500000...e-03]
 [  5.1100000...e+02   5.9450000...e-01   9.9500000...e-01   3.9000000...e-03]]
Type

Defines the multi-spectral distributions