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.21k stars 408 forks source link

Add SkewT and Hodograph plotting tests with xarray and fix uncovered bugs #1752

Open jthielen opened 3 years ago

jthielen commented 3 years ago

I haven't been able to come to a quick resolution to https://github.com/Unidata/MetPy/discussions/1749, but did notice/recall along the way that xarray support doesn't really seem to have been tested or considered for MetPy's custom plot types (SkewT and Hodographs). With xarray being the suggested/primary data model now in metpy.calc for MetPy 1.0, these really should be supported as first-class data objects throughout metpy.plots as well.

In some brief notebook investigations, some things "just worked" as long as unit conversions were performed, and others (particularly cape/cin shading) failed completely, so there will be more work than just adding tests.

jthielen commented 3 years ago

Not sure to what extent we need to support it, or if it is something that needs to be handled upstream in Pint, xarray, and/or matplotlib, but based on #1749 we should probably also test what happens when mixing xarray and pint objects in SkewT and Hodograph calls.