Build a riverine SFINCS model from scratch

This notebook demonstrates how to prepare SFINCS model from scratch using the command line interace (CLI).

All lines in this notebook which start with ! are executed from the command line. Within the notebook environment the logging messages are shown after completion. You can also copy these lines and paste these in your shell to get more direct feedback.

hydroMT CLI build interface

Lets first check if the SFINCS model is recognized by hydromt

[1]:
# this should return "sfincs"
!hydromt --models
hydroMT model plugins: sfincs (v0.2.2.dev0)

Using the hydromt build API we can setup a complete model from scratch. Let’s get an overview of all the available options:

[2]:
!hydromt build --help
Usage: hydromt build [OPTIONS] MODEL MODEL_ROOT REGION

  Build models from source data.

  Example usage:
  --------------

  To build a wflow model for a subbasin using and point coordinates snapped to cells with stream order >= 4
  hydromt build wflow /path/to/model_root "{'subbasin': [-7.24, 62.09], 'strord': 4}" -i /path/to/wflow_config.ini

  To build a wflow model based on basin ID
  hydromt build wflow /path/to/model_root "{'basin': 230001006}"

  To build a sfincs model based on a bbox (for Texel)
  hydromt build sfincs /path/to/model_root "{'bbox': [4.6891,52.9750,4.9576,53.1994]}"

Options:
  -r, --res FLOAT             Model resolution in model src.
  --build-base / --build-all  Deprecated!
  --opt TEXT                  Component specific keyword arguments, see the
                              setup_<component> method of the specific model
                              for more information about the arguments.
  -i, --config PATH           Path to hydroMT configuration file, for the
                              model specific implementation.
  -d, --data PATH             File path to yml data sources file. See
                              documentation for required yml file format.
  --dd, --deltares-data       Parse default deltares data yml from
                              https://github.com/DirkEilander/hydromt-
                              artifacts/releases
  -q, --quiet                 Decrease verbosity.
  -v, --verbose               Increase verbosity.
  --help                      Show this message and exit.

setup SFINCS model base layers

[3]:
# NOTE: copy this line (without !) to your shell for more direct feedback
!hydromt build sfincs "./sfincs_test_base" "{'bbox': [11.97,45.78,12.28,45.94]}" -r 100 -vv
2022-07-01 15:21:46,852 - build - log - DEBUG - Writing log messages to new file /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_base/hydromt.log.
2022-07-01 15:21:46,853 - build - log - INFO - HydroMT version: 0.4.5
2022-07-01 15:21:46,853 - build - main - INFO - Building instance of sfincs model at /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_base.
2022-07-01 15:21:46,853 - build - main - INFO - User settings:
2022-07-01 15:21:46,856 - build - model_plugins - DEBUG - Loaded model plugin 'sfincs = hydromt_sfincs.sfincs.SfincsModel' (0.2.2.dev0)
2022-07-01 15:21:46,856 - build - model_api - INFO - Initializing sfincs model from hydromt_sfincs (v0.2.2.dev0).
2022-07-01 15:21:46,856 - build - model_api - WARNING - "res" argument ignored as the "setup_topobathy" is not in the model build configuration.
2022-07-01 15:21:46,857 - build - model_api - INFO - setup_region.region: {'bbox': [11.97, 45.78, 12.28, 45.94]}
2022-07-01 15:21:46,857 - build - model_api - INFO - setup_region.hydrography_fn: merit_hydro
2022-07-01 15:21:46,857 - build - model_api - INFO - setup_region.basin_index_fn: merit_hydro_index
2022-07-01 15:21:46,857 - build - basin_mask - DEBUG - Parsed region (kind=bbox): {'bbox': [11.97, 45.78, 12.28, 45.94]}
2022-07-01 15:21:46,861 - build - sfincs - INFO - Writing model data to /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_base
2022-07-01 15:21:46,861 - build - sfincs - INFO - Write staticgeom files
2022-07-01 15:21:46,861 - build - sfincs - INFO - Write vector file(s) for staticgeoms to 'gis' subfolder
2022-07-01 15:21:46,906 - build - model_api - DEBUG - Default config read from /usr/share/miniconda/envs/hydromt-sfincs/lib/python3.9/site-packages/hydromt_sfincs/data/sfincs/sfincs.inp
2022-07-01 15:21:46,906 - build - sfincs - ERROR - depfile = sfincs.dep not found
2022-07-01 15:21:46,906 - build - sfincs - ERROR - mskfile = sfincs.msk not found
2022-07-01 15:21:46,906 - build - sfincs - ERROR - indexfile = sfincs.ind not found
2022-07-01 15:21:46,906 - build - model_api - INFO - Writing model config to /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_base/sfincs.inp
2022-07-01 15:21:46,907 - build - data_adapter - INFO - Adding sample data v0.0.6 from artifacts

