wolfhece.hydrology.forcedexchanges
Author: HECE - University of Liege, Pierre Archambeau, Christophe Dessers Date: 2024
Copyright (c) 2024 University of Liege. All rights reserved.
This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
Module Contents
- class wolfhece.hydrology.forcedexchanges.forced_exchanges(workingdir='', fname='', mapviewer=None)[source]
Forced exchanges For Hydrological model.
A forced exchange is a pair of vertices that are coupled together. The first vertex is the upper one, the second is the lower one.
- add_pair_dict(pair: dict)[source]
Add a pair of vertices to the forced exchanges from a dictionary.
- Parameters:
pair (dict) – A dictionary with ‘up’ and ‘down’ keys containing the vertices.
- add_pair_XY(x1, y1, x2, y2, reset_ogl: bool = False)[source]
Add a pair of coordinates to the forced exchanges.
- add_pairs_XY(ups: list[list[float, float]], downs: list[float, float])[source]
Add multiple upstreams to one downstream as forced exchanges.
- Parameters:
ups (list[list[float, float]]) – A list of lists containing the coordinates of the upstream vertices.
downs – A pair containing the coordinates of the downstream vertex.
- get_nearest_pair(x: float, y: float) dict[source]
Get the nearest pair of vertices to the given coordinates.
- Returns:
A dictionary with ‘up’ and ‘down’ keys containing the nearest vertices.
- Return type:
dict
- get_nearest_pair_as_vector(x: float, y: float) wolfhece.PyVertexvectors.vector[source]
Get the nearest pair of vertices as a vector.
- _find_nearest_pair_index(x, y)[source]
Find the index of the nearest pair of vertices to the given coordinates.
- remove_nearest_pairs(xy: list[list[float, float]])[source]
Remove the nearest pairs of vertices to the given coordinates.
- remove_pairs_inside_vector(vec: wolfhece.PyVertexvectors.vector)[source]
Remove pairs of vertices that are inside the given vector.
- Parameters:
vec (vector) – The vector to check against.