savgol

sofia_redux.toolkit.convolve.filter.savgol(data, window, order=2, axes=None, check=True, is_error=False, scale=False, **kwargs)[source]

Apply Savitzky-Golay filter to an array of arbitrary features

Parameters:
dataarray_like (shape)

Data to be filtered. shape must have ndim elements.

windowfloat or array_like of float (ndim,)

The width of the filtering window in units of data spacing in each dimension.

orderint or array_like of int (ndim,), optional

The order of polynomial used to fit in each dimension.

axesarray_like of int, optional

The order in which to apply the filtering. i.e. filter along dimension 0, then dimension 1 etc., or alternatively, just filter along select features.

checkbool, optional

If True, skip all checks on data validity and just solve. Note that if this is the case, both window and order should be supplied as (ndim,) arrays.

is_errorbool, optional

If True, assumes input data are error values and propagates accordingly

scalebool, optional

If True, scale window to the average spacing between samples over each dimension. Note that this replaces “width” in the old IDL version. This option should not be used if working in multiple non-orthogonal features, as average spacing per dimension is taken as the average separation between ordered dimensional coordinates.

kwargsdict, optional

Optional keywords to pass into scipy.signal.savgol_filter

Returns:
filtered_datanumpy.ndarray

The output type is of the same type and shape as “data”, so be careful if using unsigned integers with kernels containing negative values.