pyflwdir.from_array#

pyflwdir.from_array(data, ftype='infer', check_ftype=True, mask=None, transform=Affine(1.0, 0.0, 0.0, 0.0, -1.0, 0.0), latlon=False, **kwargs)[source]#

Flow direction raster array parsed to actionable format.

Parameters:
  • data (2D array) – flow direction raster data

  • ftype ({'d8', 'ldd', 'nextxy', 'infer'}, optional) – name of flow direction type, infer from data if ‘infer’, by default is ‘infer’

  • check_ftype (bool, optional) – check if valid flow direction raster if ftype is not ‘infer’, by default True

  • mask (2D array of bool, optional) – True for valid cells. Can be used to mask out subbasins.

  • transform (affine transform) – Two dimensional affine transform for 2D linear mapping, by default using the identity transform.

  • latlon (bool, optional) – True if WGS84 coordinate reference system, by default False. If True it converts the cell areas from degree to metres, otherwise it assumes cell areas are in unit metres.

  • **kwargs – key-word arguments passed to FlwdirRaster

Returns:

Actionable flow direction object

Return type:

FlwdirRaster