pyflwdir.FlwdirRaster.moving_median#
- FlwdirRaster.moving_median(data: ndarray, n: int, restrict_strord: bool = False, strord: ndarray | None = None, nodata: float = -9999.0) ndarray#
Take the moving median over the flow direction network
- Parameters:
data (array-like) – Values associated with graph cells. Use a 1D array for Flwdir and an array matching the raster shape for FlwdirRaster.
n (int) – number of up/downstream neighbors to include
restrict_strord (bool) – If True, limit the window to cells of same or smaller stream order.
strord (array-like of int, optional) – Stream-order map used when restrict_strord is True.
nodata (float, optional) – Nodata values which is ignored when calculating the median, by default -9999.0
- Returns:
Median values, with the same shape as data.
- Return type:
array