hydromt_wflow.WflowModel.setup_basemaps#
- WflowModel.setup_basemaps(region: Dict, hydrography_fn: str | Dataset, basin_index_fn: str | Dataset = None, res: float | int = 0.008333333333333333, upscale_method: str = 'ihu')[source]#
Build the DEM and flow direction for a Wflow model.
Setup basemaps sets the region of interest and res (resolution in degrees) of the model. All DEM and flow direction related maps are then build.
We strongly recommend using the region types
basin
orsubbasin
to build a wflow model. If you know what you are doing, you can also use thebbox
region type (e.g for an island) with the bbox coordinates in EPSG 4326 or thegeom
region type (e.g. basin polygons have been pre-processed and match EXACTLY withhydrography_fn
).E.g. of region argument for a subbasin based on a point and snapped using upstream area threshold in hydrography_fn, where the maximum boundary box of the output subbasin is known: region = {‘subbasin’: [x,y], ‘uparea’: 10, ‘bounds’: [xmin, ymin, xmax, ymax]}
(Sub)Basin delineation is done using hydromt.workflows.get_basin_geometry method. Because the delineation is computed from the flow direction data in memory, to avoid memory error when using large datasets in hydrography_fn, the user can either supply ‘bounds’ in region or a basin index dataset in basin_index_fn to limit the flow direction data to the region of interest. The basin index dataset is a GeoDataframe containing either basins polygons or bounding boxes of basin boundaries. To select the correct basins, basin ID ‘basins’ in hydrography_fn and basin_index_fn should match.
If the model resolution is larger than the source data resolution, the flow direction is upscaled using the upscale_method, by default the Iterative Hydrography Upscaling (IHU).
The default hydrography_fn is “merit_hydro” (MERIT hydro at 3 arcsec resolution). Alternative sources include “merit_hydro_1k” at 30 arcsec resolution. Users can also supply their own elevation and flow direction data in any CRS and not only EPSG:4326. Both arcgis D8 and pcraster LDD conventions are supported (see also PyFlwDir documentation <https://deltares.github.io/pyflwdir/latest/_examples/flwdir.html>).
Note that in order to define the region, using points or bounding box, the coordinates of the points / bounding box should be in the same CRS than the hydrography data. The wflow model will then also be in the same CRS than the hydrography data in order to avoid assumptions and reprojection errors. If the user wishes to use a different CRS, we recommend first to reproject the hydrography data separately, before calling hydromt build. You can find examples on how to reproject or prepare hydrography data in the prepare flow directions example notebook.
Adds model layers:
wflow_ldd map: flow direction in LDD format [-]
wflow_subcatch map: basin ID map [-]
wflow_uparea map: upstream area [km2]
wflow_streamorder map: Strahler stream order [-]
wflow_dem map: average elevation [m+REF]
dem_subgrid map: subgrid outlet elevation [m+REF]
Slope map: average land surface slope [m/m]
basins geom: basins boundary vector
region geom: region boundary vector
- Parameters:
region (dict) – Dictionary describing region of interest. See
hydromt.workflows.basin_mask.parse_region()
for all optionshydrography_fn (str, xarray.Dataset) –
Name of RasterDataset source for basemap parameters.
Required variables: ‘flwdir’ [LLD or D8 or NEXTXY], ‘elevtn’ [m+REF]
Required variables if used with basin_index_fn: ‘basins’ [-]
- Required variables if used for snapping in region: ‘uparea’ [km2],
’strord’ [-]
Optional variables: ‘lndslp’ [m/m], ‘mask’ [bool]
basin_index_fn (str, geopandas.GeoDataFrame, optional) –
Name of GeoDataFrame source for basin_index data linked to hydrography_fn.
Required variables: ‘basid’ [-]
res (float, optional) – Output model resolution
upscale_method ({'ihu', 'eam', 'dmm'}, optional) – Upscaling method for flow direction data, by default ‘ihu’.
See also
hydromt.workflows.parse_region
,hydromt.workflows.get_basin_geometry
,workflows.hydrography
,workflows.topography