-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Having trouble with time dim of CMIP5 dataset #531
Comments
Hi @jsbj, The fancy indexing notation you're trying to use only works when xray successfully decodes the time dimension. As discussed in the documentation here, this only works when the year of record falls between 1678 and 2262. Since you have years 2262-2300 in your dataset, this is a feature - xray is failing gracefully. There are a few current open discussions on this behavior, which is an issue higher up the python chain with numpy:
For now, a very simple hack would be to re-compute your time units so that they're re-based, say, with units 'days since 1700-01-01 00:00:00'. That way all of them would fit within the permissible range to use the decoding routine built into xray. You could simply pass the decode_cf=False flag when you open the dataset, modify the non-decoded time array and units, then run xray.decode_cf() on the modified dataset. |
Thanks Daniel, that workaround totally works. -j 2015-08-14 15:26 GMT-04:00 Daniel Rothenberg [email protected]:
|
@jsbj - glad to hear you were able to work around this. Extended calendar support in numpy, pandas, and xray is something we're all rooting for. I'm going to close this as a |
Hi guys,
I was trying to use xray to look at CMIP5 data (e.g. https://dl.dropboxusercontent.com/u/1392864/rlut_Amon_BCC-bcc-csm1-1_rcp85_r1i1p1.nc), and the time dimension seems to fail. If I call
And thereafter I get
Is this all because the run goes to 2300?
Thanks!
Jonah
The text was updated successfully, but these errors were encountered: