colour.colorimetry.reshape_sd#
- colour.colorimetry.reshape_sd(sd: SpectralDistribution, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, method: Literal['Align', 'Extrapolate', 'Interpolate', 'Trim'] | str = 'Align', **kwargs: Any) SpectralDistribution [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 (SpectralDistribution) – Spectral distribution to reshape.
shape (SpectralShape) – Spectral shape to reshape the spectral distribution with.
method (Literal['Align', 'Extrapolate', 'Interpolate', 'Trim'] | str) – Reshape method.
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!