hydromt_sfincs.SfincsModel.setup_discharge_forcing_from_grid#

SfincsModel.setup_discharge_forcing_from_grid(discharge, locations=None, uparea=None, wdw=1, rel_error=0.05, abs_error=50)[source]#

Setup discharge forcing based on a gridded discharge dataset.

Discharge boundary timesereis are read from the discharge dataset with gridded discharge time series data.

The locations are snapped to the uparea grid if provided based their uparea attribute. If not provided, the nearest grid cell is used.

Adds model layers:

  • dis forcing: discharge time series [m3/s]

Adds meta layer (not used by SFINCS):

  • src_snapped geom: snapped gauge location on discharge grid

Parameters:
  • discharge (str, Path, xr.DataArray optional) –

    Path, data source name or xarray data object for gridded discharge timeseries dataset.

    • Required variables: [‘discharge’ (m3/s)]

    • Required coordinates: [‘time’, ‘y’, ‘x’]

  • locations (str, Path, gpd.GeoDataFrame, optional) –

    Path, data source name, or geopandas data object for point location dataset. Not required if point location have previously been set, e.g. using the setup_river_inflow() method.

    • Required variables: [‘uparea’ (km2)]

  • uparea (str, Path, optional) –

    Path, data source name, or xarray data object for upstream area grid.

    • Required variables: [‘uparea’ (km2)]

  • wdw (int, optional) – Window size in number of cells around discharge boundary locations to snap to, only used if uparea is provided. By default 1.

  • rel_error (float, optional) – Maximum relative error (default 0.05) and absolute error (default 50 km2) between the discharge boundary location upstream area and the upstream area of the best fit grid cell, only used if “discharge” geoms has a “uparea” column.

  • abs_error (float, optional) – Maximum relative error (default 0.05) and absolute error (default 50 km2) between the discharge boundary location upstream area and the upstream area of the best fit grid cell, only used if “discharge” geoms has a “uparea” column.