savgol_windows

sofia_redux.toolkit.convolve.filter.savgol_windows(order, window, *samples, scale=False)[source]

Creates the correct windows for given order and samples

Also, performs error checks on samples. Note that the order of samples is the same as the order of the features in the data values (samples[-1]). For example, if working in two features samples[0] should be the y-coordinates and samples[1] should be the x-coordinates while samples[2] should have shape (len(samples[0]), len(samples[1])

Parameters:
orderint or array_like of int

The order of the polynomial used to fit the windows. order must be less than “window”.

windowfloat or array_like of float

The length of the Savitzky-Golay filter window. Will be converted to a positive odd integer between order and less than the number of samples in that dimension.

samples(ndim+1)-tuple of array_like

samples[-1] is a data array of ndim features. samples[:ndim] give the coordinates of each dimension (1d-arrays).

scalebool, optional

If True, scale window to the average spacing between samples over each dimension. This option should be used with caution if working in multiple features that are not orthogonal to one another as the average spacing for each dimension is calculated by first ordering all unique coordinates.

Returns:
orders, windowsnumpy.ndarray, numpy.ndarray

Both orders and windows are expanded to (ndim). These values are suitable for passing into “savgol”.