The example above means the following: run hydromt build with:

  • sfincs : i.e. build a sfincs model

  • ./sfincs_test_base : output model folder

  • "{'bbox': [11.97,45.78,12.28,45.94]}" : make a model that is active for the full given bounding box. All REGION options are described in the docs

  • -r 100 : build the model at a 100 meter resolution

  • -vv : give some extra verbosity (2 * v) to display feedback on screen. Now debug messages are provided.

NOTE: As we did not specify a model configuration, only the model region has been prepared. To build a complete model we need the use a configuraton ini-file.

Model setup configuration

The ini-file contains the model setup configuration and determines which components are build and in which order and optionally sets non-default arguments for each component. This configuration is passed to hydromt using -i <path_to_ini_file>. We have prepared several example ini-files which are available in the model repository examples folder and from the docs(build_configuration).

Each header as shown between [...] (e.g. [setup_topobathy]) corresponds to a model component. All model components are explained in the docs(model_components).

We will load the default SFINCS build ini file for inspection:

[4]:
fn_ini = "sfincs_riverine.ini"
with open(fn_ini, "r") as f:
    txt = f.read()
print(txt)
[setup_config]
tref = 20210101 000000
tstart = 20210101 000000
tstop = 20210102 000000
alpha = 0.5
zsini = 0.0
dtmaxout = 86400

[setup_region]                  # method to determine (hydrological) model region
hydrography_fn = merit_hydro
basin_index_fn = merit_hydro_index

[setup_topobathy]
topobathy_fn = merit_hydro       # topobathy basemaps ['elevtn']

[setup_river_hydrography]       # required for setup_river_bathymetry & used by setup_river_inflow & setup_river_outflow if no hydrography_fn passed to those methods
hydrography_fn = merit_hydro    # hydrography maps ['flwdir', 'uparea']

[setup_river_bathymetry]
river_geom_fn = data/rivers_lin2019_v1.geojson  # river geometry with columns ['qbankfull', 'rivwth']
river_upa = 25                   # Mimimum upstream area threshold of rivers [km2]
river_len = 1000                 # minimum length inside river domain [m]
rivdph_method=gvf                # gradual varying flow method
rivwth_method=geom               # with based on values from river_geom_fn
min_rivwth=50.0                  # minimum river width
min_rivdph=1.0                   # minimum river depth

[setup_river_inflow]
river_upa = 25                   # Mimimum upstream area threshold of rivers [km2]
river_len = 1000                 # minimum length inside river domain [m]

[setup_river_outflow]
river_upa = 10                   # Mimimum upstream area threshold of rivers [km2]
river_len = 1000                 # minimum length inside river domain [m]
outflow_width = 2500             # The width [m] of the outflow boundary

[setup_cn_infiltration]
cn_fn = gcn250                  # curve number source
antecedent_runoff_conditions = avg # for gcn250: {'dry', 'avg', 'wet'}

[setup_manning_roughness]
lulc_fn = vito                  # land-use land-cover source
map_fn = None                   # mapping file. read from hydromt/data/lulc/{lulc_fn}_mapping.csv if None

