function of dascore.proc.filter source

    patch: Patch ,
    dim: str ,
    mode = reflect,
    cval = 0.0,
)-> ‘PatchType’

Apply a Sobel filter.


Parameter Description
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”.


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')