hydromt_delft3dfm.workflows.links1d2d_add_links_2d_to_1d_lateral#
- hydromt_delft3dfm.workflows.links1d2d_add_links_2d_to_1d_lateral(mesh: UgridDataset, dist_factor: float | None = 2.0, branchids: List[str] = None, within: Polygon | MultiPolygon = None, max_length: float = inf) Dataset [source]#
Generate 1d2d links from the 2d mesh to the 1d mesh, with a lateral connection.
If a link is kept, is determined based on the distance between the face center and the intersection with the 2d mesh exterior. By default, links with an intersection distance larger than 2 times the center to edge distance of the cell, are removed. Note that for a square cell with a direct link out of the cell (without passing any other cells) this max distance is sqrt(2) = 1.414. The default value of 2 provides some flexibility. Note that a link with more than 1 intersection with the 2d mesh boundary is removed anyway.
Furthermore: - Branch ids can be specified to connect only specific branches. - A ‘within’ polygon can be given to only connect 2d cells within this polygon. - A max link length can be given to limit the link length.
- Parameters:
mesh (xu.UgridDataset) – Network in which the connections are made
dist_factor (Union[float, None], optional) – Factor to determine which links are kept (see description above). Defaults to 2.0.
branchids (List[str], optional) – List is branch id’s for which the conncetions are made. Defaults to None.
within (Union[Polygon, MultiPolygon], optional) – Clipping polygon for 2d mesh that is. Defaults to None.
max_length (float, optional) – Max edge length. Defaults to None.
- Returns:
link1d2d – Link1d2d Dataset.
- Return type:
xr.Dataset