import dascore
from dascore.units import m, s
= dascore.get_example_patch()
pa
# Apply second order polynomial Savgol filter
# over time dimension with 0.10 sec window.
= pa.savgol_filter(polyorder=2, time=0.1)
filtered_pa_1
# Apply Savgol filter over distance dimension using a 5 sample
# distance window.
= pa.median_filter(distance=5, samples=True,polyorder=2)
filtered_pa_2
# Combine distance and time filter
= pa.savgol_filter(distance=10, time=0.1, polyorder=4) filtered_pa_3
savgol_filter
savgol_filter(
patch: Patch ,
polyorder ,
samples = False,
mode = interp,
cval = 0.0,
**kwargs ,
)-> ‘PatchType’
Applies Savgol filter along spenfied dimensions.
The filter will be applied over each selected dimension sequentially.
Parameters
Parameter | Description |
---|---|
patch | The patch to filter |
polyorder | Order of polynomial |
samples |
If True samples are specified If False coordinate of dimension |
mode | The mode for handling edges. |
cval | The constant value for when mode == constant. |
**kwargs | Used to specify the shape of the savgol filter in each dimension. |
Note
See scipy.signal.savgol_filter for more info on implementation and arguments.