Potential bug in geopotential to height #2989
-
import metpy.calc
from metpy.units import units
height = np.array([10000]) * units.m
metpy.calc.height_to_geopotential(height)
see image 1
----
gph = np.array([80000]) * units('meter ** 2 / second ** 2')
metpy.calc.geopotential_to_height(gph)
see image 2 According to the docs, the height and gph should be without a few percent of each other at high altitudes. But here it is off bya factor of ~10. I believe this is a bug. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Note the difference in units there, Also, where in the docs did you see the part about them being within a few percent at high altitude? I'd like to see if there's something we should clarify. |
Beta Was this translation helpful? Give feedback.
Note the difference in units there,
geopotential
, as a sort of mass-normalized potential energy cannot be compared directly to height. At a bare minimum you need to divide by gravity. In doing that, you'll see that you get 9984 vs. 8168, which is still not close--but I don't think 8km classifies as "high altitude".Also, where in the docs did you see the part about them being within a few percent at high altitude? I'd like to see if there's something we should clarify.