2

I'm trying to reproduce the Q-Vector example in MetPy, and am getting an error when applying the command:

q_div = -2*mpcalc.divergence(uqvect, vqvect, dx, dy, dim_order='yx')

Error: ValueError: divergence given arguments with incorrect units: u requires "[speed]" but given "meter ** 2 / kilogram / second", v requires "[speed]" but given "meter ** 2 / kilogram / second".

I don't know how to circumvent this problem, because uqvect and vqvect must have the units meter**2/kilogram/second. Any ideas? Or is there a general problem with the MetPy Code, because I just took the code from the MetPy Homepage.

Das_Geek
  • 2,775
  • 7
  • 20
  • 26
  • Would you be able to share what version of MetPy you are using when running into this issue? The appears to be due to a bug that was fixed in version 0.11.1 (see https://github.com/Unidata/MetPy/pull/1197). – Jon Thielen Jan 11 '20 at 21:08
  • I used version 0.11.0, after updating to 0.12.0 everything works! Thank you for the comment. – Philipp Zschenderlein Jan 13 '20 at 10:58

0 Answers0