raster_tools.focal.check_kernel#

raster_tools.focal.check_kernel(kernel)[source]#

Validate and return the focal kernel.

Parameters

kernel (2D numpy.ndarray) – The kernel to validate. Errors are raised if it is not a numpy array, contains nan values, or is not 2D.

Returns

The input kernel, if nothing was wrong with it.

Return type

numpy.ndarray