observations
observations
Add Observation nodes with measured discharges to a model.
The measurement series and the model links they are compared with are taken from the koppeltabel that is also used by ribasim_nl.analyse_results. Each series gets an Observation node at the measurement location, with the measured values. If the series is measured on a single link, the Observation node observes the flow_rate of the connector node of that link, or else of its Junction. The flow_rate of a Junction is the flow through it, the sum of its outflows. These nodes are found by their type and location, which do not change when links are renumbered. Other Observation nodes are not linked, as a reminder; meta_koppeling says why.
Classes
| Name | Description |
|---|---|
| LinkEnd | The node to observe of a koppeltabel link, and the type of the node on the other end. |
LinkEnd
observations.LinkEnd()The node to observe of a koppeltabel link, and the type of the node on the other end.
Functions
| Name | Description |
|---|---|
| add_observation_nodes | Add Observation nodes for the series in coupling, see read_coupling and read_measurements. |
| add_observations | Add an Observation node with the measured discharge for each series of an authority. |
| link_observations | Link the Observation nodes that are not linked yet, for instance in a model coupled from other models. |
| read_coupling | The series of an authority, with the nodes to observe of their links. |
| read_measurements | Daily measured discharges [m3/s] per measurement file, with a time index and a column per series. |
add_observation_nodes
observations.add_observation_nodes(model, coupling, measurements, tolerance=1.0)Add Observation nodes for the series in coupling, see read_coupling and read_measurements.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Model | Ribasim model | required |
| coupling | gpd.GeoDataFrame | series with the node to observe | required |
| measurements | dict[str, pd.DataFrame] | measured discharges | required |
| tolerance | float | maximum distance between the node to observe in coupling and in the model |
1.0 |
Returns
| Name | Type | Description |
|---|---|---|
| Model | updated Ribasim model |
add_observations
observations.add_observations(model, authority)Add an Observation node with the measured discharge for each series of an authority.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Model | Ribasim model | required |
| authority | str | water authority as named in the koppeltabel | required |
Returns
| Name | Type | Description |
|---|---|---|
| Model | updated Ribasim model |
link_observations
observations.link_observations(model, tolerance=1.0, moved_tolerance=50.0)Link the Observation nodes that are not linked yet, for instance in a model coupled from other models.
Series can be measured on links between models, of which only the coupled model has all nodes.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Model | Ribasim model with a meta_waterbeheerder column with the authority of each node | required |
| tolerance | float | maximum distance between the node to observe in the koppeltabel and in the model | 1.0 |
| moved_tolerance | float | maximum distance to a node that was moved to separate it from other nodes, see _match |
50.0 |
Returns
| Name | Type | Description |
|---|---|---|
| Model | updated Ribasim model |
read_coupling
observations.read_coupling(authority)The series of an authority, with the nodes to observe of their links.
Returns
| Name | Type | Description |
|---|---|---|
| gpd.GeoDataFrame | a table with columns MeetreeksC, Aan/Af, negate (whether the measurement has the opposite sign of the flow_rate), ends (the LinkEnd per link, or None if the series is not the sum of the links or a link has no node to observe), koppeling (why ends is None) and geometry of the measurement location |
read_measurements
observations.read_measurements()Daily measured discharges [m3/s] per measurement file, with a time index and a column per series.