hydromt_delft3dfm.DFlowFMModel#
- class hydromt_delft3dfm.DFlowFMModel(root: str | Path, mode: str = 'w', mdu_filename: str | None = None, data_libs: list[str] = [], crs: int | str | None = None, dimr_filename: str | None = None, network_snap_offset: float = 25, snap_newbranches_to_branches_at_snapnodes: bool = True, openwater_computation_node_distance: float = 40)[source]#
API for Delft3D FM models in HydroMT.
Initialize the DFlowFMModel.
- Parameters:
root (str or Path) – The model root location.
mode ({'w','r','r+'}) – Write/read/append mode. Default is “w”.
mdu_filename (str, optional) – The D-Flow FM model configuration file (.mdu). If None, the default mdu filepath is used. If a dimr file is present, the mdu_filename argument is ignored and it is read from that file instead. Default is None.
data_libs (list of str, optional) – List of data catalog yaml files. Default is None.
crs (EPSG code, int) – EPSG code of the model. Required with mode=”w”. Optional with mode=”r”. The default is None.
dimr_filename (str, optional) – Path to the dimr configuration file. If None, default dimr configuration file is used. Default is None.
network_snap_offset (float, optional) – Global option for generation of the mesh1d network. Snapping tolerance to automatically connecting branches. By default 25 m.
snap_newbranches_to_branches_at_snapnodes (bool, optional) – Global option for generation of the mesh1d network. By default True.
openwater_computation_node_distance (float, optional) – Global option for generation of the mesh1d network. Distance to generate mesh1d nodes for open water system (rivers, channels). By default 40 m.
- __init__(root: str | Path, mode: str = 'w', mdu_filename: str | None = None, data_libs: list[str] = [], crs: int | str | None = None, dimr_filename: str | None = None, network_snap_offset: float = 25, snap_newbranches_to_branches_at_snapnodes: bool = True, openwater_computation_node_distance: float = 40)[source]#
Initialize the DFlowFMModel.
- Parameters:
root (str or Path) – The model root location.
mode ({'w','r','r+'}) – Write/read/append mode. Default is “w”.
mdu_filename (str, optional) – The D-Flow FM model configuration file (.mdu). If None, the default mdu filepath is used. If a dimr file is present, the mdu_filename argument is ignored and it is read from that file instead. Default is None.
data_libs (list of str, optional) – List of data catalog yaml files. Default is None.
crs (EPSG code, int) – EPSG code of the model. Required with mode=”w”. Optional with mode=”r”. The default is None.
dimr_filename (str, optional) – Path to the dimr configuration file. If None, default dimr configuration file is used. Default is None.
network_snap_offset (float, optional) – Global option for generation of the mesh1d network. Snapping tolerance to automatically connecting branches. By default 25 m.
snap_newbranches_to_branches_at_snapnodes (bool, optional) – Global option for generation of the mesh1d network. By default True.
openwater_computation_node_distance (float, optional) – Global option for generation of the mesh1d network. Distance to generate mesh1d nodes for open water system (rivers, channels). By default 40 m.
Methods
__init__(root[, mode, mdu_filename, ...])Initialize the DFlowFMModel.
add_component(name, component)Add a component to the model.
build(*[, write])Single method to build a model from scratch based on settings in steps.
close()Close all components by closing their open files.
from_dict(model_dict)Construct a model with the components and other init arguments in the yaml file located at path.
from_yml(path)Construct a model with the components and other init arguments in the yaml file located at path.
get_component(name)Get a component from the model.
Return (refdate, tstart, tstop) tuple.
Initialise the hydrolib-core FMModel object.
read()Read the complete model schematization and configuration from file.
set_branches(branches)Update the branches object as well as the linked geoms.
set_branches_component(name)Extract component name from branches and add it to geoms.
setup_1dboundary([boundaries_geodataset_fn, ...])Prepare the 1D
boundary_typeboundaries using timeseries or a constant.setup_1dlateral_from_points([...])Prepare the 1D lateral discharge from geodataset of point geometries.
Prepare the 1D lateral discharge from geodataset of polygons.
setup_2dboundary([boundaries_fn, ...])Prepare the 2D boundaries from line geometries.
setup_bridges([bridges_fn, ...])Prepare bridges, including bridge locations and bridge crossections.
setup_channels(region, channels_fn[, ...])Prepare the 1D channels and adds to branches 1D network.
setup_config(**data)Set the config dictionary at key(s) with values.
setup_culverts([culverts_fn, ...])Prepare culverts, including locations and crossections.
setup_link1d2d([link_direction, link_type, ...])Generate 1d2d links that link mesh1d and mesh2d according UGRID conventions.
setup_manholes([manholes_fn, ...])Prepare the 1D manholes to pipes or tunnels.
setup_maps_from_raster_reclass(**data)add_raster_data_from_raster_reclass().setup_maps_from_rasterdataset(**data)add_raster_data_from_rasterdataset().setup_mesh2d(region[, res])Create a 2D unstructured mesh according UGRID conventions.
setup_mesh2d_refine([polygon_fn, sample_fn, ...])Refine the 2d mesh.
setup_pipes(region, pipes_fn[, ...])Prepare the 1D pipes and adds to 1D branches.
setup_rainfall_from_constant(constant_value)Prepare constant 2D daily rainfall_rate timeseries based on
constant_value.Prepare spatially uniform 2D rainfall forcings from
meteo_timeseries_fn.setup_retentions([retentions_fn, ...])Prepare the 1D retentions branches.
setup_rivers(region, rivers_fn[, ...])Prepare the 1D rivers and adds to 1D branches.
setup_rivers_from_dem(region, hydrography_fn)Set the all river parameters from hydrograph and dem maps.
test_equal(other)Test if two models are equal, based on their components.
update(*[, model_out, write, steps, ...])Single method to update a model based the settings in steps.
write()Write the complete model schematization and configuration to file.
write_data_catalog([root, data_lib_path, ...])Write the data catalog to data_lib_path.
Attributes
boundaries1D boundary locations.
Return model mesh bounds.
Return the branches (gpd.GeoDataFrame object) representing the 1D network.
Extract channels from branches.
Closed system branches (pipe, tunnel).
Return model crs.
Hydrolib-core FMModel object.
Return the dimr component.
Return the forcing component.
Return the geoms component.
Return the inifield component.
Return the mdu component.
Return the mesh component.
nameOpen system branches (river, channel).
Extract pipes from branches.
Return the model's region component.
Extract rivers from branches.
data_catalogDataCatalog for data access
Model root