API reference#
Wflow model class#
Initialize#
|
Read or Write a wflow model. |
Setup methods#
|
Set the config dictionary at key(s) with values. |
|
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 reservoir areas, outlets and parameters. |
|
Generate maps of controlled reservoir areas, outlets and parameters. |
|
|
Generate maps of glacier areas, area fraction and volume fraction. |
|
Derive several wflow maps based on landuse-landcover (LULC) data. |
Derive several wflow maps based on vector 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. |
Prepare domestic water demand maps from statistics per capita. |
|
|
Create water demand maps from other sources (e.g. industry, livestock). |
|
Add required information to simulate irrigation water demand from grid. |
Add required information to simulate irrigation water demand from vector. |
|
|
Set KsatHorFrac parameter values from a predetermined map. |
Correct vertical saturated hydraulic conductivity with vegetation properties. |
|
|
Set the vegetation_root_depth. |
|
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 precipitation from point timeseries (requires wradlib). |
|
|
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. |
Upgrade the model to wflow v1 format. |
High level and I/O methods#
|
Single method to build a model from scratch based on settings in steps. |
|
Single method to update a model based the settings in steps. |
|
Read components from disk. |
|
Write the complete model schematization and configuration to file. |
|
Read config from <root/filename>. |
|
Write config to <(config_)root/config_fn>. |
|
Read grid model data. |
|
Write grid to wflow static data file. |
|
Clip grid to subbasin. |
|
Read static geometries and adds to |
|
Write geoms in GeoJSON format. |
|
Read forcing. |
|
Write forcing at <root/dir_input/filename> in model ready format. |
Return clipped forcing for subbasin. |
|
Read states at <root/dir_input/state.path_input>. |
|
|
Write states at <root/dir_input/state.path_input> in model ready format. |
Return clippped states for subbasin. |
|
Read outputs at <root/dir_output>. |
|
|
Read table files at <root> and parse to dict of dataframes. |
Write tables at <root>. |
Components#
Return the config component. |
|
Return the staticmaps component. |
|
Return the forcing component. |
|
Return the states component. |
|
Return the WflowTablesComponent instance. |
|
Return the geoms component. |
|
Return the WflowOutputGridComponent instance. |
|
Return the WflowOutputScalarComponent instance. |
|
Return the WflowOutputCsvComponent instance. |
Attributes#
Returns coordinate reference system embedded in region. |
|
Model root |
|
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. |
Other general methods#
|
Update the config toml at key(s) with values. |
|
Get a config value at key. |
|
Add data for the forcing component. |
|
Add data to grid. |
|
Add table <pandas.DataFrame> to model. |
|
Add data to states. |
WflowSediment model class#
Initialize#
|
The wflow sediment model class, a subclass of WflowModel. |
Setup components#
Set the config dictionary at key(s) with values. |
|
|
Build the DEM and flow direction for a Wflow model. |
|
Set all river parameter maps. |
Generate maps of natural reservoir areas (lakes) and outlets. |
|
|
Generate maps of reservoir areas and outlets. |
|
Derive several wflow maps based on landuse-landcover (LULC) data. |
Derive several wflow maps based on vector 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 |
|
Upgrade the model to wflow v1 format. |
High level and I/O methods#
|
Single method to build a model from scratch based on settings in steps. |
|
Single method to update a model based the settings in steps. |
|
Read components from disk. |
|
Write the complete model schematization and configuration to file. |
|
Read config from <root/filename>. |
|
Write config to <(config_)root/config_fn>. |
|
Read grid model data. |
|
Write grid to wflow static data file. |
|
Clip grid to subbasin. |
|
Read static geometries and adds to |
|
Write geoms in GeoJSON format. |
|
Read forcing. |
|
Write forcing at <root/dir_input/filename> in model ready format. |
Return clipped forcing for subbasin. |
|
Read states at <root/dir_input/state.path_input>. |
|
|
Write states at <root/dir_input/state.path_input> in model ready format. |
Read outputs at <root/dir_output>. |
Components#
Return the config component. |
|
Return the staticmaps component. |
|
Return the forcing component. |
|
Return the states component. |
|
Return the WflowTablesComponent instance. |
|
Return the geoms component. |
|
Return the WflowOutputGridComponent instance. |
|
Return the WflowOutputScalarComponent instance. |
|
Return the WflowOutputCsvComponent instance. |
Attributes#
Returns coordinate reference system embedded in region. |
|
Model root |
|
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. |
Other general methods#
Update the config toml at key(s) with values. |
|
|
Get a config value at key. |
|
Add data for the forcing component. |
|
Add data to grid. |
|
Add data to states. |
WflowModel components#
WflowConfigComponent#
|
Manage the wflow TOML configuration file for model simulations/settings. |
Model config values. |
|
Get config options. |
|
Remove a config key and return its value. |
WflowStaticmapsComponent#
|
Wflow staticmaps component. |
Model static gridded data as xarray.Dataset. |
|
Drop variables from the grid. |
WflowForcingComponent#
|
Wflow forcing component. |
Model static gridded data as xarray.Dataset. |
WflowGeomsComponent#
|
Wflow Geoms Component to manage spatial geometries. |
Model geometries. |
|
Get geometry by name. |
WflowStatesComponent#
|
ModelComponent class for Wflow states. |
Model static gridded data as xarray.Dataset. |
WflowTablesComponent#
|
Wflow specific tables component. |
Model tables. |
WflowOutputGridComponent#
|
ModelComponent class for Wflow netcdf_grid output. |
Model static gridded data as xarray.Dataset. |
|
Read netcdf_grid model output at root/dir_output/filename. |
WflowOutputScalarComponent#
|
ModelComponent class for Wflow netcdf_scalar output. |
Model netcdf_scalar output data as xarray.Dataset. |
|
Read netcdf_scalar model output at root/dir_output/filename. |
WflowOutputCsvComponent#
|
ModelComponent class for Wflow csv output. |
Model data in the form of xarray objects. |
|
Read csv model output at root/dir_output/filename. |
Wflow workflows#
|
Create water allocation area. |
|
Create surface water fraction map. |
|
Create domestic water demand maps. |
|
Create domestic water demand maps from statitics per capita. |
|
Create non-irrigation water demand maps. |
|
Prepare irrigation maps for paddy and non paddy. |
|
Prepare irrigation maps for paddy and non paddy from geodataframe. |
|
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. |
|
Interpolate spatial forcing data from station observations to a regular grid. |
|
Return landuse map and related parameter maps. |
|
Derive several wflow maps based on vector landuse-landcover (LULC) data. |
|
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. |
Update USLE C map with planted forest and orchard data. |
|
|
Calculate saturated hydraulic conductivity based on soil and vegetation [mm/d]. |
|
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 soil_brooks_corey_c and soil_ksat_vertical_factor for paddy fields. |
|
Return reservoir location maps (see list below). |
Return reservoir attributes (see list below) needed for modelling. |
|
|
Return (uncontrolled) reservoir attributes (see list below) needed for modelling. |
|
Merge reservoir layers in ds to layers in ds_like. |
|
Merge reservoir layers in ds to layers in ds_like for wflow sediment. |
|
Create a GeoDataFrame of reservoir geometries for the sediment model. |
Create a GeoDataFrame of reservoir geometries for the sediment model. |
|
|
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 output csv timeseries and parse to dictionary. |
Utility methods#
|
Get actual grid values from config including scale and offset. |