API reference

Wflow model class

Initialize

WflowModel([root, mode, config_fn, ...])

This is the wflow model class

Setup components

WflowModel.setup_config(**cfdict)

Update config with a dictionary

WflowModel.setup_basemaps(region[, res, ...])

This component sets the region of interest and res (resolution in degrees) of the model.

WflowModel.setup_rivers(hydrography_fn[, ...])

This component sets the all river parameter maps.

WflowModel.setup_lakes([lakes_fn, min_area])

This component generates maps of lake areas and outlets as well as parameters with average lake area, depth a discharge values.

WflowModel.setup_reservoirs([reservoirs_fn, ...])

This component generates maps of lake areas and outlets as well as parameters with average reservoir area, demand, min and max target storage capacities and discharge capacity values.

WflowModel.setup_glaciers([glaciers_fn, ...])

This component generates maps of glacier areas, area fraction and volume fraction, as well as tables with temperature threshold, melting factor and snow-to-ice convertion fraction.

WflowModel.setup_lulcmaps([lulc_fn, ...])

This component derives several wflow maps are derived based on landuse- landcover (LULC) data.

WflowModel.setup_laimaps([lai_fn])

This component sets leaf area index (LAI) climatology maps per month.

WflowModel.setup_soilmaps([soil_fn, ptf_ksatver])

This component derives several (layered) soil parameters based on a database with physical soil properties using available point-scale (pedo)transfer functions (PTFs) from literature with upscaling rules to ensure flux matching across scales.

WflowModel.setup_hydrodem([elevtn_map, ...])

This component adds a hydrologically conditioned elevation (hydrodem) map for river and/or land local-inertial routing.

WflowModel.setup_gauges([gauges_fn, ...])

This components sets the default gauge map based on basin outlets and additional gauge maps based on gauges_fn data.

WflowModel.setup_areamap(area_fn, col2raster)

Setup area map from vector data to save wflow outputs for specific area.

WflowModel.setup_precip_forcing([precip_fn, ...])

Setup gridded precipitation forcing at model resolution.

WflowModel.setup_temp_pet_forcing([...])

Setup gridded reference evapotranspiration forcing at model resolution.

WflowModel.setup_constant_pars(**kwargs)

Setup constant parameter maps.

Attributes

WflowModel.region

Returns geometry of region of the model area of interest.

WflowModel.crs

Returns coordinate reference system embedded in staticmaps.

WflowModel.res

Returns coordinates of staticmaps.

WflowModel.root

Path to model folder.

WflowModel.config

Returns parsed model configuration.

WflowModel.staticmaps

xarray.Dataset representation of all static parameter maps

WflowModel.staticgeoms

geopandas.GeoDataFrame representation of all model geometries

WflowModel.forcing

dict of xarray.dataarray representation of all forcing

WflowModel.states

dict xarray.dataarray representation of all states

WflowModel.results

dict xarray.dataarray representation of model results

WflowModel.flwdir

Returns the pyflwdir.FlwdirRaster object parsed from the wflow ldd.

WflowModel.basins

Returns a basin(s) geometry as a geopandas.GeoDataFrame.

WflowModel.rivers

Returns a river geometry as a geopandas.GeoDataFrame.

High level methods

WflowModel.read()

Method to read the complete model schematization and configuration from file.

WflowModel.write()

Method to write the complete model schematization and configuration to file.

WflowModel.build(region[, res, write, opt])

Single method to build a model from scratch based on settings in opt.

WflowModel.update([model_out, write, opt])

Single method to update a model based the settings in opt.

WflowModel.set_root(root[, mode])

Initialized the model root.

General methods

WflowModel.setup_config(**cfdict)

Update config with a dictionary

WflowModel.get_config(*args[, fallback, ...])

Get a config value at key(s).

WflowModel.set_config(*args)

Update the config dictionary at key(s) with values.

WflowModel.read_config([config_fn])

Parse config from file.

WflowModel.write_config([config_name, ...])

Write config to <root/config_fn>

WflowModel.set_staticmaps(data[, name])

Add data to staticmaps.

WflowModel.read_staticmaps(**kwargs)

Read staticmaps

WflowModel.write_staticmaps()

Write staticmaps

WflowModel.clip_staticmaps(region[, buffer, ...])

Clip staticmaps to subbasin.

