Skip to content

How to parse a non-standard time unit format as years since 850-01-01 0:0:0 in xarray library for windows? #7610

Answered by spencerkclark
KervinWen asked this question in Q&A
Discussion options

You must be logged in to vote

Through underlying libraries (cftime in this case) xarray can typically understand date formats like the one listed when decoding times, but the main issue is the use of "years" as the time unit. "years" can have an ambiguous meaning, so the common practice is to not make any assumptions. This paragraph in the Time Coordinate section of the CF Conventions provides some context:

UDUNITS defines a year to be exactly 365.242198781 days (the interval between 2 successive passages of the sun through vernal equinox). It is not a calendar year. UDUNITS defines a month to be exactly year/12, which is not a calendar month. The CF standard follows UDUNITS in the definition of units, but we recomme…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@KervinWen
Comment options

@spencerkclark
Comment options

@KervinWen
Comment options

@spencerkclark
Comment options

Answer selected by keewis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants