Skip to content

Coordinates get transformed to variables #1680

Closed
@olgabot

Description

@olgabot

Code Sample, a copy-pastable example if possible

To get the data to reproduce the example: aws s3 sync s3://olgabot-maca/xarray-coordinates-to-variables/ . or download this .tar.gz file.

gist with code

Problem description

When I create a dataset, I set a bunch of metadata as coordinates, not variables:

screen shot 2017-11-01 at 12 45 39 pm

But when I reload that exact same dataset with xr.open_dataset, the coordinates have be moved into variables!!

screen shot 2017-11-01 at 12 45 54 pm

Interestingly, I think this is happening upon dataset creation because ds.variables already has the erroneous metadata:

screen shot 2017-11-01 at 12 47 20 pm

Expected Output

I expected the coordinates and variables to be consistent between opening and closing the file

Output of xr.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.6.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-97-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

xarray: 0.10.0rc1-2-gf83361c
pandas: 0.20.3
numpy: 1.13.3
scipy: 0.19.1
netCDF4: None
h5netcdf: None
Nio: None
bottleneck: None
cyordereddict: None
dask: None
matplotlib: None
cartopy: None
seaborn: None
setuptools: 36.5.0.post20170921
pip: 9.0.1
conda: None
pytest: None
IPython: 6.1.0
sphinx: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions