hydromt_wflow.WflowBaseModel.setup_rivers#

WflowBaseModel.setup_rivers(hydrography_fn: str | Dataset, river_geom_fn: str | GeoDataFrame | None = None, river_upa: float = 30, slope_len: float = 2000.0, min_rivlen_ratio: float = 0.0, smooth_len: float = 5000.0, min_rivwth: float = 30, rivdph_method: str | None = 'powlaw', min_rivdph: float = 1, output_names: dict = {'river__depth': 'river_depth', 'river__length': 'river_length', 'river__slope': 'river_slope', 'river__width': 'river_width', 'river_location__mask': 'river_mask'})[source]#

Set all river parameter maps.

The river mask is defined by all cells with a minimum upstream area threshold river_upa [km2].

The river length is defined as the distance from the subgrid outlet pixel to the next upstream subgrid outlet pixel. The min_rivlen_ratio is the minimum global river length to avg. cell resolution ratio and is used as a threshold in window-based smoothing of river length.

The river slope is derived from the subgrid elevation difference between pixels at a half distance slope_len [m] up- and downstream from the subgrid outlet pixel.

The river width is derived from the nearest river segment in river_geom_fn. Data gaps are filled by the nearest valid upstream value and averaged along the flow directions over a length smooth_len [m].

Optionally, river depth is derived using rivdph_method if provided (default is “powlaw”). Data gaps are filled similarly to river width.

Adds model layers:

  • wflow_river map: river mask [-]

  • river_length map: river length [m]

  • river_width map: river width [m]

  • river_slope map: river slope [m/m]

  • river_depth map: river depth [m] (if rivdph_method is not None)

  • rivers geom: river vector based on wflow_river mask

Parameters:
  • hydrography_fn (str, Path, xarray.Dataset) –

    Name of RasterDataset source for hydrography data. Must be same as setup_basemaps for consistent results.

    • Required variables: ‘flwdir’ [LLD or D8 or NEXTXY], ‘uparea’ [km2], ‘elevtn’ [m+REF]

    • Optional variables: ‘rivwth’ [m]

  • river_geom_fn (str, Path, geopandas.GeoDataFrame, optional) –

    Name of GeoDataFrame source for river data.

    • Required variables: ‘rivwth’ [m]

  • river_upa (float, optional) – Minimum upstream area threshold for the river map [km2]. By default 30.0

  • slope_len (float, optional) – Length [km] over which the river slope is calculated. By default 2.0

  • min_rivlen_ratio (float, optional) – Ratio of cell resolution used as a minimum length threshold in a moving window-based smoothing of river length, by default 0.0. The river length smoothing is skipped if min_rivlen_ratio = 0. For details about the river length smoothing, see pyflwdir.FlwdirRaster.smooth_rivlen()

  • smooth_len (float, optional) – Length [m] over which to smooth the output river width and depth, by default 5000.0

  • min_rivwth (float, optional) – Minimum river width [m], by default 30.0

  • rivdph_method (str, optional) – Method for estimating river depth. Default is “powlaw”. Set to None to skip river depth estimation.

  • min_rivdph (float, optional) – Minimum river depth [m], by default 1.0

  • output_names (dict, optional) – Dictionary with output names that will be used in the model netcdf input files. Users should provide the Wflow.jl variable name followed by the name in the netcdf file. By default, includes river mask, length, width, slope, and depth.