hydromt_sfincs.SfincsModel.setup_river_inflow#
- SfincsModel.setup_river_inflow(rivers: str | Path | GeoDataFrame = None, hydrography: str | Path | Dataset = None, buffer: float = 200, river_upa: float = 10.0, river_len: float = 1000.0, river_width: float = 500, merge: bool = False, first_index: int = 1, keep_rivers_geom: bool = False, reverse_river_geom: bool = False, src_type: str = 'inflow')[source]#
Setup discharge (src) points where a river enters the model domain.
If rivers is not provided, river centerlines are extracted from the hydrography dataset based on the river_upa threshold.
Waterlevel or outflow boundary cells intersecting with the river are removed from the model mask.
Discharge is set to zero at these points, but can be updated using the setup_discharge_forcing or setup_discharge_forcing_from_grid methods.
Note: this method assumes the rivers are directed from up- to downstream. Use reverse_river_geom=True if the rivers are directed from downstream to upstream.
Adds model layers:
dis forcing: discharge forcing
mask map: SFINCS mask layer (only if river_width > 0)
rivers_inflow geoms: river centerline (if keep_rivers_geom; not used by SFINCS)
- Parameters:
rivers (str, Path, gpd.GeoDataFrame, optional) – Path, data source name, or geopandas object for river centerline data. If present, the ‘uparea’ and ‘rivlen’ attributes are used.
hydrography (str, Path, xr.Dataset optional) –
Path, data source name, or a xarray raster object for hydrography data.
Required layers: [‘uparea’, ‘flwdir’].
buffer (float, optional) – Buffer around the model region boundary to define in/outflow points [m], by default 200 m. We suggest to use a buffer of at least twice the hydrography resolution. Inflow points are moved to a downstreawm confluence if within the buffer.
river_upa (float, optional) – Minimum upstream area threshold for rivers [km2], by default 10.0
river_len (float, optional) – Mimimum river length within the model domain threshhold [m], by default 1 km.
river_width (float, optional) – Estimated constant width [m] of the inflowing river. Boundary cells within half the width are forced to be closed (mask = 1) to avoid instabilities with nearby open or waterlevel boundary cells, by default 500 m.
merge (bool, optional) – If True, merge rivers source points with existing points, by default False.
first_index (int, optional) – First index for the river source points, by default 1.
keep_rivers_geom (bool, optional) – If True, keep a geometry of the rivers “rivers_inflow” in geoms. By default False.
reverse_river_geom (bool, optional) – If True, assume that segments in ‘rivers’ are drawn from downstream to upstream. Only used if ‘rivers’ is not None, By default False
src_type ({'inflow', 'headwater'}, optional) – Source type, by default ‘inflow’ If ‘inflow’, return points where the river flows into the model domain. If ‘headwater’, return all headwater (including inflow) points within the model domain.