issues: 548607657
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
548607657 | MDU6SXNzdWU1NDg2MDc2NTc= | 3689 | Decode CF bounds to coords | 1197350 | closed | 0 | 5 | 2020-01-12T18:23:26Z | 2021-04-19T03:32:26Z | 2021-04-19T03:32:26Z | MEMBER | CF conventions define Cell Boundaries and specify how to encode the presence of cell boundary variables in dataset attributes.
For example consider this dataset:
gives
Despite the presence of the bounds attributes ```
The variables Instead, we should decode all I cannot think of a single use case where one would want to treat these variables as data variables rather than coordinates. It would be easy to implement, but it is a breaking change. Not that this is just a proposal to move bounds variables to the coords part of the dataset. It does not address the more difficult / complex question of how to actually use the bounds for indexing or plotting operations (see e.g. #1475, #1613), although it could be a first step in that direction. Full ncdump of dataset
```
xarray.Dataset {
dimensions:
lat = 192 ;
lon = 288 ;
nbnd = 2 ;
time = 180 ;
variables:
float64 lat(lat) ;
lat:axis = Y ;
lat:bounds = lat_bnds ;
lat:standard_name = latitude ;
lat:title = Latitude ;
lat:type = double ;
lat:units = degrees_north ;
lat:valid_max = 90.0 ;
lat:valid_min = -90.0 ;
lat:_ChunkSizes = 192 ;
float64 lon(lon) ;
lon:axis = X ;
lon:bounds = lon_bnds ;
lon:standard_name = longitude ;
lon:title = Longitude ;
lon:type = double ;
lon:units = degrees_east ;
lon:valid_max = 360.0 ;
lon:valid_min = 0.0 ;
lon:_ChunkSizes = 288 ;
object time(time) ;
time:axis = T ;
time:bounds = time_bnds ;
time:standard_name = time ;
time:title = time ;
time:type = double ;
time:_ChunkSizes = 512 ;
object time_bnds(time, nbnd) ;
time_bnds:_ChunkSizes = [1 2] ;
float64 lat_bnds(lat, nbnd) ;
lat_bnds:units = degrees_north ;
lat_bnds:_ChunkSizes = [192 2] ;
float64 lon_bnds(lon, nbnd) ;
lon_bnds:units = degrees_east ;
lon_bnds:_ChunkSizes = [288 2] ;
float32 tas(time, lat, lon) ;
tas:cell_measures = area: areacella ;
tas:cell_methods = area: time: mean ;
tas:comment = near-surface (usually, 2 meter) air temperature ;
tas:description = near-surface (usually, 2 meter) air temperature ;
tas:frequency = mon ;
tas:id = tas ;
tas:long_name = Near-Surface Air Temperature ;
tas:mipTable = Amon ;
tas:out_name = tas ;
tas:prov = Amon ((isd.003)) ;
tas:realm = atmos ;
tas:standard_name = air_temperature ;
tas:time = time ;
tas:time_label = time-mean ;
tas:time_title = Temporal mean ;
tas:title = Near-Surface Air Temperature ;
tas:type = real ;
tas:units = K ;
tas:variable_id = tas ;
tas:_ChunkSizes = [ 1 192 288] ;
// global attributes:
:Conventions = CF-1.7 CMIP-6.2 ;
... [truncated]
```
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3689/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |