hydromt_wflow.workflows.wflow_1dmodel_connection#

hydromt_wflow.workflows.wflow_1dmodel_connection(gdf_riv: GeoDataFrame, ds_model: Dataset, 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, **kwargs) Dataset[source]#

Connect wflow to a 1D model by deriving linked subcatchs (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.gis.flw.gauge_map() method.

Parameters:
  • gdf_riv (gpd.GeoDataFrame) – River geometry.

  • ds_model (xr.Dataset) – Model dataset with ‘flwdir’, ‘rivmsk’, ‘rivlen’, ‘basins’ and ‘uparea’ (optional).

  • 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 1d river 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 1d river 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).

  • **kwargs – Additional keyword arguments passed to the snapping method hydromt.gis.flw.gauge_map. See its documentation for more information.

Returns:

ds_out – Dataset with variables ‘subcatch’ for the subbasin map, ‘subcatch_riv’ for the subbasin map masked with river cells to be able to save river output with wflow and ‘gauges’ for the tributaries outflow locations (add_tributaries True or subbasin_area method).

Return type:

xr.Dataset