WflowModel.set_staticgeoms(geom, name)

Add geom to staticmaps

WflowModel.read_staticgeoms()

Read and staticgeoms at <root/staticgeoms> and parse to geopandas

WflowModel.write_staticgeoms()

Write staticmaps at <root/staticgeoms> in model ready format

WflowModel.set_forcing(data[, name])

Add data to forcing attribute which is a dictionary of xarray.DataArray.

WflowModel.read_forcing()

Read forcing

WflowModel.write_forcing([fn_out, freq_out, ...])

write forcing at fn_out in model ready format.

WflowModel.clip_forcing([crs])

Return clippped forcing for subbasin.

WflowModel.set_states(data[, name])

Add data to states attribute which is a dictionary of xarray.DataArray.

WflowModel.read_states()

Read states at <root/?/> and parse to dict of xr.DataArray

WflowModel.write_states()

write states at <root/?/> in model ready format

WflowModel.set_results(data[, name, ...])

Add data to results attribute which is a dictionary of xarray.DataArray and/or xarray.Dataset.

WflowModel.read_results()

Read results at <root/?/> and parse to dict of xr.DataArray/xr.Dataset

WflowModel.set_flwdir([ftype])

Parse pyflwdir.FlwdirRaster object parsed from the wflow ldd

WflowSediment model class

Initialize

WflowSedimentModel([root, mode, config_fn, ...])

This is the wflow sediment model class, a subclass of WflowModel

Setup components

WflowSedimentModel.setup_config(**cfdict)

Update config with a dictionary

WflowSedimentModel.setup_basemaps(region[, ...])

This component sets the region of interest and res (resolution in degrees) of the model.

WflowSedimentModel.setup_rivers(hydrography_fn)

This component sets the all river parameter maps.

WflowSedimentModel.setup_lakes([lakes_fn, ...])

This component generates maps of lake areas and outlets as well as parameters with average lake area, depth a discharge values.

WflowSedimentModel.setup_reservoirs([...])

This component generates maps of lake areas and outlets as well as parameters with average reservoir area, demand, min and max target storage capacities and discharge capacity values.

WflowSedimentModel.setup_lulcmaps([lulc_fn, ...])

This component derives several wflow maps are derived based on landuse- landcover (LULC) data.

WflowSedimentModel.setup_laimaps([lai_fn])

This component sets leaf area index (LAI) climatology maps per month.

WflowSedimentModel.setup_canopymaps([canopy_fn])

Setup sediments based canopy height maps.

WflowSedimentModel.setup_soilmaps([soil_fn, ...])

Setup sediments based soil parameter maps.

WflowSedimentModel.setup_riverwidth([...])

This component sets the river width parameter based on a power-lay relationship with a predictor.

WflowSedimentModel.setup_riverbedsed([...])

Setup sediments based river bed characteristics maps.

WflowSedimentModel.setup_gauges([gauges_fn, ...])

This components sets the default gauge map based on basin outlets and additional gauge maps based on gauges_fn data.

WflowSedimentModel.setup_areamap(area_fn, ...)

Setup area map from vector data to save wflow outputs for specific area.

WflowSedimentModel.setup_constant_pars(**kwargs)

Setup constant parameter maps.

Attributes

WflowSedimentModel.region

Returns geometry of region of the model area of interest.

WflowSedimentModel.crs

Returns coordinate reference system embedded in staticmaps.

WflowSedimentModel.res

Returns coordinates of staticmaps.

WflowSedimentModel.root

Path to model folder.

WflowSedimentModel.config

Returns parsed model configuration.

WflowSedimentModel.staticmaps

xarray.Dataset representation of all static parameter maps

WflowSedimentModel.staticgeoms

geopandas.GeoDataFrame representation of all model geometries

WflowSedimentModel.forcing

dict of xarray.dataarray representation of all forcing

WflowSedimentModel.states

dict xarray.dataarray representation of all states

WflowSedimentModel.results

dict xarray.dataarray representation of model results

WflowSedimentModel.flwdir

Returns the pyflwdir.FlwdirRaster object parsed from the wflow ldd.

WflowSedimentModel.basins

Returns a basin(s) geometry as a geopandas.GeoDataFrame.

WflowSedimentModel.rivers

Returns a river geometry as a geopandas.GeoDataFrame.

