Groundwater Production Dossier (GPD)
A Groundwater Production Dossier contains the production figures of a groundwater use system.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import brodata
gpd = brodata.gpd.GroundwaterProductionDossier.from_bro_id("GPD000000012107")
gpd
GroundwaterProductionDossier(broId='GPD000000012107')
There are multiple reports in this Groundwater Production Dossier, where each report contains multiple volume-registrations. The metadata of the reports are contained in the attribute report, and the volumes are contained in the attribute volumeSeries. These two pandas DataFrames are linked to eachother by the column reportId.
gpd.report
| method | beginDate | endDate | |
|---|---|---|---|
| reportId | |||
| 598916 | onbekend | 2019-01-01 | 2019-12-31 |
| 599120 | onbekend | 2021-01-01 | 2021-12-31 |
| 599372 | onbekend | 2020-01-01 | 2020-12-31 |
| 599600 | onbekend | 2024-01-01 | 2024-12-31 |
| 599716 | onbekend | 2023-01-01 | 2023-12-31 |
Show the volume-series
gpd.volumeSeries
| beginDate | endDate | waterInOut | volume | reportId | temperatureIn | |
|---|---|---|---|---|---|---|
| 0 | 2019-01-01 | 2019-01-31 | onttrokken | 16867 | 598916 | NaN |
| 1 | 2019-02-01 | 2019-02-28 | onttrokken | 17230 | 598916 | NaN |
| 2 | 2019-03-01 | 2019-03-31 | onttrokken | 14377 | 598916 | NaN |
| 3 | 2019-04-01 | 2019-04-30 | onttrokken | 16253 | 598916 | NaN |
| 4 | 2019-05-01 | 2019-05-31 | onttrokken | 15115 | 598916 | NaN |
| ... | ... | ... | ... | ... | ... | ... |
| 235 | 2023-08-01 | 2023-08-31 | ingebracht | 0 | 599716 | warm |
| 236 | 2023-09-01 | 2023-09-30 | ingebracht | 0 | 599716 | warm |
| 237 | 2023-10-01 | 2023-10-31 | ingebracht | 0 | 599716 | warm |
| 238 | 2023-11-01 | 2023-11-30 | ingebracht | 0 | 599716 | warm |
| 239 | 2023-12-01 | 2023-12-31 | ingebracht | 0 | 599716 | warm |
240 rows × 6 columns
Plot the volume series and separate volumes by the waterInOut attribute; for injections, further separate by temperatureIn.
f, ax = plt.subplots(figsize=(10, 6))
ax.axhline(0, color="black", lw=0.5)
for waterInOut in gpd.volumeSeries["waterInOut"].unique():
maskInOut = gpd.volumeSeries["waterInOut"] == waterInOut
for temperatureIn in gpd.volumeSeries.loc[maskInOut, "temperatureIn"].unique():
if pd.isna(temperatureIn):
maskTemperatureIn = gpd.volumeSeries["temperatureIn"].isna()
label = f"{waterInOut}"
else:
maskTemperatureIn = gpd.volumeSeries["temperatureIn"] == temperatureIn
label = f"{waterInOut} - {temperatureIn}"
mask = maskInOut & maskTemperatureIn
df = gpd.volumeSeries.loc[mask]
# sort by the column `beginDate`
df = df.sort_values("beginDate")
# make a matplotlib plot of the volume series, with a constant value between beginDate and endDate
x = df.loc[:, ["beginDate", "endDate"]].values.ravel()
y = np.vstack((df["volume"].values, df["volume"].values)).transpose().ravel()
if waterInOut == "onttrokken":
y = -y
# make sure to draw a line between the endDate of one row and the beginDate of the next row if they are not consecutive
mask = (
df["endDate"].values[:-1] + pd.Timedelta(1, "D")
!= df["beginDate"].values[1:]
)
ind = ((np.where(mask)[0] + 1) * 2).tolist()
ind = [0] + ind + [len(x)]
# get next color from the color cycle
color = ax._get_lines.get_next_color()
for i in range(len(ind) - 1):
ax.plot(
x[ind[i] : ind[i + 1]],
y[ind[i] : ind[i + 1]],
label=label if i == 0 else None,
color=color,
)
ax.set_xlim(gpd.volumeSeries["beginDate"].min(), gpd.volumeSeries["endDate"].max())
ax.legend();
Show the rest of the contents of the Groundwater Production Dossier.
gpd_data = gpd.to_dict()
gpd_data.pop("report")
gpd_data.pop("volumeSeries")
gpd_data
{'GroundwaterUsageFacility': 'GUF000000022602',
'broId': 'GPD000000012107',
'corrected': 'nee',
'deliveryAccountableParty': '51468751',
'deregistered': 'nee',
'endTime': '2024-12-31',
'id': 'BRO_0011',
'latestAdditionTime': '2025-04-07T10:12:15+02:00',
'objectRegistrationTime': '2025-04-03T14:12:11+02:00',
'qualityRegime': 'IMBRO/A',
'registrationStatus': 'aangevuld',
'reregistered': 'nee',
'startTime': '2019-01-01',
'underReview': 'nee'}