hydromt_sfincs.utils.downscale_floodmap#

hydromt_sfincs.utils.downscale_floodmap(zsmax: ~xarray.core.dataarray.DataArray, dep: ~pathlib.Path | str | ~xarray.core.dataarray.DataArray, hmin: float = 0.05, gdf_mask: ~geopandas.geodataframe.GeoDataFrame = None, floodmap_fn: ~pathlib.Path | str = None, reproj_method: str = 'nearest', nrmax: int = 2000, logger=<Logger hydromt_sfincs.utils (WARNING)>, **kwargs)[source]#

Create a downscaled floodmap for (model) region.

Parameters:
  • zsmax (xr.DataArray) – Maximum water level (m). When multiple timesteps provided, maximum over all timesteps is used.

  • dep (Path, str, xr.DataArray) – High-resolution DEM (m) of model region: * If a Path or str is provided, the DEM is read from disk and the floodmap is written to disk (recommened for datasets that do not fit in memory.) * If a xr.DataArray is provided, the floodmap is returned as xr.DataArray and only written to disk when floodmap_fn is provided.

  • hmin (float, optional) – Minimum water depth (m) to be considered as “flooded”, by default 0.05

  • gdf_mask (gpd.GeoDataFrame, optional) – Geodataframe with polygons to mask floodmap, example containing the landarea, by default None Note that the area outside the polygons is set to nodata.

  • floodmap_fn (Union[Path, str], optional) – Name (path) of output floodmap, by default None. If provided, the floodmap is written to disk.

  • reproj_method (str, optional) – Reprojection method for downscaling the water levels, by default “nearest”. Other option is “bilinear”.

  • nrmax (int, optional) – Maximum number of cells per block, by default 2000. These blocks are used to prevent memory issues.

  • kwargs (dict, optional) – Additional keyword arguments passed to RasterDataArray.to_raster.

Returns:

hmax – Downscaled and masked floodmap.

Return type:

xr.Dataset

See also

hydromt.raster.RasterDataArray.to_raster