hydromt.flw.flwdir_from_da#

hydromt.flw.flwdir_from_da(da: ~xarray.core.dataarray.DataArray, ftype: str = 'infer', check_ftype: bool = True, mask: ~xarray.core.dataarray.DataArray | bool | None = None, logger=<Logger hydromt.flw (WARNING)>)[source]#

Parse dataarray to flow direction raster object.

If a mask coordinate is present this will be passed on the the pyflwdir.from_array method.

Parameters:
  • da (xarray.DataArray) – DataArray containing flow direction raster

  • ftype ({'d8', 'ldd', 'nextxy', 'nextidx', '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 (xr.DataArray, bool, optional) – Mask for gridded flow direction data, by default None. If True, use the mask coordinate of da.

  • logger (logger object, optional) – The logger object used for logging messages. If not provided, the default logger will be used.

Returns:

flwdir – Flow direction raster object

Return type:

pyflwdir.FlwdirRaster