transboundary_inflow
transboundary_inflow
Foreign inflows (buitenlandse aanvoer) on the FlowBoundaries of the regional models.
data/buitenlandse_aanvoer.csv lists each foreign inflow once: its water authority, the name of its FlowBoundary, its location and hydro-object, an optional measured timeseries, and three constant flow rates [m3/s]. For inflows with measurements, the constants are the medians over all measurements, over the summer (April to September) and over the winter (October to March), see pipeline/_preprocess_buitenlandse_aanvoer.py.
The inflows are matched to the FlowBoundaries of the meta_categorie “buitenlandse aanvoer” by name, and checked against their location. The hydro-objects are recorded to later match the inflows independently of the schematization.
Functions
| Name | Description |
|---|---|
| add_transboundary_inflow | Set the measured daily flow rates of the foreign inflows of the water authority, from start to end time. |
| match_flow_boundaries | Match the inflows to the FlowBoundaries of the meta_categorie “buitenlandse aanvoer”, by name. |
| median_flow_rates | The constants of an inflow: the median flow rates of all days, of the summer and of the winter [m3/s]. |
| read_overview | Read and check the foreign inflows of OVERVIEW_CSV, indexed by their id. |
| read_timeseries | Read the daily mean flow rates [m3/s] of a measured inflow, without the days without measurements. |
| set_constant_inflow | Set the foreign inflows of the water authority to one of their constants. |
add_transboundary_inflow
transboundary_inflow.add_transboundary_inflow(
model,
authority,
starttime,
endtime,
)Set the measured daily flow rates of the foreign inflows of the water authority, from start to end time.
Gaps in the measurements are interpolated linearly. Before the first and after the last measurement, the flow rate is constant_global. Inflows without measurements get constant_global as static flow rate.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Model | model of the water authority | required |
| authority | str | water authority | required |
| starttime | datetime | first day | required |
| endtime | datetime | last day | required |
match_flow_boundaries
transboundary_inflow.match_flow_boundaries(model, inflows)Match the inflows to the FlowBoundaries of the meta_categorie “buitenlandse aanvoer”, by name.
Each such FlowBoundary must be matched by exactly one inflow, within MAX_DISTANCE of its location.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Model | model | required |
| inflows | pd.DataFrame | the inflows of the water authority of the model, see read_overview |
required |
Returns
| Name | Type | Description |
|---|---|---|
| pd.Series | the node IDs of the FlowBoundaries, by inflow id |
median_flow_rates
transboundary_inflow.median_flow_rates(flow_rate)The constants of an inflow: the median flow rates of all days, of the summer and of the winter [m3/s].
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| flow_rate | pd.Series | daily flow rates | required |
Returns
| Name | Type | Description |
|---|---|---|
| dict[Constant, float] | the constants |
read_overview
transboundary_inflow.read_overview(authority=None)Read and check the foreign inflows of OVERVIEW_CSV, indexed by their id.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| authority | str | None | only the inflows of this water authority | None |
Returns
| Name | Type | Description |
|---|---|---|
| pd.DataFrame | the inflows |
read_timeseries
transboundary_inflow.read_timeseries(timeseries, column)Read the daily mean flow rates [m3/s] of a measured inflow, without the days without measurements.
The timestamps in the column Datum are local wall-clock time; the hour repeated by the autumn DST fall-back is averaged into its day. Values that are not numeric are ignored, and negative flow rates are clipped to zero.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| timeseries | str | CSV file, relative to TIMESERIES_DIR |
required |
| column | str | column of the inflow | required |
Returns
| Name | Type | Description |
|---|---|---|
| pd.Series | daily mean flow rates |
set_constant_inflow
transboundary_inflow.set_constant_inflow(
model,
authority,
constant='constant_global',
)Set the foreign inflows of the water authority to one of their constants.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Model | model of the water authority | required |
| authority | str | water authority | required |
| constant | Constant | the constant of the inflows | 'constant_global' |