home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 134757704

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/531#issuecomment-134757704 https://api.github.com/repos/pydata/xarray/issues/531 134757704 MDEyOklzc3VlQ29tbWVudDEzNDc1NzcwNA== 1151830 2015-08-25T22:15:22Z 2015-08-25T22:15:22Z NONE

Thanks Daniel, that workaround totally works.

-j

2015-08-14 15:26 GMT-04:00 Daniel Rothenberg notifications@github.com:

Hi @jsbj https://github.com/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 http://xray.readthedocs.org/en/stable/time-series.html#creating-datetime64-data, 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: 1. time decoding error with "days since" https://github.com/xray/xray/issues/521 2. Fix datetime decoding when time units are 'days since 0000-01-01 00:00:00' https://github.com/xray/xray/pull/522 3. ocefpaf - Loading non-standard dates with cf_units https://ocefpaf.github.io/python4oceanographers/blog/2015/08/10/cf_units_and_time/ 4. numpy - Non-standard Calendar Support https://github.com/numpy/numpy/issues/6207

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.

— Reply to this email directly or view it on GitHub https://github.com/xray/xray/issues/531#issuecomment-131214583.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  100980878
Powered by Datasette · Queries took 0.618ms · About: xarray-datasette