Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AttributeError: ...multiple values for 'longitude' #183

Closed
pochedls opened this issue Jan 10, 2022 · 1 comment · Fixed by #343
Closed

[Bug]: AttributeError: ...multiple values for 'longitude' #183

pochedls opened this issue Jan 10, 2022 · 1 comment · Fixed by #343
Assignees
Labels
type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@pochedls
Copy link
Collaborator

Not really a bug necessarily, but a behavior we should think about...

What versions of software are you using?

What are the steps to reproduce this issue?

fn = '/p/user_pub/climate_work/pochedley1/cesm2le/TS/b.e21.BSSP370smbb.f09_g17.LE2-1301.020.cam.h0.TS.209501-210012.nc'
ds = xcdat.open_dataset(fn)

AttributeError: cf_xarray can't wrap attribute 'dims' because there are multiple values for 'longitude'. There is no unique mapping from 'longitude' to a value in 'dims'.

ncdump -h /p/user_pub/climate_work/pochedley1/cesm2le/TS/b.e21.BSSP370smbb.f09_g17.LE2-1301.020.cam.h0.TS.209501-210012.nc

double zlon(zlon) ;
zlon:_FillValue = -900. ;
zlon:long_name = "longitude" ;
zlon:units = "degrees_east" ;
zlon:bounds = "zlon_bnds" ;

What happens? Any logs, error output, etc?

It seems that since both lon and zlon have long_name = "longitude" they conflict. zlon is used to denote zonal averaging.

What were you expecting to happen?

Maybe annoying side effects, but I want it to at least open the dataset.

Any other comments?

The ideas that come to mind:

  • Maybe this could simply be opened with xarray - I think subsequent xcdat functionality would work - right?
  • Try to detect this situation and deal with it. I think there is a good argument for not doing this (this is a pretty specific issue). I'd be curious if E3SM has this issue for some output.
  • We could choose the coordinates to handle if data_var is populated (then we would know to use lon instead of zlon).
@pochedls pochedls added the type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jan 10, 2022
@tomvothecoder
Copy link
Collaborator

Related to #285

@tomvothecoder tomvothecoder changed the title AttributeError: ...multiple values for 'longitude' [Bug]: AttributeError: ...multiple values for 'longitude' Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants