home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 436638944

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/2547#issuecomment-436638944 https://api.github.com/repos/pydata/xarray/issues/2547 436638944 MDEyOklzc3VlQ29tbWVudDQzNjYzODk0NA== 6628425 2018-11-07T14:23:42Z 2018-11-07T14:23:42Z MEMBER

@tommylees112 I had a look at your dataset and noticed that the time coordinate was not encoded in a way that allows xarray to automatically decode the time values into datetimes. Specifically, the units attribute is not in the format of some unit of time (e.g. 'seconds') since a given reference date. ``` $ ncdump -h Rg_dummy.nc netcdf Rg_dummy { dimensions: time = 1 ; y = 200 ; x = 200 ; variables: double time(time) ; time:_FillValue = NaN ; time:standard_name = "time" ; time:units = "day as %Y%m%d.%f" ; time:calendar = "proleptic_gregorian" ; short Rg(time, y, x) ; Rg:_FillValue = -1s ; Rg:long_name = "HWSD sub sum content" ; Rg:units = "percent wt" ; Rg:valid_range = 97., 103. ; double latitude(y, x) ; latitude:_FillValue = -99999. ; double longitude(y, x) ; longitude:_FillValue = -99999. ;

// global attributes: :Conventions = "CF-1.0" ; :content = "HARMONIZED WORLD SOIL DATABASE; first it was aggregated to one global file; then the missing areas were filled with interpolated data; then separate tiles were extracted" ; :scaling_factor = "20" ; } `` This is whyds.time` is an array of floats when you load the file in. We could discuss how to address that, but depending on your broader needs here that might not be a major concern.

Regarding assigning a new value to the time coordinate, the following should work: python ds['time'] = np.array([times[0]])

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