pyflwdir.FlwdirRaster.add_pits#

FlwdirRaster.add_pits(idxs: ndarray | None = None, xy: tuple[ndarray, ndarray] | None = None, streams: ndarray | None = None) → None[source]#

Add pits to the flow-direction raster.

If streams is given, each pit is snapped to the first downstream True cell.

Parameters:
  • idxs (array_like, optional) – Linear indices of pit cells.

  • xy (tuple of np.ndarray of float, optional) – x and y coordinates of pit cells.

  • streams (np.ndarray of bool, optional) – Boolean raster marking stream cells. When provided, pit locations are snapped to the first downstream True cell.