[setup_gauges]
gauges_fn = data/riverine_gauges.csv   # observation point locations
crs = 4326                      # epsg-code for gauges (only used if not in gauges_fn metadata, e.g. when csv file)

[setup_q_forcing]
geodataset_fn = None                #  discharge point timeseries dataset
timeseries_fn = data/discharge_input_sfincs.csv   # timeseries data at discharge gauges (e.g.: from setup_river_inflow)


Data for model setup

The <...>_fn arguments correspond to a data source from the DataCatalog which is based on a yml-file with references to the data paths/urls and how the data should be read. This file can be provided to hydromt using -d <path_to_yml_file>.

By default some example data for the Piave basin will be downloaded to $USER_ROOT$/.hydromt_data/ which is also used for this example. An overview of the available example data is provided here This example data is a based on the data which available from the Deltares p-drive. If you have acces to this drive, a pre-configured catalog file can be loaded using the --dd flag.

More background how to write a data catalog yml file can be found in the hydromt core docs

Setup complete SFINCS model

[5]:
# NOTE: copy this line (without !) to your shell for more direct feedback
!hydromt build sfincs "./sfincs_test_full" "{'bbox': [11.97,45.78,12.28,45.94]}" -r 50 -i sfincs_riverine.ini -vv
2022-07-01 15:21:50,496 - build - log - DEBUG - Writing log messages to new file /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_full/hydromt.log.
2022-07-01 15:21:50,496 - build - log - INFO - HydroMT version: 0.4.5
2022-07-01 15:21:50,496 - build - main - INFO - Building instance of sfincs model at /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_full.
2022-07-01 15:21:50,496 - build - main - INFO - User settings:
2022-07-01 15:21:50,502 - build - model_plugins - DEBUG - Loaded model plugin 'sfincs = hydromt_sfincs.sfincs.SfincsModel' (0.2.2.dev0)
2022-07-01 15:21:50,502 - build - model_api - INFO - Initializing sfincs model from hydromt_sfincs (v0.2.2.dev0).
2022-07-01 15:21:50,502 - build - model_api - DEBUG - Setting model config options.
2022-07-01 15:21:50,504 - build - model_api - DEBUG - Default config read from /usr/share/miniconda/envs/hydromt-sfincs/lib/python3.9/site-packages/hydromt_sfincs/data/sfincs/sfincs.inp
2022-07-01 15:21:50,505 - build - model_api - INFO - setup_region.region: {'bbox': [11.97, 45.78, 12.28, 45.94]}
2022-07-01 15:21:50,505 - build - model_api - INFO - setup_region.hydrography_fn: merit_hydro
2022-07-01 15:21:50,505 - build - model_api - INFO - setup_region.basin_index_fn: merit_hydro_index
2022-07-01 15:21:50,505 - build - basin_mask - DEBUG - Parsed region (kind=bbox): {'bbox': [11.97, 45.78, 12.28, 45.94]}
2022-07-01 15:21:50,509 - build - model_api - INFO - setup_topobathy.topobathy_fn: merit_hydro
2022-07-01 15:21:50,509 - build - model_api - INFO - setup_topobathy.res: 50.0
2022-07-01 15:21:50,509 - build - model_api - INFO - setup_topobathy.crs: utm
2022-07-01 15:21:50,509 - build - model_api - INFO - setup_topobathy.reproj_method: bilinear
2022-07-01 15:21:50,620 - build - data_adapter - INFO - Adding sample data v0.0.6 from artifacts
2022-07-01 15:21:50,804 - build - data_adapter - INFO - DataCatalog: Getting merit_hydro RasterDataset raster data from /home/runner/.hydromt_data/data/v0.0.6/merit_hydro/{variable}.tif
2022-07-01 15:21:50,829 - build - data_adapter - DEBUG - RasterDataset: Clip with geom - [11.961, 45.772, 12.288, 45.948]
2022-07-01 15:21:50,899 - build - model_api - INFO - setup_river_hydrography.hydrography_fn: merit_hydro
2022-07-01 15:21:50,899 - build - model_api - INFO - setup_river_hydrography.adjust_dem: False
2022-07-01 15:21:50,899 - build - data_adapter - INFO - DataCatalog: Getting merit_hydro RasterDataset raster data from /home/runner/.hydromt_data/data/v0.0.6/merit_hydro/{variable}.tif
2022-07-01 15:21:50,981 - build - data_adapter - DEBUG - RasterDataset: Clip with geom - [11.970, 45.780, 12.280, 45.940]
2022-07-01 15:21:51,000 - build - sfincs - INFO - Reprojecting hydrography data to destination grid.
2022-07-01 15:21:52,457 - build - flw - INFO - Deriving flow direction from reprojected synthethic elevation.
2022-07-01 15:22:00,663 - build - flw - INFO - Calculating upstream area with 5 river inflows.
2022-07-01 15:22:00,930 - build - flw - DEBUG - New/org max upstream area: 3938.01/3956.60 km2
2022-07-01 15:22:00,944 - build - sfincs - INFO - Saving hydrography data to staticmaps.
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.river_geom_fn: /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/data/rivers_lin2019_v1.geojson
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.river_mask_fn: None
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.qbankfull_fn: None
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.rivdph_method: gvf
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.rivwth_method: geom
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.river_upa: 25
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.river_len: 1000
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.min_rivwth: 50.0
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.min_rivdph: 1.0
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.rivbank: True
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.rivbankq: 25
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.segment_length: 3000.0
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.smooth_length: 10000.0
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.constrain_rivbed: True
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.constrain_estuary: True
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.dig_river_d4: True
2022-07-01 15:22:00,948 - build - model_api - INFO - setup_river_bathymetry.plot_riv_profiles: 0
2022-07-01 15:22:01,015 - build - data_adapter - WARNING - Overwriting data source rivers_lin2019_v1.
2022-07-01 15:22:01,015 - build - data_adapter - INFO - DataCatalog: Getting rivers_lin2019_v1 GeoDataFrame vector data from /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/data/rivers_lin2019_v1.geojson
2022-07-01 15:22:01,016 - build - data_adapter - INFO - GeoDataFrame: Read vector data and clip to geom (epsg:4326) [11.970, 45.780, 12.280, 45.940].
2022-07-01 15:22:05,827 - build - bathymetry - INFO - Deriving bankfull river surface elevation from its banks.
2022-07-01 15:22:13,257 - build - bathymetry - INFO - Smoothing river width (n=2).
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
The solver successfully reached the end of the integration interval.
2022-07-01 15:22:15,273 - build - bathymetry - DEBUG - Burn bedlevel values into DEM.
2022-07-01 15:22:15,286 - build - bathymetry - DEBUG - Interpolate bedlevel values
2022-07-01 15:22:16,429 - build - bathymetry - DEBUG - Correct for D4 connectivity bed level
2022-07-01 15:22:17,982 - build - model_api - INFO - setup_river_inflow.hydrography_fn: None
2022-07-01 15:22:17,983 - build - model_api - INFO - setup_river_inflow.river_upa: 25
2022-07-01 15:22:17,983 - build - model_api - INFO - setup_river_inflow.river_len: 1000
2022-07-01 15:22:17,983 - build - model_api - INFO - setup_river_inflow.river_width: 2000.0
2022-07-01 15:22:17,983 - build - model_api - INFO - setup_river_inflow.keep_rivers_geom: False
2022-07-01 15:22:17,983 - build - model_api - INFO - setup_river_inflow.buffer: 10
2022-07-01 15:22:18,259 - build - flwdir - DEBUG - 3 river inflow point locations found.
2022-07-01 15:22:18,277 - build - sfincs - DEBUG - discharge forcing: setting src data for 3 points.
2022-07-01 15:22:18,277 - build - sfincs - DEBUG - discharge forcing: setting dis data.
2022-07-01 15:22:18,386 - build - sfincs - DEBUG - 118 closed (mask=1) boundary cells set around src points.
2022-07-01 15:22:18,387 - build - model_api - INFO - setup_river_outflow.hydrography_fn: None
2022-07-01 15:22:18,387 - build - model_api - INFO - setup_river_outflow.river_upa: 10
2022-07-01 15:22:18,387 - build - model_api - INFO - setup_river_outflow.river_len: 1000
2022-07-01 15:22:18,387 - build - model_api - INFO - setup_river_outflow.river_width: 2000.0
2022-07-01 15:22:18,387 - build - model_api - INFO - setup_river_outflow.append_bounds: False
2022-07-01 15:22:18,387 - build - model_api - INFO - setup_river_outflow.keep_rivers_geom: False
2022-07-01 15:22:18,387 - build - sfincs - WARNING - 'outflow_width' is deprecated use 'river_width' instead.
2022-07-01 15:22:18,663 - build - flwdir - DEBUG - 6 river outflow point locations found.
2022-07-01 15:22:18,931 - build - sfincs - DEBUG - 307 outflow (mask=3) boundary cells set.
2022-07-01 15:22:18,933 - build - model_api - INFO - setup_cn_infiltration.cn_fn: gcn250
2022-07-01 15:22:18,933 - build - model_api - INFO - setup_cn_infiltration.antecedent_runoff_conditions: avg
2022-07-01 15:22:18,933 - build - data_adapter - INFO - DataCatalog: Getting gcn250 RasterDataset raster data from /home/runner/.hydromt_data/data/v0.0.6/gcn250/{variable}.tif
2022-07-01 15:22:18,943 - build - data_adapter - DEBUG - RasterDataset: Clip with geom - [11.970, 45.780, 12.280, 45.940]
2022-07-01 15:22:18,980 - build - sfincs - INFO - Updating CN map based on "rivmsk" from setup_river_hydrography method.
2022-07-01 15:22:18,998 - build - model_api - INFO - setup_manning_roughness.lulc_fn: vito
2022-07-01 15:22:18,998 - build - model_api - INFO - setup_manning_roughness.map_fn: None
2022-07-01 15:22:18,999 - build - model_api - INFO - setup_manning_roughness.riv_man: 0.03
2022-07-01 15:22:18,999 - build - model_api - INFO - setup_manning_roughness.lnd_man: 0.1
2022-07-01 15:22:18,999 - build - model_api - INFO - setup_manning_roughness.sea_man: None
2022-07-01 15:22:19,002 - build - data_adapter - INFO - DataCatalog: Getting vito RasterDataset raster data from /home/runner/.hydromt_data/data/v0.0.6/vito.tif
2022-07-01 15:22:19,012 - build - data_adapter - DEBUG - RasterDataset: Clip with geom - [11.970, 45.780, 12.280, 45.940]
2022-07-01 15:22:19,035 - build - landuse - INFO - Deriving N using average resampling (nodata=-999.0).
2022-07-01 15:22:19,085 - build - sfincs - INFO - Setting constant manning roughness for river cells.
2022-07-01 15:22:19,095 - build - model_api - INFO - setup_gauges.gauges_fn: /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/data/riverine_gauges.csv
2022-07-01 15:22:19,096 - build - model_api - INFO - setup_gauges.overwrite: False
2022-07-01 15:22:19,096 - build - data_adapter - INFO - DataCatalog: Getting riverine_gauges GeoDataFrame csv data from /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/data/riverine_gauges.csv
2022-07-01 15:22:19,097 - build - data_adapter - INFO - GeoDataFrame: Read csv data and clip to geom (epsg:4326) [11.970, 45.780, 12.280, 45.940].
2022-07-01 15:22:19,111 - build - sfincs - INFO - obs set based on /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/data/riverine_gauges.csv
2022-07-01 15:22:19,111 - build - model_api - INFO - setup_q_forcing.geodataset_fn: None
2022-07-01 15:22:19,111 - build - model_api - INFO - setup_q_forcing.timeseries_fn: /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/data/discharge_input_sfincs.csv
2022-07-01 15:22:19,128 - build - sfincs - DEBUG - discharge forcing: setting src data for 3 points.
2022-07-01 15:22:19,128 - build - sfincs - DEBUG - discharge forcing: setting dis data.
2022-07-01 15:22:19,128 - build - model_api - WARNING - Replacing forcing: dis
2022-07-01 15:22:19,128 - build - sfincs - INFO - Writing model data to /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_full
2022-07-01 15:22:19,180 - build - sfincs - DEBUG - Write binary map indices based on mask.
2022-07-01 15:22:19,226 - build - sfincs - DEBUG - Write binary map files: ['dep', 'msk', 'scs', 'manning'].
2022-07-01 15:22:19,401 - build - sfincs - INFO - Write raster file(s) for staticmaps to 'gis' subfolder
2022-07-01 15:22:19,846 - build - sfincs - INFO - Write staticgeom files
2022-07-01 15:22:19,848 - build - sfincs - INFO - Write vector file(s) for staticgeoms to 'gis' subfolder
2022-07-01 15:22:19,888 - build - sfincs - INFO - Write forcing files
2022-07-01 15:22:19,897 - build - sfincs - INFO - Write vector file(s) for forcing.dis to 'gis' subfolder
2022-07-01 15:22:19,911 - build - model_api - INFO - Writing model config to /home/runner/work/hydromt_sfincs/hydromt_sfincs/docs/_examples/sfincs_test_full/sfincs.inp

