spectrochempy.savgol

savgol(dataset, size=5, order=2, **kwargs)[source]

Savitzky-Golay filter.

Wrapper of scpy.signal.savgol(). See the documentation of this function for more details.

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

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

  • order (int, optional, default: 2) – The order of the polynomial used to fit the data. order must be less than size.

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

Returns:

NDDataset – Smoothed data.

Other Parameters:
  • dim (int, optional, default: -1) – Axis along which to apply the filter.

  • deriv (int, optional, default: 0) – The order of the derivative to compute.

  • delta (float, optional, default: 1.0) – The spacing of the samples to which the filter will be applied.

  • 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.

Notes

Even spacing of the axis coordinates is NOT checked. Be aware that Savitzky-Golay algorithm is based on indexes, not on coordinates.