ess.diffraction.lowpass(da, *, dim, N, Wn, coord=None)#

Smooth data using a lowpass frequency filter.

Applies a lowpass Butterworth filter to based on the sampling rate defined by coord. See scipp.signal.butter() for information on filter design.


If coord is bin-edges, it is first converted to bin-centers using scipp.midpoints(). This is only valid for linearly-spaced edges.

  • da (DataArray) – Data to smoothen.

  • dim (str) – Dimension along which to smooth.

  • coord (Optional[str], default: None) – Name of the coordinate that defines the sampling frequency. Defaults to dim.

  • N (int) – Order of the lowpass filter.

  • Wn (Variable) – Critical frequency of the filter.


DataArray – Smoothed da.

See also



>>> x = sc.linspace(dim='x', start=1.1, stop=4.0, num=1000, unit='m')
>>> y = sc.sin(x * sc.scalar(1.0, unit='rad/m'))
>>> y += sc.sin(x * sc.scalar(400.0, unit='rad/m'))
>>> noisy = sc.DataArray(data=y, coords={'x': x})
>>> smooth = lowpass(noisy, dim='x', N=4, Wn=20 / x.unit)