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

Monthly mean dimensions cause undersired behavior when loading multiple files. #72

Closed
simonpf opened this issue Jan 22, 2024 · 1 comment · Fixed by #73
Closed

Monthly mean dimensions cause undersired behavior when loading multiple files. #72

simonpf opened this issue Jan 22, 2024 · 1 comment · Fixed by #73
Assignees

Comments

@simonpf
Copy link
Contributor

simonpf commented Jan 22, 2024

The monthly mean files currently contain a time dimension that covers the first 24 hours of the corresponding month. When multiple monthly mean files are opened and concatenated, this causes extension of both the month dimension and the time dimension, although time, which corresponds to the hour of the day, should be shared across the concatenated file.

I'd therefore suggest to rename the time dimensions to hour_of_day and make it a float or, if supported, a timedelta value.

@adriaat
Copy link
Contributor

adriaat commented Jan 23, 2024

Good that you noticed this.

See PR #73.

I set hour_of_day to timedelta64... timedelta64[ns]. It's annoying to save such a large time delta as as nanosecond integers; currently only this data type can be used with xarray (see pydata/xarray#1143), but I think this integrates better with month.

Remember that to get hour_of_day as float one can use hour_of_day / np.timedelta64(1, 'h').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants