API reference#
DFlowFM model class#
Initialize#
|
API for Delft3D FM models in HydroMT. |
Setup components#
|
Set the config dictionary at key(s) with values. |
|
Prepare the 1D channels and adds to branches 1D network. |
|
Set the all river parameters from hydrograph and dem maps. |
|
Prepare the 1D rivers and adds to 1D branches. |
|
Prepare the 1D pipes and adds to 1D branches. |
|
Prepare the 1D manholes to pipes or tunnels. |
Prepare the 1D |
|
Prepare the 1D lateral discharge from geodataset of point geometries. |
|
Prepare the 1D lateral discharge from geodataset of polygons. |
|
|
Prepare bridges, including bridge locations and bridge crossections. |
|
Prepare culverts, including locations and crossections. |
|
Create a 2D unstructured mesh according UGRID conventions. |
Refine the 2d mesh. |
|
|
Generate 1d2d links that link mesh1d and mesh2d according UGRID conventions. |
|
|
|
|
Prepare the 2D boundaries from line geometries. |
|
Prepare constant 2D daily rainfall_rate timeseries based on |
|
Prepare spatially uniform 2D rainfall forcings from |
Attributes#
Return the model's region component. |
|
Return model crs. |
|
Return model mesh bounds. |
|
Model root |
|
Return the mdu component. |
|
Return the inifield component. |
|
Return the geoms component. |
|
Return the forcing component. |
|
Return the mesh component. |
|
Hydrolib-core FMModel object. |
|
Return the dimr component. |
|
Return the branches (gpd.GeoDataFrame object) representing the 1D network. |
|
Extract rivers from branches. |
|
Extract channels from branches. |
|
Extract pipes from branches. |
|
Open system branches (river, channel). |
|
Closed system branches (pipe, tunnel). |
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 steps. |
|
Single method to update a model based the settings in steps. |
|
Write the data catalog to data_lib_path. |
General methods#
|
Update the branches object as well as the linked geoms. |
Initialise the hydrolib-core FMModel object. |
|
Return (refdate, tstart, tstop) tuple. |
DFlowFMModel workflows#
Boundaries#
Get boundary locations from branches and associate with node IDs. |
|
|
Select boundary location per branch type and boundary type. |
|
Validate boundaries per branch type. |
|
Compute 1d boundary values. |
Compute 2d boundary timeseries. |
|
|
Compute meteo forcings. |
Compute 1d forcing values. |
|
Compute 1d forcing values. |
|
Get xarray DataArray coordinates that describes polygon geometries. |
Branches#
|
Set all common steps to add branches type of objects. |
|
Process the branches. |
|
Validate the branches. |
|
Add branches to exisitng open system branches at mesh1d node locations. |
|
Determine the nearest branch for each geometry. |
Add or update columns in the branches geodataframe. |
|
Update an attribute column of branches. |
|
Snap new_branches to branches at snappednodes. |
|
Snap geoms to branches and drop the ones that are not snapped. |
Crosssections#
Prepare the default uniform friction and crosssection for branches. |
|
Initialise crosssection options from user input. |
|
|
Set regular cross-sections for each branch. |
|
Set up xyz crosssections. |
|
Set regular cross-sections from point. |
|
Add new_crossections to crosssections. |
DEM#
|
Compute up- and downstream invert levels for pipe lines in gdf. |
|
Estimate river bedlevel zb. |
Manholes#
|
Generate manhole location and bedlevel from branches. |
Mesh#
Return xugrid mesh1d and network1d UgridDataset from branches. |
|
|
Add branch to 1d mesh, from a (list of) (Multi)LineString geometry. |
|
Refine mesh2d by adding new nodes and faces. |
Generate 1d2d links to network from 1d to 2d. |
|
Generate embedded links from 2d to 1d. |
|
Generate 1d2d links from the 2d mesh to the 1d mesh, with a lateral connection. |
Region#
|
Parse hydromt region argument into region geometry. |
Roughness#
|
Generate roughness ID column based on frictiontype and frictionvalue. |
Structures#
|
Prepare 1D structures from geodataframe. |
DFlowFM low-level methods#
Input/Output methods#
|
Read branches.gui and add the properties to branches geodataframe. |
|
write branches.gui file from branches geodataframe. |
|
Read crosssections from hydrolib-core crsloc and crsdef objects and add to branches. |
|
Write crosssections into hydrolib-core crsloc and crsdef objects. |
|
Read friction files and add properties to branches geodataframe. |
|
write friction files from crosssections geodataframe. |
|
Read structures into hydrolib-core structures objects. |
|
write structures into hydrolib-core structures objects. |
|
Read manholes from hydrolib-core storagenodes and network 1d nodes for locations. |
|
write manholes into hydrolib-core storage nodes objects. |
|
Read for a specific quantity the external and forcing files and parse to xarray. |
|
Write 1dboundary ext and boundary files from forcing dict. |
|
Read a 1D lateral from external and forcing files. |
|
Write 1dlateral ext and bc files from forcing dict. |
|
Read a 2d boundary forcing location and values, and parse to xarray. |
|
Write 2 boundary forcings from forcing dict. |
|
Read for a specific quantity the external and forcing files and parse to xarray. |
|
Write 2d meteo forcing from forcing dict. |
Mesh conversion methods#
Convert from xugrid mesh to hydrolib-core network object. |
|
|
Create xugrid mesh1d and network1d UgridDataset from hydrolib-core network object. |
Extract link1d2d from hydrolib-core network object. |
|
Create xugrid mesh from hydrolib-core network object. |
|
Return the nodes of mesh 1D as geodataframe. |
|
Get network1d nodes as gdp. |
Graph methods#
Convert a gpd.GeoDataFrame to a nx.DiGraph. |
|
Get the possible boundary locations from the branches with id. |
GIS methods#
|
Get a list of lines splitted from a line. |
|
Cut a line into pieces based on distances. |
|
Check if the geodataframe contains all required columns. |
|
Add or update columns in gdf based on column and values in df. |
Get geodataframe from dataframe. |