median_smooth

specutils.manipulation.median_smooth(spectrum, width)[source]

Smoothing based on a median filter. The median filter smoothing is implemented using the scipy.signal.medfilt function.

Parameters
spectrumSpectrum1D

The Spectrum1D object to which the smoothing will be applied.

widthnumber

The width of the median filter in pixels.

Returns
spectrumSpectrum1D

Output Spectrum1D which is copy of the one passed in with the updated flux.

Raises
ValueError

In the case that spectrum or width are not the correct type or value.