home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 787065391

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/2437#issuecomment-787065391 https://api.github.com/repos/pydata/xarray/issues/2437 787065391 MDEyOklzc3VlQ29tbWVudDc4NzA2NTM5MQ== 6628425 2021-02-27T12:27:41Z 2021-02-27T12:55:36Z MEMBER

Thanks @keewis.

@hafez-ahmad by Julian date do you mean that the time coordinate represents "days since -4713-01-01T12:00:00" in a Julian calendar?

Once we know the units (expressed as "{time_unit} since {reference_date}") and the calendar of the time coordinate, we can convert it to datetime objects via something like the following: ```python

units = "days since -4713-01-01T12:00:00" calendar = "julian" ds["time"] = ds.time.assign_attrs(units=units, calendar=calendar) ds = xr.decode_cf(ds) ```

I'll admit though, with the values in your dataset, this assumption produces dates like cftime.DatetimeJulian(-4527, 1, 30, 12, 0, 0, 0), which feel unlikely to be correct. Perhaps you are using a different reference date?

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