GaussianFilter

class of dascore.proc.filter
inherits from: dascore.proc.filter._WindowFilter, PatchProcessor, DascoreBaseModel, pydantic.main.BaseModel
source

GaussianFilter(
    *args ,
    samples: Any = False,
    mode: Any = reflect,
    cval: Any = 0.0,
    truncate: Any = 4.0,
    **kwargs ,
)-> None

Applies a Gaussian filter along specified dimensions.

Parameters

Parameter Description
patch The patch to filter
samples If True, plain numbers are sigma in samples, and may be fractional.
Otherwise, values are in the units of the dimension, or carry units.
mode The mode for handling edges.
cval The constant value for when mode == constant.
truncate Truncate the filter kernel length to this many standard deviations.
**kwargs Used to specify the sigma value (standard deviation) for desired
dimensions. Sigma is not rounded to whole samples.

Examples

import dascore
from dascore.units import m, s
pa = dascore.get_example_patch()

# Apply Gaussian smoothing along time axis.
pa_1 = pa.gaussian_filter(time=0.1)

# Apply Gaussian filter over distance dimension
# using a 3 sample standard deviation.
pa_2 = pa.gaussian_filter(samples=True, distance=3)

# Apply filter to time and distance axis.
pa_3 = pa.gaussian_filter(time=0.1, distance=3)
Note

See scipy.ndimage.gaussian_filter for more info on implementation and arguments.

Methods

Name Description
check Refuse a patch which does not carry what the operation needs.
get_metadata Return each sigma in samples, unrounded: it is no window length.
model_copy Copy the model, dropping cached values the update invalidates.
new Create new instance with some attributed updated.
numpy_kernel Return the data smoothed along the axes.
gaussian_filter Applies a Gaussian filter along specified dimensions.
reconcile Return metadata or a patch holding the final data; default as is.
run Run the operation: check, get_metadata, kernel, reconcile, record.