spectrochempy.smooth

smooth(dataset, size=5, window='avg', dim=-1, **kwargs)[source]

Smooth the data using a window with requested size.

This method is based on the convolution of a scaled kernel window with the signal.

Parameters:
  • dataset (NDDataset) – Input dataset to smooth.

  • size (int, optional, default: 5) – The size of the smoothing window.

  • window (str, optional, default:’flat’) – The type of window from ‘flat’ or ‘avg’, ‘han’ or ‘hanning’, ‘hamming’, ‘bartlett’, ‘blackman’. avg window will produce a moving average smoothing.

  • dim (int or str, optional, default: -1) – Axis along which to apply the filter. Accepts a dimension name (e.g. "x") or an integer index (e.g. -1 for the last axis).

  • **kwargs (keyword arguments, optional) – Additional keyword arguments passed to the filter.

Returns:

NDDataset – Smoothed data.

Other Parameters:
  • mode (str, optional, default: ‘nearest’) – The mode parameter determines how the array borders are handled.

  • cval (float, optional, default: 0.0) – Value to fill past edges of input if mode is ‘constant’.

  • log_level (str, optional, default: ‘WARNING’) – The log level for the filter.

See also

Filter

Filter processing.