xrspatial.edge_detection.sobel_y#

xrspatial.edge_detection.sobel_y(agg, name='sobel_y', boundary='nan')[source]#

Compute the vertical gradient of a raster using the Sobel operator.

Detects horizontal edges by convolving with the Sobel-Y kernel:

[[-1, -2, -1],
 [ 0,  0,  0],
 [ 1,  2,  1]]
Parameters:
  • agg (xarray.DataArray) – 2D raster. Supports NumPy, CuPy, Dask+NumPy, and Dask+CuPy backends.

  • name (str, default='sobel_y') – Name for the output DataArray.

  • boundary (str, default='nan') – How to handle edges: ‘nan’, ‘nearest’, ‘reflect’, or ‘wrap’.

Returns:

Vertical gradient with the same shape and backend as the input.

Return type:

xarray.DataArray