pyflwdir.FlwdirRaster.smooth_rivlen#

FlwdirRaster.smooth_rivlen(rivlen: ndarray, min_rivlen: float, max_window: int = 10, nodata: float = -9999.0) → ndarray#

Return smoothed river length, by taking the window average of river length. The window size is increased until the average exceeds the min_rivlen threshold or the max_window size is reached.

Parameters:
  • rivlen (array-like of float) – River length values.

  • min_rivlen (float) – Minimum river length.

  • max_window (int) – Maximum window size, by default 10.

  • nodata (float, optional) – Missing-data value, by default -9999.0.

Returns:

Smoothed river-length values, with the same shape as rivlen.

Return type:

array of float