focal.focal_sum
- focal.focal_sum(a: Array, *, window: int | tuple[int, ...] | list[int] | ndarray[tuple[int, ...], bool] | Window, fraction_accepted: float = 0.7, verbose: bool = False, reduce: bool = False, chunks: int | tuple[int, int] | None = None, out: Array | None = None) ndarray[tuple[int, int], float64]
Focal sum
- Parameters:
a (Array) – Input array. Must be two-dimensional.
window (int, array-like, or Window) –
Window applied over the input array. It can be:
An integer (interpreted as a square window),
A sequence of integers (interpreted as a rectangular window),
A boolean array,
Or a
pyspatialstats.windows.Windowobject.
fraction_accepted (float, optional) –
Fraction of valid (non-NaN) cells per window required for the statistic to be computed.
0: use windows with at least 1 valid value1: use only fully valid windowsBetween
0and1: minimum acceptable fraction
Default is 0.7.
verbose (bool, optional) – If True, print progress messages with timing. Default is False.
reduce (bool, optional) – If True, each pixel is used exactly once without overlapping windows. The resulting array will have shape
a_shape / window_shape. Default is False.chunks (int or tuple of int, optional) – Shape of chunks to split the array into. If None, the array is not split into chunks, which is the default.
out (
ndarray, optional) – Output array.
- Return type: