hydromt_wflow.WflowSbmModel.setup_1dmodel_connection#
- WflowSbmModel.setup_1dmodel_connection(river1d_fn: str | Path | GeoDataFrame, connection_method: str = 'subbasin_area', area_max: float = 30.0, basin_buffer_cells: int = 0, geom_snapping_tolerance: float = 0.001, add_tributaries: bool = True, include_river_boundaries: bool = True, mapname: str = '1dmodel', update_toml: bool = True, toml_output: str = 'netcdf_scalar', **kwargs)[source]#
Connect wflow to a 1D model by deriving linked subcatch (and tributaries).
There are two methods to connect models:
- subbasin_area:
creates subcatchments linked to the 1d river based on an area threshold (area_max) for the subbasin size. With this method, if a tributary is larger than the area_max, it will be connected to the 1d river directly.
- nodes:
subcatchments are derived based on the 1driver nodes (used as gauges locations). With this method, large tributaries can also be derived separately using the add_tributaries option and adding a area_max threshold for the tributaries.
If add_tributary option is on, you can decide to include or exclude the upstream boundary of the 1d river as an additional tributary using the include_river_boundaries option.
River edges or river nodes are snapped to the closest downstream wflow river cell using the
hydromt.flw.gauge_map()
method.Optionally, the toml file can also be updated to save lateral.river.inwater to save all river inflows for the subcatchments and lateral.river.q_av for the tributaries using
hydromt_wflow.wflow_base.setup_config_output_timeseries()
.Note that if the method is subbasin_area, only connecting one continuous river1d is supported. To connect several riv1d networks to the same wflow model, the method can be run several times.
Adds model layer:
subcatchment_{mapname} map/geom: connection subbasins between wflow and the 1D model.
subcatchment_river_{mapname} map/geom: connection subbasins between wflow and the 1D model for river cells only.
gauges_{mapname} map/geom, optional: outlets of the tributaries flowing into the 1D model.
Required setup methods:
- Parameters:
river1d_fn (str, Path, gpd.GeoDataFrame) – GeodataFrame with the 1D model river network and nodes where to derive subbasins for connection_method nodes.
connection_method (str, default subbasin_area) –
- Method to connect wflow to the 1D model. Available methods are {
‘subbasin_area’, ‘nodes’}.
area_max (float, default 10.0) – Maximum area [km2] of the subbasins to connect to the 1D model in km2 with connection_method subbasin_area or nodes with add_tributaries set to True.
basin_buffer_cells (int, default 0) – Number of cells to use when clipping the river1d geometry to the basin extent. This can be used to not include river geometries near the basin border.
geom_snapping_tolerance (float, default 0.1) – Distance used to determine whether to snap parts of the river1d geometry that are close to each other. This can be useful if some of the tributaries of the 1D river are not perfectly connected to the main river.
add_tributaries (bool, default True) – If True, derive tributaries for the subbasins larger than area_max. Always True for subbasin_area method.
include_river_boundaries (bool, default True) – If True, include the upstream boundary(ies) of the 1d river as an additional tributary(ies).
mapname (str, default 1dmodel) – Name of the map to save the subcatchments and tributaries in the wflow model staticmaps and geoms (subcatchment_{mapname}).
update_toml (bool, default True) – If True, updates the wflow configuration file to save the required outputs for the 1D model.
toml_output (str, optional) – One of [‘csv’, ‘netcdf_scalar’, None] to update [output.csv] or [output.netcdf_scalar] section of wflow toml file or do nothing. By default, ‘netcdf_scalar’.
**kwargs – Additional keyword arguments passed to the snapping method hydromt.flw.gauge_map. See its documentation for more information.
See also
hydromt.flw.gauge_map
,hydromt_wflow.workflows.wflow_1dmodel_connection