colour.colorimetry.sd_gaussian_super_clamped#
- colour.colorimetry.sd_gaussian_super_clamped(peak_wavelength: float, fwhm: float, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, clamp: Literal['none', 'left', 'right'] | str = 'none', exponent: float = 2.0, **kwargs: Any) SpectralDistribution[source]#
Generate a super-Gaussian spectral distribution, optionally clamped flat on one side of the peak, with the peak normalized to 1.
A super-Gaussian (exponent > 2) has a flatter peak than a regular Gaussian, which can better model real-world reflectance spectra.
- Parameters:
peak_wavelength (float) – Peak wavelength of the Gaussian.
fwhm (float) – Full width at half maximum.
shape (SpectralShape) – Spectral shape for the distribution.
clamp (Literal['none', 'left', 'right'] | str) – Clamping mode:
"none"for symmetric Gaussian,"left"for flat from start to peak,"right"for flat from peak to end.exponent (float) – Exponent for the Gaussian function. Default 2.0 gives a standard Gaussian. Values > 2 give a flatter peak (super-Gaussian).
kwargs (Any) – {
colour.SpectralDistribution}, See the documentation of the previously listed class.
- Returns:
Clamped super-Gaussian spectral distribution with peak normalized to 1.
- Return type:
Notes
By default, the spectral distribution will use the shape specified by
colour.SPECTRAL_SHAPE_DEFAULTattribute.
Examples
>>> sd = sd_gaussian_super_clamped(600, 50, clamp="right") >>> sd.shape SpectralShape(360.0, 780.0, 1.0) >>> round(sd[600], 5) np.float64(1.0) >>> round(sd[700], 5) np.float64(1.0) >>> sd = sd_gaussian_super_clamped(450, 40, clamp="left", exponent=4.0) >>> round(sd[450], 5) np.float64(1.0) >>> round(sd[350], 5) 1.0