pyflwdir.FlwdirRaster.moving_average#

FlwdirRaster.moving_average(data, n, weights=None, restrict_strord=False, strord=None, nodata=-9999.0)#

Take the moving weighted average over the flow direction network

Parameters:
  • data (2D array) – values

  • n (int) – number of up/downstream neighbors to include

  • weights (2D array, optional) – weights, by default equal weights are assumed

  • restrict_strord (bool) – If True, limit the window to cells of same or smaller stream order.

  • strord (2D array of int, optional) – Stream order map.

  • nodata (float, optional) – Nodata values which is ignored when calculating the average, by default -9999.0

Returns:

averaged data

Return type:

2D array