Data.smooth

Data.smooth(window='boxcar', xcol=None, ycol=None, size=None, **kargs)

Smooth data by convoluting with a window.

Parameters:

window (string or tuple) – Defines the window type to use by passing to scipy.signal.get_window().

Keyword Arguments:
  • xcol (column index or None) – Data to use as x data if needed to define a window. If None, use Stoner.Core.DataFile.setas

  • ycvol (column index or None) – Data to be smoothed

  • size (int or float) – If int, then the number of points to use in the smoothing window. If float, then the size in x-data to be used.

  • result (bool or column index) – Whether to add the smoothed data to the dataset and if so where.

  • replace (bool) – Replace the exiting data or insert as a new column.

  • header (string) – New column header for the new data.

Returns:

(self or array) – If result is False, then the return value will be a copy of the smoothed data, otherwise the return value is a copy of the AnalysisMixin object with the smoothed data added,

Notes

If size is float, then it is necessary to map the X-data to a number of rows and to ensure that the data is evenly spaced in x. To do this, the number of rows in the window is found by dividing the span in x by the size and multiplying by the total lenfth. Then the data is interpolated to a new set of evenly space X over the same range, smoothed and then interpoalted back to the original x values.