pyflwdir.FlwdirRaster.stream_distance#

FlwdirRaster.stream_distance(mask: ndarray | None = None, unit: Literal['m', 'cell'] = 'cell') → ndarray[source]#

Return the distance to the outlet or the next downstream True cell in mask.

Parameters:
  • mask (2D-array of bool, optional) – True for stream cells.

  • unit ({'m', 'cell'}, optional) – Distance unit, either metres (‘m’) or cells (‘cell’), by default ‘cell’.

Returns:

Distance to the next downstream True cell, or to the outlet, in unit.

Return type:

2D array of float