home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1069073130

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/6310#issuecomment-1069073130 https://api.github.com/repos/pydata/xarray/issues/6310 1069073130 IC_kwDOAMm_X84_uMLq 57705593 2022-03-16T12:27:14Z 2022-03-16T12:27:14Z CONTRIBUTOR

@DWesl Thanks for digging into the details of the CF! I read your post in the sense that solution (1) is the one to choose.

I have one more question though before we close this:

When setting "coordinates" as a variable attribute instead of as an encoding, the value of that variable attribute is overwritten when writing to a NetCDF file, see this example: python import xarray as xr ds = xr.Dataset( {"values": ('time', [0.0, 0.1])}, coords={ 'time': ('time', [0, 1]), 'lat': ('time', [5, 4]), 'lon': ('time', [10, 12]) }) ds['values'].attrs['coordinates'] = "time lon lat" ds.to_netcdf("test.nc") shell $ ncdump -h test.nc netcdf test { dimensions: time = 2 ; variables: double values(time) ; values:_FillValue = NaN ; values:coordinates = "lon lat" ; int64 time(time) ; int64 lat(time) ; int64 lon(time) ; } Is this intended, and if so, what is the reason?

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