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.