API reference#
Wflow model class#
Initialize#
|
Wflow model class. |
Setup components#
|
Update config with a dictionary. |
|
Build the DEM and flow direction for a Wflow model. |
|
Set all river parameter maps. |
|
Add floodplain information to the model schematisation. |
|
Generate maps of lake areas and outlets. |
|
Generate maps of reservoir areas and outlets. |
|
Generate maps of glacier areas, area fraction and volume fraction. |
|
Derive several wflow maps based on landuse-landcover (LULC) data. |
|
Set up landuse maps and parameters including for paddy fields. |
|
Set leaf area index (LAI) climatology maps per month [1,2,3,...,12]. |
Derive cyclic LAI maps from a LULC data source and a LULC-LAI mapping table. |
|
|
Create water demand allocation areas. |
Create the fraction of water allocated from surface water. |
|
|
Prepare domestic water demand maps from a raster dataset. |
|
Create water demand maps from other sources (e.g. industry, livestock). |
|
Add required information to simulate irrigation water demand. |
|
Set KsatHorFrac parameter values from a predetermined map. |
|
Set the RootingDepth. |
|
Derive several (layered) soil parameters. |
|
Set the default gauge map based on basin outlets. |
|
Set a gauge map based on |
|
Set area map from vector data to save wflow outputs for specific area. |
Set the default gauge map based on basin outlets. |
|
|
Generate gridded precipitation forcing at model resolution. |
|
Generate gridded temperature and reference evapotranspiration forcing. |
|
Prepare PET forcing from existig PET data. |
|
Generate constant parameter maps for all active model cells. |
|
Connect wflow to a 1D model by deriving linked subcatch (and tributaries). |
|
Add data variable(s) from |
|
Prepare cold states for Wflow. |
Attributes#
Returns the geometry of the model area of interest. |
|
Returns coordinate reference system embedded in the model grid. |
|
Returns the resolution of the model grid. |
|
Path to model folder. |
|
Model configuration. |
|
Model static gridded data as xarray.Dataset. |
|
Model geometries. |
|
Model forcing. |
|
Model states. |
|
Model results. |
|
Return a dictionary of pandas.DataFrames representing wflow intbl files. |
|
Return the pyflwdir.FlwdirRaster object parsed from wflow ldd. |
|
Returns a basin(s) geometry as a geopandas.GeoDataFrame. |
|
Return a river geometry as a geopandas.GeoDataFrame. |
High level methods#
Read the complete model schematization and configuration from file. |
|
|
Write the complete model schematization and configuration to file. |
|
Single method to build a model from scratch based on settings in opt. |
|
Single method to update a model based the settings in opt. |
|
Initialize the model root. |
General methods#
|
Update config with a dictionary. |
|
Get a config value at key(s). |
|
Update the config dictionary at key(s) with values. |
|
Parse config from file. |
|
Write config to <root/config_fn>. |
|
Add data to grid. |
|
Read wflow static input and add to |
|
Write grid to wflow static data file. |
|
Clip grid to subbasin. |
|
Add data to the geoms attribute. |
|
Read static geometries and adds to |
|
Write geoms in GeoJSON format. |
|
Add data to forcing attribute. |
Read forcing. |
|
|
Write forcing at |
|
Return clippped forcing for subbasin. |
|
Add data to states attribute. |
Read states at <root/instate/> and parse to dict of xr.DataArray. |
|
|
Write states at <root/instate/> in model ready format. |
|
Return clippped states for subbasin. |
|
Add data to results attribute. |
Read results at <root/?/> and parse to dict of xr.DataArray/xr.Dataset. |
|
|
Add table <pandas.DataFrame> to model. |
|
Read table files at <root> and parse to dict of dataframes. |
Write tables at <root>. |
|
|
Parse pyflwdir.FlwdirRaster object parsed from the wflow ldd. |
WflowSediment model class#
Initialize#
|
The wflow sediment model class, a subclass of WflowModel. |
Setup components#
|
Update config with a dictionary. |
|
Build the DEM and flow direction for a Wflow model. |
|
Copy the functionality of WflowModel. |
|
Generate maps of lake areas and outlets. |
|
Generate maps of lake areas and outlets. |
|
Derive several wflow maps based on landuse-landcover (LULC) data. |
|
Set leaf area index (LAI) climatology maps per month [1,2,3,...,12]. |
Derive cyclic LAI maps from a LULC data source and a LULC-LAI mapping table. |
|
|
Generate sediments based canopy height maps. |
|
Generate sediments based soil parameter maps. |
Set the river width parameter based on power-law relationship with a predictor. |
|
Generate sediments based river bed characteristics maps. |
|
Set the default gauge map based on basin outlets. |
|
|
Set a gauge map based on |
|
Set area map from vector data to save wflow outputs for specific area. |
Set the default gauge map based on basin outlets. |
|
Generate constant parameter maps for all active model cells. |
|
Add data variable(s) from |
Attributes#
Returns the geometry of the model area of interest. |
|
Returns coordinate reference system embedded in the model grid. |
|
Returns the resolution of the model grid. |
|
Path to model folder. |
|
Model configuration. |
|
Model static gridded data as xarray.Dataset. |
|
Model geometries. |
|
Model forcing. |
|
Model states. |
|
Model results. |
|
Return the pyflwdir.FlwdirRaster object parsed from wflow ldd. |
|
Returns a basin(s) geometry as a geopandas.GeoDataFrame. |
|
Return a river geometry as a geopandas.GeoDataFrame. |
High level methods#
Read the complete model schematization and configuration from file. |
|
|
Write the complete model schematization and configuration to file. |
|
Single method to build a model from scratch based on settings in opt. |
|
Single method to update a model based the settings in opt. |
|
Initialize the model root. |
General methods#
|
Update config with a dictionary. |
|
Get a config value at key(s). |
Update the config dictionary at key(s) with values. |
|
|
Parse config from file. |
Write config to <root/config_fn>. |
|
|
Add data to grid. |
|
Read wflow static input and add to |
|
Write grid to wflow static data file. |
|
Clip grid to subbasin. |
|
Add data to the geoms attribute. |
|
Read static geometries and adds to |
|
Write geoms in GeoJSON format. |
|
Add data to forcing attribute. |
Read forcing. |
|
|
Write forcing at |
Return clippped forcing for subbasin. |
|
|
Add data to states attribute. |
Read states at <root/instate/> and parse to dict of xr.DataArray. |
|
|
Write states at <root/instate/> in model ready format. |
|
Add data to results attribute. |
Read results at <root/?/> and parse to dict of xr.DataArray/xr.Dataset. |
|
|
Parse pyflwdir.FlwdirRaster object parsed from the wflow ldd. |
Wflow workflows#
|
Create water allocation area. |
|
Create surface water fraction map. |
|
Create domestic water demand maps. |
|
Create non-irrigation water demand maps. |
|
Prepare irrigation maps for paddy and non paddy. |
|
Return hydrography maps (see list below) and FlwdirRaster object. |
|
Return topography maps (see list below) at model resolution. |
|
Return river maps. |
|
Get river width and bankfull discharge. |
|
Resample and reproject PET to the grid of ds_like. |
|
Return landuse map and related parameter maps. |
|
Return climatology of Leaf Area Index (LAI). |
Derive LAI values per landuse class. |
|
|
Derive LAI values from a landuse map and a mapping table. |
|
Burn paddy fields into landuse map and update mapping table. |
|
Create KsatHorfrac map. |
|
Return soil parameter maps at model resolution. |
|
Return soil parameter maps for sediment modelling at model resolution. |
|
Determine Brooks Corey coefficient per wflow soil layer depth. |
|
Update c and kvfrac soil properties for paddy fields. |
|
Return waterbody (reservoir/lake) maps (see list below). |
|
Return reservoir attributes (see list below) needed for modelling. |
|
Return lake attributes (see list below) needed for modelling. |
|
Return glacier maps (see list below) at model resolution. |
|
Return glacier intbls (see list below). |
|
Estimates the root zone storage parameter. |
|
Connect wflow to a 1D model by deriving linked subcatchs (and tributaries). |
|
Prepare cold states for Wflow. |
Wflow low-level methods#
Input/Output methods#
|
Read wflow results csv timeseries and parse to dictionnary. |
|
Read pcraster staticmaps at <root/staticmaps> and parse to xarray. |
|
Write staticmaps at <root/staticmaps> in PCRaster maps format. |
Utility methods#
|
Get actual grid values from config including scale and offset. |