colour.colorimetry.handle_spectral_arguments#
- colour.colorimetry.handle_spectral_arguments(cmfs: colour.colorimetry.spectrum.MultiSpectralDistributions | None = None, illuminant: colour.colorimetry.spectrum.SpectralDistribution | None = None, cmfs_default: str = 'CIE 1931 2 Degree Standard Observer', illuminant_default: str = 'D65', shape_default: colour.colorimetry.spectrum.SpectralShape = SPECTRAL_SHAPE_DEFAULT, issue_runtime_warnings: bool = True) Tuple[colour.colorimetry.spectrum.MultiSpectralDistributions, colour.colorimetry.spectrum.SpectralDistribution] [source]#
Handle the spectral arguments of various Colour definitions performing spectral computations.
If
cmfs
is not given, one is chosen according tocmfs_default
. The returned colour matching functions adopt the spectral shape given byshape_default
.If
illuminant
is not given, one is chosen according toilluminant_default
. The returned illuminant adopts the spectral shape of the returned colour matching functions.If
illuminant
is given, the returned illuminant spectral shape is aligned to that of the returned colour matching functions.
- Parameters
cmfs (colour.colorimetry.spectrum.MultiSpectralDistributions | None) – Standard observer colour matching functions, default to the CIE 1931 2 Degree Standard Observer.
illuminant (colour.colorimetry.spectrum.SpectralDistribution | None) – Illuminant spectral distribution, default to CIE Standard Illuminant D65.
cmfs_default (str) – The default colour matching functions to use if
cmfs
is not given.illuminant_default (str) – The default illuminant to use if
illuminant
is not given.shape_default (colour.colorimetry.spectrum.SpectralShape) – The default spectral shape to align the final colour matching functions and illuminant.
issue_runtime_warnings (bool) – Whether to issue the runtime warnings.
- Returns
Colour matching functions and illuminant.
- Return type
Examples
>>> cmfs, illuminant = handle_spectral_arguments() >>> cmfs.name, cmfs.shape, illuminant.name, illuminant.shape ('CIE 1931 2 Degree Standard Observer', SpectralShape(360.0, 780.0, 1.0), 'D65', SpectralShape(360.0, 780.0, 1.0)) >>> cmfs, illuminant = handle_spectral_arguments( ... shape_default=SpectralShape(400, 700, 20) ... ) >>> cmfs.name, cmfs.shape, illuminant.name, illuminant.shape ('CIE 1931 2 Degree Standard Observer', SpectralShape(400.0, 700.0, 20.0), 'D65', SpectralShape(400.0, 700.0, 20.0))