Error when calculating Parcel Path for sounding #2052
-
Hi everyone, I made an account just to ask a question about an error that has recently arose and I can't seem to find a way around. I am pretty new to coding and am following the MetPy Monday tutorial videos on Youtube (and using more updated code in the MetPy example gallery to keep it compatible with v1.1). I am currently on video 19, creating the parcel path line, and when I run the code in Jupyter Notebook, I get an error stating: InvalidSoundingError Traceback (most recent call last) ~\anaconda3\envs\weather\lib\site-packages\metpy\xarray.py in wrapper(*args, **kwargs) ~\anaconda3\envs\weather\lib\site-packages\metpy\units.py in wrapper(*args, **kwargs) ~\anaconda3\envs\weather\lib\site-packages\metpy\calc\thermo.py in parcel_profile(pressure, temperature, dewpoint) ~\anaconda3\envs\weather\lib\site-packages\metpy\calc\thermo.py in _parcel_profile_helper(pressure, temperature, dewpoint) InvalidSoundingError: I have looked up this error and cannot seem to find anyone else who has experienced a similar problem. Do any of you know why this error would arise, and if so, how to fix it? Many thanks in advance. I apologize if this was a rather silly question to ask, but I am just stuck on this error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The error you're seeing is The error message suggests using import scipy.signal
pressure = scipy.signal.medfilt(pressure, 5) What does your Also, is there some way we can improve the error message to make this more clear? |
Beta Was this translation helpful? Give feedback.
The error you're seeing is
InvalidSoundingError: Pressure does not decrease monotonically in your sounding.
. What that means is that the pressure values in your sounding are not consistently decreasing. That means for one or more indicesn+1
in the pressure array of your data, the value is equal or less than the pressure at indexn
. Most of MetPy's sounding calculations assume that pressure is decreasing as you go along in the array.The error message suggests using
scipy.signal.medfilt
as a way to try to filter your pressure values to make them decrease if the problem is just due to noise in measurements. Something like:Wh…