import dascore as dc
patch = dc.get_example_patch()
decimated_irr = patch.decimate(time=10, filter_type='iir')
# Example using fir along distance dimension
decimated_fir = patch.decimate(distance=10, filter_type='fir')Decimate
Decimate(
*args ,
filter_type: Any = iir,
copy: Any = True,
**kwargs ,
)-> None
Decimate a patch along a dimension.
Parameters
| Parameter | Description |
|---|---|
| patch | The patch to decimate. |
| filter_type |
Anti-aliasing filter: "iir", "fir", or None. None disablespre-filtering and may cause aliasing. |
| copy |
Copy the sliced data so it does not retain the original array. Applies only when filter_type is None.
|
| **kwargs |
Dimension and factor; time=10 decimates the time axis by 10.
|
Note
Uses
scipy.signal.decimatewhenfilter_typeis specified; otherwise, takes every nth sample along the dimension.If the decimation dimension is small, this can fail due to lack of padding values.
Coordinates measured on the decimated dimension are decimated with it: taking every nth value of a dimension takes every nth value of everything indexed by it.
With a filter, missing samples (holes in the step) raise; use split_gaps or fill_gaps first.
See Also
resample Change sampling to a specified interval or number of samples, rather than by an integer decimation factor.
Examples
Methods
| Name | Description |
|---|---|
| check | Refuse a patch which does not carry what the operation needs. |
| get_metadata | Return the decimated coordinates, the axis, factor and slices. |
| kernel | Return the data sliced on its own backend; filtered by numpy. |
| model_copy | Copy the model, dropping cached values the update invalidates. |
| new | Create new instance with some attributed updated. |
| numpy_kernel | Return the data filtered and decimated by scipy, or sliced. |
| decimate | Decimate a patch along a dimension. |
| reconcile | Return metadata or a patch holding the final data; default as is. |
| run | Run the operation: check, get_metadata, kernel, reconcile, record. |