postprocessor.core.processes.savgol.non_uniform_savgol

non_uniform_savgol(x, y, window, polynom)[source]

Applies a Savitzky-Golay filter to y with non-uniform spacing as defined in x

This is based on https://dsp.stackexchange.com/questions/1676/savitzky-golay-smoothing-filter-for-not-equally-spaced-data The borders are interpolated like scipy.signal.savgol_filter would do

source: https://dsp.stackexchange.com/a/64313

Parameters
xarray_like

List of floats representing the x values of the data

yarray_like

List of floats representing the y values. Must have same length as x

windowint (odd)

Window length of datapoints. Must be odd and smaller than x

polynomint

The order of polynom used. Must be smaller than the window size

Returns
np.array of float

The smoothed y values