local_sum
- eolab.georastertools.processing.algo.local_sum(input_data: ndarray, kernel_size: int = 8) ndarray[source]
Computes the local sums of the input data using a sliding window defined by the kernel size. Each element in the output is the sum of the pixels within the specified kernel size window.
- Parameters:
input_data (np.ndarray) – A 3D numpy array of shape (1, number_of_lines, number_of_columns) containing the Digital Elevation Model (DEM). The function only accepts arrays with one band.
kernel_size (int) – The size of the sliding window used to compute the local sum.
- Returns:
A numpy array of the same size as input_data containing the computed local sums.
- Return type:
np.ndarray
- Raises:
ValueError – If input_data does not have 3 dimensions or if the first dimension is not of size 1.