JiaweiZhuang / xESMF

Universal Regridder for Geospatial Data
http://xesmf.readthedocs.io/
MIT License
269 stars 49 forks source link

Handle other generic axis names #72

Closed pochedls closed 4 years ago

pochedls commented 4 years ago

Some CMIP files (mistakenly) use 'longitude' as an axis id (instead of lon). It would be useful to also handle "longitude" and "latitude" as axis ids.

regridder = xe.Regridder(trend_map, ds_out, 'bilinear', reuse_weights=True)

KeyError: 'lon' During handling of the above exception, another exception occurred: ...

In the meantime, is there a workaround for this issue (other than renaming the input axes)?

JiaweiZhuang commented 4 years ago

This coordinate naming issue is discussed in #38. A quick workaround by renaming coordinate is in #5

I was thinking about implementing a context manager to switch the name, detailed in https://github.com/JiaweiZhuang/xESMF/pull/38#issuecomment-432028269 Comments & PRs are highly welcome.

pochedls commented 4 years ago

@JiaweiZhuang - thank you for your fast response. Since this is a duplicate, I am closing this ticket. I'll take a closer look at the other issues and see if I am able to help with this. Thank you for putting this package together!