pyflwdir.regions.region_slices#

pyflwdir.regions.region_slices(regions)[source]#

Returns slices for each unique label in regions.

NOTE: a region must be a connected area with the same ID, where ID are integer values larger than zero.

Parameters:

regions (2D array of int) – raster with unique IDs for each region, must have the same shape as data.

Returns:

  • lbs (1D array) – array of the unique region IDs

  • slices (list of tuples) – Each tuple contains slices, one for each dimension