Skip to content

xarray.open_mfdataset returns inconsistent times #1263

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

Closed
willirath opened this issue Feb 12, 2017 · 4 comments
Closed

xarray.open_mfdataset returns inconsistent times #1263

willirath opened this issue Feb 12, 2017 · 4 comments

Comments

@willirath
Copy link
Contributor

Problem

I am running into inconsistent time coordinates with a long climate model experiment that exceeds the limits of pandas.tslib.Timestamp (covers roughly 17th to 23rd century).

Currently, xarray.open_mfdataset delegates decoding of the time axis to xarray.open_dataset which decodes either to pandas time stamps or, of this fails, to netcdftime.datetime objects. xarray.open_mfdataset later combines the single-file datasets and just concatenates all the time axes.

Solution

  1. Let auto_combine check for consistency and repair the time axis if necessary.
  2. Let xarray.open_mfdataset prevent xarray.open_dataset from decoding the times for each file and only decode times after everything is combined.

The latter is equivalent to a workaround I use for the moment: Pass decode_times=False to xarray.open_mfdataset and then explicitly call xarray.decode_cf on the dataset.

@willirath
Copy link
Contributor Author

(This is related to #1261.)

@shoyer
Copy link
Member

shoyer commented Feb 13, 2017

I think I like your solution (2) the best.

@stale
Copy link

stale bot commented Jan 23, 2019

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically

@spencerkclark
Copy link
Member

This remains an issue, though only for dates from a standard calendar now.

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

No branches or pull requests

3 participants