smooth_gaussian¶
Smooth a spectrum by convolution with a Gaussian kernel.
| Category | Smoothing |
| Backend | scipy - implemented here on top of scipy primitives |
| Version | 1.0.1 |
| Reads | ctx.spectrum (a Spectrum1D) |
| Writes | spectrum |
Non-finite samples (NaN/inf) are bridged by linear interpolation over the finite neighbours before the convolution, so a single bad pixel no longer spreads NaN across the kernel footprint ; the original non-finite positions are restored to NaN in the output (finite inputs are processed bit-identically to v1.0.0). The uncertainty array is copied unchanged, i.e. it is an overestimate after smoothing ; propagating it is a contract change left for a future major release.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
sigma |
2.0 |
- | Standard deviation of the Gaussian kernel, in samples. |
Use it¶
References¶
- scipy.ndimage.gaussian_filter1d
Related algorithms¶
compare_smoothings- Run every smoothing kernel onctx.spectrumand collect the results.smooth_savgol- Smooth a spectrum with a Savitzky-Golay filter.