High level methods

WflowSedimentModel.read()

Method to read the complete model schematization and configuration from file.

WflowSedimentModel.write()

Method to write the complete model schematization and configuration to file.

WflowSedimentModel.build(region[, res, ...])

Single method to build a model from scratch based on settings in opt.

WflowSedimentModel.update([model_out, ...])

Single method to update a model based the settings in opt.

WflowSedimentModel.set_root(root[, mode])

Initialized the model root.

General methods

WflowSedimentModel.setup_config(**cfdict)

Update config with a dictionary

WflowSedimentModel.get_config(*args[, ...])

Get a config value at key(s).

WflowSedimentModel.set_config(*args)

Update the config dictionary at key(s) with values.

WflowSedimentModel.read_config([config_fn])

Parse config from file.

WflowSedimentModel.write_config([...])

Write config to <root/config_fn>

WflowSedimentModel.set_staticmaps(data[, name])

Add data to staticmaps.

WflowSedimentModel.read_staticmaps(**kwargs)

Read staticmaps

WflowSedimentModel.write_staticmaps()

Write staticmaps

WflowSedimentModel.clip_staticmaps(region[, ...])

Clip staticmaps to subbasin.

WflowSedimentModel.set_staticgeoms(geom, name)

Add geom to staticmaps

WflowSedimentModel.read_staticgeoms()

Read and staticgeoms at <root/staticgeoms> and parse to geopandas

WflowSedimentModel.write_staticgeoms()

Write staticmaps at <root/staticgeoms> in model ready format

WflowSedimentModel.set_forcing(data[, name])

Add data to forcing attribute which is a dictionary of xarray.DataArray.

WflowSedimentModel.read_forcing()

Read forcing

WflowSedimentModel.write_forcing([fn_out, ...])

write forcing at fn_out in model ready format.

WflowSedimentModel.clip_forcing([crs])

Return clippped forcing for subbasin.

WflowSedimentModel.set_states(data[, name])

Add data to states attribute which is a dictionary of xarray.DataArray.

WflowSedimentModel.read_states()

Read states at <root/?/> and parse to dict of xr.DataArray

WflowSedimentModel.write_states()

write states at <root/?/> in model ready format

WflowSedimentModel.set_results(data[, name, ...])

Add data to results attribute which is a dictionary of xarray.DataArray and/or xarray.Dataset.

WflowSedimentModel.read_results()

Read results at <root/?/> and parse to dict of xr.DataArray/xr.Dataset

WflowSedimentModel.set_flwdir([ftype])

Parse pyflwdir.FlwdirRaster object parsed from the wflow ldd

Wflow workflows

workflows.hydrography(ds, res[, xy, ...])

Returns hydrography maps (see list below) and FlwdirRaster object based on gridded flow direction and elevation data input.

workflows.topography(ds, ds_like[, ...])

Returns topography maps (see list below) at model resolution based on gridded elevation data input.

workflows.river(ds[, ds_model, river_upa, ...])

Returns river maps

workflows.river_bathymetry(ds_model, gdf_riv)

Get river width and bankfull discharge from gdf_riv to estimate river depth using hydromt.workflows.river_depth().

workflows.landuse(da, ds_like, fn_map[, ...])

Returns landuse map and related parameter maps.

workflows.soilgrids(ds, ds_like, ptfKsatVer, ...)

Returns soil parameter maps at model resolution based on soil properties from SoilGrids datasets.

workflows.soilgrids_sediment(ds, ds_like, ...)

Returns soil parameter maps for sediment modelling at model resolution based on soil properties from SoilGrids dataset.

workflows.waterbodymaps(gdf, ds_like[, ...])

Returns waterbody (reservoir/lake) maps (see list below) at model resolution based on gridded upstream area data input or outlet coordinates.

workflows.reservoirattrs(gdf[, priorityJRC, ...])

Returns reservoir attributes (see list below) needed for modelling.

workflows.glaciermaps(gdf, ds_like[, ...])

Returns glacier maps (see list below) at model resolution.

workflows.glacierattrs(gdf[, TT, Cfmax, ...])

Returns glacier intbls (see list below).

Wflow low-level methods

Input/Output methods

read_csv_results(fn, config, maps)

Read wflow results csv timeseries and parse to dictionnary