home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 210926466

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/827#issuecomment-210926466 https://api.github.com/repos/pydata/xarray/issues/827 210926466 MDEyOklzc3VlQ29tbWVudDIxMDkyNjQ2Ng== 1217238 2016-04-17T00:09:06Z 2016-04-17T00:09:15Z MEMBER

When you're writing the data back to disk with to_netcdf, try writing something like: ds.to_netcdf('somefile.nc', encoding={'time': {'units': '01-JAN-0001 00:00:00'}}).

But I'm a little surprised this doesn't work by default. Xarray does use '2001-01-01' as a default reference time, but if you pulled the data from an existing dataset (rather than creating the time variable directly yourself such as with numpy or pandas), then it should save the original units in encoding attribute of the time variable, which should then be used to save the units that it writes to the file. If ds is the name of the dataset you open from OpenDAP or save to netcdf, what does the value of ds.time.encoding look like?

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