When retrieving WATHTE data for HOEKVHLD, I get extremes instead of plain measurements. This happens partly because there is no distinction between extremes (Groepering.Code=GETETM2) and normal measurements (Groepering.Code=NVT)
What I Did
import datetime as dt
import ddlpy
locations = ddlpy.locations()
codes = ['HOEKVHLD', 'IJMDBTHVN','SCHEVNGN']
parameters = ['WATHTE']
selected = locations[locations.index.isin(codes)]
selected = selected[selected['Grootheid.Code'].isin(parameters)]
records = selected.loc['HOEKVHLD']
# if we pass one row to the measurements function you can get all the measurements
measurements = ddlpy.measurements(records, dt.datetime(1980,1,1), dt.datetime(1980,1,5))
measurements.plot(y='Meetwaarde.Waarde_Numeriek', linewidth=0.5, figsize=(13, 8))
Gives:
When we do this for 1990, we do get WATHTE:
So this behaviour is not consistent. The 1990 timeseries is probably a combination of waterlevels and extremes, since we have 8 duplicated time values (measurements["Tijdstip"].duplicated().sum() gives 8)
Solution
We need to:
[x] add "Groeperingen": true in endpoints.json
[x] add to _measurements_slice in ddlpy.py
[ ] maybe more: MeetApparaten (not needed, filtering after retrieval might be easier), Typeringen
[x] update example script/notebook
Currently included in OphalenCatalogus query:
Compartimenten (OW/Oppervlaktewater)
Eenheden (cm)
Grootheden (WATHTE, WATHTEASTRO, WATHTEVERWACHT)
Hoedanigheden (NAP, MSL, TAW)
Parameters (NVT) >> can be dropped since all are verontreinigingen?
Consider adding:
Groeperingen (NVT, GETETM2, GETETMSL2)
MeetApparaten (127/Vlotter, 125/Stappenbaak, 109/Radar, etc) >> does this alter the return dataframe into a list or is it merged or only the first one used?
Typeringen (NVT, GETETTPE/Getijextreemtype, etc)
Probably no added value:
WaardeBepalingsmethoden (see below)
WaardeBepalingsmethoden Code+Omschrijving:
1463 other:F007 Rekenkundig gemiddelde waarde over vorige 5 en volgende 5 minuten
1464 other:F009 Visuele aflezing van blad
1465 other:F010 HW en LW uit 1 min. waterhoogten gefilterd uit 10 min. gem.
1466 other:F001 Rekenkundig gemiddelde waarde over vorige 10 minuten
Additional info
This might be a breaking change, since all WATHTE queries should now also contain Groepering, since otherwise multiple rows in dataframe which is not accepted by ddlpy.measurements()
Description
When retrieving WATHTE data for HOEKVHLD, I get extremes instead of plain measurements. This happens partly because there is no distinction between extremes (Groepering.Code=GETETM2) and normal measurements (Groepering.Code=NVT)
What I Did
Gives:
When we do this for 1990, we do get WATHTE:
So this behaviour is not consistent. The 1990 timeseries is probably a combination of waterlevels and extremes, since we have 8 duplicated time values (
measurements["Tijdstip"].duplicated().sum()
gives8
)Solution
We need to:
"Groeperingen": true
in endpoints.json_measurements_slice
in ddlpy.pyCurrently included in
OphalenCatalogus
query:Consider adding:
Probably no added value:
WaardeBepalingsmethoden Code+Omschrijving: 1463 other:F007 Rekenkundig gemiddelde waarde over vorige 5 en volgende 5 minuten 1464 other:F009 Visuele aflezing van blad 1465 other:F010 HW en LW uit 1 min. waterhoogten gefilterd uit 10 min. gem. 1466 other:F001 Rekenkundig gemiddelde waarde over vorige 10 minuten
Additional info This might be a breaking change, since all WATHTE queries should now also contain Groepering, since otherwise multiple rows in dataframe which is not accepted by ddlpy.measurements()