Skip to content
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

Add one hour to hourly knmi-data #208

Open
rubencalje opened this issue Apr 10, 2024 · 3 comments
Open

Add one hour to hourly knmi-data #208

rubencalje opened this issue Apr 10, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@rubencalje
Copy link
Collaborator

The returned file for hourly knmi data states about the hours in hourly data:
# HH : tijd (HH=uur; UT.12 UT=13 MET; 14 MEZT. Uurvak 05 loopt van 04.00 UT tot 5.00 UT

So the timestamp is allready at the end of the period that the measurement describes (what we want right?).

However, the time is in UT. For daily data we set the index to standard time in the Netherlands with the following code:

# from UT to UT+1 (standard-time in the Netherlands)
df.index = df.index + pd.to_timedelta(1, unit="h")

However, we do not do this for hourly data, which I think we should.

@HMEUW
Copy link
Collaborator

HMEUW commented Apr 10, 2024

This issue has my interest, because I have to work with timeseries of groundwater observations that are affected by the astronomical tide. Therefore, I am trying/working to apply a timezone to all timeseries.

My suggestion for the KNMI data is not to apply a timedelta on the index, but assign the appropriate timezone of the dataset.

@rubencalje
Copy link
Collaborator Author

That is a nice solution as well, although I tend to have issues with a timezone-aware DatetimeIndex. For example, comparing a timezone-aware Timestamp with a timezone-unaware Timestamp gives an error.

The important thing is that we do the same thing everywhere in hydropandas. If I am right, up until now we convert all timestamps to Dutch standard time (winter time). And for measurements that describe an intensity over a specific period, we set the index at the end of the period that the measurement describes.

@HMEUW
Copy link
Collaborator

HMEUW commented Apr 10, 2024

You are right. Timezone-aware and -naive Timestamps gives an error. Even a 'simple' tmin='1990-10-12', does not mix with a timezone-aware DateTime. Therefore, I propose that Timezone-aware should not be the standard in hydropandas.

On the other hand, hard coded references to Dutch common uses are not very friendly for the international expansion plan.

@martinvonk martinvonk added the enhancement New feature or request label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants