SobelFilter

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

SobelFilter(
    *args ,
    dim: Any ,
    mode: Any = reflect,
    cval: Any = 0.0,
)-> None

Apply a Sobel filter.

Parameters

Parameter Description
patch The patch to filter
dim The dimension along which to apply
mode Determines how the input array is extended when the filter
overlaps with a border.
cval Fill value when mode=“constant”.

Examples

import dascore
pa = dascore.get_example_patch()
 # 1. Apply Sobel filter using the default parameter values.
sobel_default = pa.sobel_filter(dim='time', mode='reflect', cval=0.0)
 # 2. Apply Sobel filter with arbitrary parameter values.
sobel_arbitrary = pa.sobel_filter(dim='time', mode='constant', cval=1)
# 3. Apply Sobel filter along both axes
sobel_time_space = pa.sobel_filter('time').sobel_filter('distance')

Methods

Name Description
check Refuse a patch which does not carry what the operation needs.
get_metadata Return the axis to filter along, once the arguments are checked.
model_copy Copy the model, dropping cached values the update invalidates.
new Create new instance with some attributed updated.
numpy_kernel Return the Sobel gradient along the axis.
sobel_filter Apply a Sobel filter.
reconcile Return metadata or a patch holding the final data; default as is.
run Run the operation: check, get_metadata, kernel, reconcile, record.