colour.colorimetry.reshape_sd#
- colour.colorimetry.reshape_sd(sd: colour.colorimetry.spectrum.TypeSpectralDistribution, shape: colour.colorimetry.spectrum.SpectralShape = SPECTRAL_SHAPE_DEFAULT, method: Union[Literal['Align', 'Extrapolate', 'Interpolate', 'Trim'], str] = 'Align', copy: bool = True, **kwargs: Any) colour.colorimetry.spectrum.TypeSpectralDistribution [source]#
Reshape given spectral distribution with given spectral shape.
The reshaped object is cached, thus another call to the definition with the same arguments will yield the cached object immediately.
- Parameters
sd (colour.colorimetry.spectrum.TypeSpectralDistribution) – Spectral distribution to reshape.
shape (colour.colorimetry.spectrum.SpectralShape) – Spectral shape to reshape the spectral distribution with.
method (Union[Literal['Align', 'Extrapolate', 'Interpolate', 'Trim'], str]) – Reshape method.
copy (bool) – Whether to return a copy of the cached spectral distribution. Default is True.
kwargs (Any) – {
colour.SpectralDistribution.align()
,colour.SpectralDistribution.extrapolate()
,colour.SpectralDistribution.interpolate()
,colour.SpectralDistribution.trim()
}, See the documentation of the previously listed methods.
- Return type
Warning
Contrary to Numpy, reshaping a spectral distribution alters its data!