With this example we build a complete SFINCS model including forcing. Compared to the previous hydromt build we have added: * -i sfincs_riverine.ini : setup configuration file including all components to build and their arguments

Next we check which files have been created. The model root should contain two netcdf (.nc) files, one for the staticmaps and one for the forcing data, a SFINCS configuration (sfincs.inp) file. These files are sufficient to run the SFINCS model. In addition several geometry (.geojson) files are saved in the staticgeoms folder. Finally, the setup process is logged in the hydromt.log file.

[6]:
import os

root = "sfincs_test_full"
for path, _, files in os.walk(root):
    print(path)
    for name in files:
        print(f" - {name}")
sfincs_test_full
 - sfincs.man
 - sfincs.scs
 - hydromt.log
 - sfincs.inp
 - sfincs.src
 - sfincs.msk
 - sfincs.dep
 - sfincs.dis
 - sfincs.ind
 - hydromt_data.yml
 - sfincs.obs
sfincs_test_full/gis
 - rivers.geojson
 - dep.tif
 - flwdir.tif
 - obs.geojson
 - region.geojson
 - manning.tif
 - rivmsk.tif
 - uparea.tif
 - msk.tif
 - scs.tif
 - src.geojson

Visualize and/or inspect model schematization

Inspecting the model

Let’s have a closer look at the model. To interact with a model within a notebook or python script, we need to load a number of modules.

[7]:
%matplotlib inline
from hydromt_sfincs import SfincsModel
import os

Now we can load the model in memory and inspect it. Shown is the elevation in the SFINCS model as map, the main rivers as blue lines that determine the inflow locations, the minor rivers in red lines that determine the outflow locations and discharge input points as numbered triangles.

[8]:
# define the model's configuration file
root = r"./sfincs_test_full"
# read the model with hydromt sfincs methods
mod = SfincsModel(root=root, mode="r")
mod.read()
[9]:
mod.plot_basemap(
    geoms=["src", "obs", "rivers"],
    figsize=(14, 14 * 0.65),
)
[9]:
(<Figure size 1008x655.2 with 2 Axes>,
 <GeoAxesSubplot:title={'center':'SFINCS dep map'}, xlabel='x coordinate UTM zone 33N [m]', ylabel='y coordinate UTM zone 33N [m]'>)
../_images/_examples_build_riverine_model_27_1.png
[10]:
mod.plot_forcing()
[10]:
(<Figure size 432x216 with 1 Axes>,
 [<AxesSubplot:title={'center':'SFINCS discharge forcing (dis)'}, ylabel='discharge\n[m3.s-1]'>])
../_images/_examples_build_riverine_model_28_1.png