import dascore
= dascore.get_example_patch()
pa # Apply bandpass filter along time axis from 1 to 100 Hz
= pa.pass_filter(time=(1, 100))
bandpassed # Apply lowpass filter along distance axis for wavelengths less than 100m
= pa.pass_filter(distance=(None, 1/100))
lowpassed # Note that None and ... both indicate open intervals
assert pa.pass_filter(time=(None, 90)) == pa.pass_filter(time=(..., 90))
# Optionally, units can be specified for a more expressive API.
from dascore.units import m, ft, s, Hz
# Filter from 1 Hz to 10 Hz in time dimension
= pa.pass_filter(time=(1 * Hz, 10 * Hz))
lp_units # Filter wavelengths 50m to 100m
= pa.pass_filter(distance=(50 * m, 100 * m))
bp_m # filter wavelengths less than 200 ft
= pa.pass_filter(distance=(200 * ft, ...)) lp_ft
pass_filter
pass_filter(
patch: Patch ,
corners = 4,
zerophase = True,
**kwargs ,
)-> ‘PatchType’
Apply a Butterworth pass filter (bandpass, highpass, or lowpass).
Parameters
Parameter | Description |
---|---|
corners | The number of corners for the filter. |
zerophase | If True, apply the filter twice. |
**kwargs |
Used to specify the dimension and frequency, wavelength, or equivalent limits. |