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/733#issuecomment-177338857,https://api.github.com/repos/pydata/xarray/issues/733,177338857,MDEyOklzc3VlQ29tbWVudDE3NzMzODg1Nw==,242610,2016-01-30T23:41:47Z,2016-01-30T23:41:47Z,NONE,"I also find it useful, now that I understand it.
But I also find it useful to know if the xarray coordinate is a netcdf coordinate or netcdf dimension: ""[A variable with the same name as a dimension is called a coordinate variable](https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_data_set_components.html#coordinate_variables)"". But I guess that is the same as ""indicating that xarray created the coordinate itself"", as @shoyer mentioned above?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,129630652
https://github.com/pydata/xarray/issues/722#issuecomment-176884522,https://api.github.com/repos/pydata/xarray/issues/722,176884522,MDEyOklzc3VlQ29tbWVudDE3Njg4NDUyMg==,242610,2016-01-29T17:48:15Z,2016-01-29T17:48:15Z,NONE,"Thank you!
I was just wondering how you know then, which one is an ""actual"" coordinate and which one is an indexed (""default"") coordinate?
xarray seem to know this.
Example:
```
In [1]: import xray as xr
In [2]: import numpy as np
In [3]: var1 = xr.DataArray(np.array([1, 2], np.float64), coords=[np.array([1, 2], np.int64)], dims=[""coor1"",], name = ""var1"")
In [4]: var2 = xr.DataArray(np.array([3, 4], np.float64), dims=[""dim1"",], name = ""var2"")
In [5]: ds.var1
Out[5]:
array([ 1., 2.])
Coordinates:
* coor1 (coor1) int64 1 2
In [6]: ds.var2
Out[6]:
array([ 3., 4.])
Coordinates:
* dim1 (dim1) int64 0 1
In [7]: ds.var1.coords
Out[7]:
Coordinates:
* coor1 (coor1) int64 1 2
In [8]: ds.var2.coords
Out[8]:
Coordinates:
* dim1 (dim1) int64 0 1
In [9]: ds.to_netcdf(""/tmp/from_xr.nc"")
```
And then
```
$ ncdump /tmp/from_xr.nc
netcdf from_xr {
dimensions:
coor1 = 2 ;
dim1 = 2 ;
variables:
int64 coor1(coor1) ;
double var1(coor1) ;
double var2(dim1) ;
data:
coor1 = 1, 2 ;
var1 = 1, 2 ;
var2 = 3, 4 ;
}
```
As `dim1` is not written in the file, xarray somehow knows?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,128528319