Skip to content

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

from spectro_kernel import run_algorithm

output = run_algorithm("smooth_gaussian", ctx, {
    "sigma": 2.0
})
spectro run smooth_gaussian --input spectrum.fits \
  --param sigma=2.0
{
  "tool": "smooth_gaussian",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "sigma": 2.0
    }
  }
}

Every algorithm is an MCP tool of the same name; describe_algorithm returns this page's metadata as JSON.

References

  • scipy.ndimage.gaussian_filter1d