Multi-file datasets with different calendars between files (non-monotonic global indexes) #361
tomvothecoder
started this conversation in
4. General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Original comment: #343 (comment)
Thanks for pointing the possibility of datasets using different calendars (which I think is not correct or good practice?).
I ran some experiments to try to open up those files in native
xarray
with different settings.1. Keep time coordinates as integers (
decode_times=False
)Code:
Produces error:
ValueError: Resulting object does not have monotonic global indexes along dimension time
Why is this happening?
Based on the above, it seems like handling this edge case using
preprocess
might be beyond the scope ofxcdat
(data quality, possibly complex workaround).2. Try to decode time coordinates as datetimes (
decode_times=True
)Code:
Produces warning
Produces error:
TypeError: Cannot combine along dimension 'time' with mixed types. Found: Datetime360Day, DatetimeProlepticGregorian. If importing data directly from a file then setting 'use_cftime=True' may fix this issue.
# 3. Try to decode time coordinates as datetimes (decode_times=True)
Code:
Produces error:
TypeError: Cannot combine along dimension 'time' with mixed types. Found: Datetime360Day, DatetimeProlepticGregorian. If importing data directly from a file then setting 'use_cftime=True' may fix this issue.
Originally posted by @tomvothecoder in #343 (comment)
Beta Was this translation helpful? Give feedback.
All reactions