home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 128528319

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
128528319 MDU6SXNzdWUxMjg1MjgzMTk= 722 All dimmensions become coordinates? 242610 closed 0     4 2016-01-25T12:39:57Z 2016-12-29T01:12:16Z 2016-12-29T01:12:16Z NONE      

I have a netcdf file that looks like this (ncdump):

``` netcdf filevYpcG2 { dimensions: coor1 = 2 ; dim1 = 2 ; variables: int coor1(coor1) ; coor1:_FillValue = 999999 ; int var1(coor1) ; var1:_FillValue = 999999 ; int var2(dim1) ; var2:units = "unit1" ; var2:_FillValue = 999999 ; var2:attr_name = "variable1" ;

// global attributes: :metadata1 = "metadata1" ; data:

coor1 = 1, 2 ;

var1 = 1, 2 ;

var2 = 3, 4 ; } ```

When opening it in xray (xarray) I therefore expect dim1 to be a dimension and coor1 to be a coordinate, because coor1 is also a variable, coor1(coor1)? But when opening the dataset in xray, I get the following:

``` In [1]: import xray;

In [2]: filename = "/tmp/filevYpcG2"

In [3]: x = xray.open_dataset(filename)

In [4]: x Out[4]: <xray.Dataset> Dimensions: (coor1: 2, dim1: 2) Coordinates: * coor1 (coor1) float64 1.0 2.0 * dim1 (dim1) int64 0 1 Data variables: var1 (coor1) float64 1.0 2.0 var2 (dim1) float64 3.0 4.0 Attributes: metadata1: metadata1

In [5]: x.coords Out[5]: Coordinates: * coor1 (coor1) float64 1.0 2.0 * dim1 (dim1) int64 0 1

In [6]: x.dims Out[6]: Frozen(SortedKeysDict({u'coor1': 2, u'dim1': 2}))

In [7]: x.data_vars Out[7]: Data variables: var1 (coor1) float64 1.0 2.0 var2 (dim1) float64 3.0 4.0 ```

That is, both coor1 and dim1 becomes coordinate variables. I expected only coor1 to become a coordinate variable, and not dim1.

Am I wrohg, or is it meant to be like this?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/722/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 78.12ms · About: xarray-datasette