focal.focal_max

focal.focal_max(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 maximum.

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.Window object.

  • 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 value

    • 1: use only fully valid windows

    • Between 0 and 1: minimum acceptable fraction

    Default is 0.7.

  • verbose (bool, optional) – If True, print progress message 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.

Return type:

ndarray