pyflwdir.FlwdirRaster.upstream_sum#

FlwdirRaster.upstream_sum(data: ndarray, mv: float = -9999) → ndarray#

Return the sum of values at each node’s immediate upstream neighbors.

Parameters:
  • data (array-like) – Values associated with graph cells. Use a 1D array for Flwdir and an array matching the raster shape for FlwdirRaster.

  • mv (int or float, optional) – Missing-data value, by default -9999.

Returns:

Sum of immediate upstream values at each cell, with the same shape as data.

Return type:

array