colour.colorimetry.reshape_sd#
- colour.colorimetry.reshape_sd(sd: TypeSpectralDistribution, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, method: Literal['Align', 'Extrapolate', 'Interpolate', 'Trim'] | str = 'Align', copy: bool = True, **kwargs: Any) TypeSpectralDistribution[source]#
Reshape the specified spectral distribution to match the specified 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 (TypeSpectralDistribution) – Spectral distribution to reshape.
shape (SpectralShape) – Target spectral shape for reshaping the spectral distribution.
method (Literal['Align', 'Extrapolate', 'Interpolate', 'Trim'] | str) – Method to use for reshaping.
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!