Converting pressure to height #1779
-
Hi, I am processing ERA5 data to look at the relationship of temperature and height over time. I only have the pressure level data, which I believe can be converted to height. Seems like in metpy, there could be two functions to do this: I was wondering about the And when using Any leads would help, thank you!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
import metpy.calc as mpcalc
from metpy.units import units
import numpy as np
press = np.array([1000., 500.]) * units.hPa
temp = np.array([0., -20.]) * units.degC
mpcalc.thickness_hydrostatic(press, temp) that gives me a thickness of |
Beta Was this translation helpful? Give feedback.
pressure_to_height_std
assumes a U.S. Standard Atmosphere, which itself prescribes a particular vertical temperature profile--so unfortunately, you can't give it any temperature information. Whether you can use it depends on whether that assumption is good enough for your purposes.thickness_hydrostatic
calculates the thickness of a layer, given a profile (you can optionally give the function an entire profile and tell it the bottom layer and depth in pressure. I was able to make the function work with the following code: