-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inconsistency between requested/returned time extent in case of summertime #9
Labels
bug
Something isn't working
Comments
This was referenced Apr 3, 2024
veenstrajelmer
changed the title
inconsistency in returned time extent in case of summertime
inconsistency between requested/returned time extent in case of summertime
Apr 3, 2024
The following body gives 4 hour of data, where 3 hours is expected;
|
Check if the same issue arises at Wadar WaterWebservices |
With the new Wadar WaterWebservices the problem does not occur: import requests
import pandas as pd
# general
start_date_str = '2022-03-27T01:00:00.000+01:00'
end_date_str = '2022-03-27T04:00:00.000+01:00'
aquometadata_dict = {'Eenheid': {'Code': 'cm'},
'Grootheid': {'Code': 'WATHTE'},
'Hoedanigheid': {'Code': 'NAP'},
'Groepering': {'Code': ''}}
locatie_dict = {'Code': 'ameland.nes'}
# meas slice
request = {
"AquoPlusWaarnemingMetadata": {
"AquoMetadata": aquometadata_dict
},
"Locatie": locatie_dict,
"Periode": {"Begindatumtijd": start_date_str,
"Einddatumtijd": end_date_str},
}
url_ophalen = "https://waterwebservices.beta.rijkswaterstaat.nl/test/ONLINEWAARNEMINGENSERVICES/OphalenWaarnemingen"
resp = requests.post(url_ophalen, json=request)
if resp.status_code==204:
# this error is raised here, but catched in ddlpy.ddlpy.measurements() so the process can continue.
raise Exception(resp.reason)
result = resp.json()
if not result["Succesvol"]:
raise Exception(result.get("Foutmelding", "No error returned"))
rows = []
for waarneming in result["WaarnemingenLijst"]:
for row in waarneming["MetingenLijst"]:
rows.append(row)
df = pd.json_normalize(rows)
print(df["Tijdstip"]) Results in:
The start/stoptime are now the same as the requested start/stoptime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When requesting data from the ddl, we always get timestamps/extent in UTC+1 back (MET). This makes sense since the data in DONAR is also in MET. However, something perculiar happens when requesting data for summertime dates. The requested timestamp is shifted with one hour. In the example below I am retrieving data from 01:00-04:00 hours (MET), but I get one additional hour of data (01:00-05:00, MET). The summertime starts at 03:00 this night.
Reproducible example:
This prints:
When requesting
'2022-03-27T04:00:00.000+01:00'
to'2022-03-27T08:00:00.000+01:00'
, I get 05:00-09:00 (MET)The text was updated successfully, but these errors were encountered: