I've been trying to use the MetPy function "geostrophic_wind" (see https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.geostrophic_wind.html). I've followed their documentation and it appears the calculation is completed, but when I look at the arrays returned it's all missing values (see attached screenshot). If anyone has familiarity with this function and could provide guidance I'd appreciate some tips about what might be going wrong. Thanks!
Screen-Shot-2023-02-13-at-9.30.38-PM.png
Update: I was able to get the function working on some raw CAM output before I'd done some seasonal averaging. So it's something I didn't do properly in assigning metadata I guess. I'll be able to move on from here. :)
Are you using MetPy 1.4? Did you use .metpy.parse_cf()
at any step? We made some major changes to geographic calculations as part of that release, and it would be great to test a snippet of your data and code to make sure we didn't miss something in testing.
It looks like I'm using MetPy1.2. But no, I did not do .metpy.parse_cf() during the process. I'm not super familiar with metpy, so I wasn't aware this is a possibility.
If you get a chance, upgrade to 1.4 and let me know if it works for you! FWIW, 1.4 is more "physically correct" for geospatial calculations like geostrophic wind
Ok, will do! It will probably be a little while (a few months), hopefully when I'm doing paper reviews.
Last updated: May 16 2025 at 17:14 UTC