hydromt.gis_utils.spread2d#

hydromt.gis_utils.spread2d(da_obs: DataArray, da_mask: DataArray | None = None, da_friction: DataArray | None = None, nodata: float | None = None) Dataset[source]#

Return values of da_obs spreaded to cells with nodata value within da_mask.

powered by pyflwdir.gis_utils.spread2d().

Parameters:
  • da_obs (xarray.DataArray) – Input raster with observation values and background/nodata values which are filled by the spreading algorithm.

  • da_mask (xarray.DataArray, optional) – Mask of cells to fill with the spreading algorithm, by default None

  • da_friction (xarray.DataArray, optional) – Friction values used by the spreading algorithm to calcuate the friction distance, by default None

  • nodata (float, optional) – Nodata or background value. Must be finite numeric value. If not given the raster nodata value is used.

Returns:

ds_out – Dataset with spreaded source values, linear index of the source cell “source_idx” and friction distance to the source cell “source_dst”.

Return type:

xarray.Dataset