ess.diffraction.lowpass
ess.diffraction.lowpass¶
- ess.diffraction.lowpass(da, *, dim, N, Wn, coord=None)¶
Smooth data using a lowpass frequency filter.
Applies a lowpass Butterworth filter to da.data based on the sampling rate defined by coord. See
scipp.signal.butter()
for information on filter design.Important
If coord is bin-edges, it is first converted to bin-centers using
scipp.midpoints()
. This is only valid for linearly-spaced edges.- Parameters
- Returns
DataArray
– Smoothed da.- Return type
See also
Examples
>>> 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)