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/899#issuecomment-457854540,https://api.github.com/repos/pydata/xarray/issues/899,457854540,MDEyOklzc3VlQ29tbWVudDQ1Nzg1NDU0MA==,26384082,2019-01-26T18:36:18Z,2019-01-26T18:36:18Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity
If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,165540933
https://github.com/pydata/xarray/issues/899#issuecomment-241661434,https://api.github.com/repos/pydata/xarray/issues/899,241661434,MDEyOklzc3VlQ29tbWVudDI0MTY2MTQzNA==,206773,2016-08-23T08:24:09Z,2016-08-23T08:24:09Z,NONE,"> like we could use the `bounds` attribute in this dataset
Yes. And use of the `bounds` attribute is also CF-compliant.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,165540933
https://github.com/pydata/xarray/issues/899#issuecomment-241470249,https://api.github.com/repos/pydata/xarray/issues/899,241470249,MDEyOklzc3VlQ29tbWVudDI0MTQ3MDI0OQ==,1217238,2016-08-22T16:31:19Z,2016-08-22T16:31:19Z,MEMBER,"Looks like we could use the `bounds` attribute in this dataset to set the bound variables as coordinates automatically:
```
In [2]: ds = xarray.open_dataset('/Users/shoyer/Downloads/20100101120000-ESACCI-L4_GHRSST-SSTdepth-OSTIA-GLOB_LT-v02.0-fv01.1.nc')
In [3]: ds
Out[3]:
Dimensions: (bnds: 2, lat: 3600, lon: 7200, time: 1)
Coordinates:
* time (time) datetime64[ns] 2010-01-01T12:00:00
* lat (lat) float32 -89.975 -89.925 -89.875 -89.825 ...
* lon (lon) float32 -179.975 -179.925 -179.875 ...
* bnds (bnds) int64 0 1
Data variables:
time_bnds (time, bnds) datetime64[ns] 2010-01-01 2010-01-02
lat_bnds (lat, bnds) float32 -90.0 -89.95 -89.95 -89.9 ...
lon_bnds (lon, bnds) float32 -180.0 -179.95 -179.95 ...
analysed_sst (time, lat, lon) float64 nan nan nan nan nan nan ...
analysis_error (time, lat, lon) float64 nan nan nan nan nan nan ...
sea_ice_fraction (time, lat, lon) float64 nan nan nan nan nan nan ...
sea_ice_fraction_error (time, lat, lon) float64 nan nan nan nan nan nan ...
mask (time, lat, lon) float64 2.0 2.0 2.0 2.0 2.0 2.0 ...
In [5]: ds.time.attrs
Out[5]:
OrderedDict([('standard_name', 'time'),
('axis', 'T'),
('bounds', 'time_bnds'),
('comment', ''),
('long_name', 'reference time of sst file')])
In [9]: xarray.concat([ds], dim='time')
Out[9]:
Dimensions: (bnds: 2, lat: 3600, lon: 7200, time: 1)
Coordinates:
* lat (lat) float32 -89.975 -89.925 -89.875 -89.825 ...
* lon (lon) float32 -179.975 -179.925 -179.875 ...
* bnds (bnds) int64 0 1
* time (time) datetime64[ns] 2010-01-01T12:00:00
Data variables:
sea_ice_fraction (time, lat, lon) float64 nan nan nan nan nan nan ...
time_bnds (time, bnds) datetime64[ns] 2010-01-01 2010-01-02
mask (time, lat, lon) float64 2.0 2.0 2.0 2.0 2.0 2.0 ...
lat_bnds (time, lat, bnds) float32 -90.0 -89.95 -89.95 ...
analysis_error (time, lat, lon) float64 nan nan nan nan nan nan ...
analysed_sst (time, lat, lon) float64 nan nan nan nan nan nan ...
sea_ice_fraction_error (time, lat, lon) float64 nan nan nan nan nan nan ...
lon_bnds (time, lon, bnds) float32 -180.0 -179.95 -179.95 ...
In [11]: xarray.concat([ds.set_coords(['time_bnds', 'lat_bnds', 'lon_bnds'])], dim='time')
Out[11]:
Dimensions: (bnds: 2, lat: 3600, lon: 7200, time: 1)
Coordinates:
* lat (lat) float32 -89.975 -89.925 -89.875 -89.825 ...
lat_bnds (lat, bnds) float32 -90.0 -89.95 -89.95 -89.9 ...
* lon (lon) float32 -179.975 -179.925 -179.875 ...
lon_bnds (lon, bnds) float32 -180.0 -179.95 -179.95 ...
* bnds (bnds) int64 0 1
* time (time) datetime64[ns] 2010-01-01T12:00:00
time_bnds (time, bnds) datetime64[ns] 2010-01-01 2010-01-02
Data variables:
sea_ice_fraction (time, lat, lon) float64 nan nan nan nan nan nan ...
mask (time, lat, lon) float64 2.0 2.0 2.0 2.0 2.0 2.0 ...
analysis_error (time, lat, lon) float64 nan nan nan nan nan nan ...
analysed_sst (time, lat, lon) float64 nan nan nan nan nan nan ...
sea_ice_fraction_error (time, lat, lon) float64 nan nan nan nan nan nan ...
```
There's also a bigger issue with stacking vs concatenating, though. I'll open a new issue for that.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,165540933
https://github.com/pydata/xarray/issues/899#issuecomment-241379712,https://api.github.com/repos/pydata/xarray/issues/899,241379712,MDEyOklzc3VlQ29tbWVudDI0MTM3OTcxMg==,206773,2016-08-22T10:59:23Z,2016-08-22T10:59:23Z,NONE,"Now sorry for the delay on my side - just returned from Holidays.
Here is the concrete example: https://www.dropbox.com/sh/1a30p6aya96nftl/AAD6E4aCRkC2PLafZDboFszJa?dl=0
(The *.nc files contain time series of images of analysed sea surface temperatures and are generated by the ESA SST CCI (Climate Change Initiative) project.)
If I open these using `open_mfdataset()` then `lat_bnds`, `lon_bnds`, `time_bnds` have an extra time dimension, which of course doesn't make sense.
Ideally, `lat_bnds`, `lon_bnds`, `time_bnds` should be correctly recognized as kind of coordinates, as you say.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,165540933
https://github.com/pydata/xarray/issues/899#issuecomment-238054193,https://api.github.com/repos/pydata/xarray/issues/899,238054193,MDEyOklzc3VlQ29tbWVudDIzODA1NDE5Mw==,1217238,2016-08-06T23:26:12Z,2016-08-06T23:26:12Z,MEMBER,"Sorry for the delay getting back to you -- could you please share a concrete example of what a single file looks like, and what you want the combined dataset to look like?
There might be a cleaner fix for this by either adjusting the inference logic for which variables to concatenate in `concat` and/or by adjusting the heuristics we use for choosing data variables / coordinates to ensure that `lat_bnds` is correctly picked as a coordinate. For example, perhaps we should use the `bounds` attribute as well as the `coordinates` attribute for inferring coordinate variables when reading netCDF files.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,165540933