Unidata / MetPy

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.
https://unidata.github.io/MetPy/
BSD 3-Clause "New" or "Revised" License
1.26k stars 415 forks source link

Fix xarray support with decode_coords='all' #3664

Closed dopplershift closed 4 weeks ago

dopplershift commented 1 month ago

Description Of Changes

This support was added in pydata/xarray#2844 and handles converting the grid_mapping variable to a coordinate in xarray itself, which was incompatible with some assumptions in parse_cf(). Add some handling for the case where the grid_mapping. Also add decode_coords='all' to our full test suite (parametrized) and adjust a few tests as necessary; this includes removing a test for not removing grid_mapping attribute since that's not a universal truth any more (beyond our control).

This is motivated by being compatible with rioxarray, which relies on decode_coords='all' for its own projection handling, and can be used to load GOES data and do direct image remapping.

Checklist