Re: [python-users] MetPy Error Question

  • To: "Cavin, Jeanette Rose" <cavin1jr@xxxxxxxxx>
  • Subject: Re: [python-users] MetPy Error Question
  • From: Ryan May <rmay@xxxxxxxx>
  • Date: Fri, 21 Apr 2023 13:29:03 -0600
Greetings!

The other response regarding the nature of the error is correct: the
calculation needs pressure's that are non-increasing. Some datasets have
oddities where the recorded values increase, usually due to precision
issues.

The example given about scipy.signal.medfilt is attempting to use
Scipy's "median filter" to try to smooth out the pressures to something
that should work without introducing any errors; because we can't actually
guarantee this works for all cases, we don't do it ourselves. To use
medfilt, you would pass it the pressures:

import scipy.signal
press = scipy.signal.medfit(press) * press.units

You can optionally pass as a second argument the number of points to use to
calculate the median (the default is 3).

Hope this helps!

Ryan

On Fri, Apr 14, 2023 at 11:02 AM Cavin, Jeanette Rose <cavin1jr@xxxxxxxxx>
wrote:

> To whom it may concern,
>
> I am currently working on creating a Skew-T for my meteorology class. I
> have created the Skew-T, but I need to add CAPE and CIN. I've followed a
> couple of examples and watched the MetPy Monday videos. I understand what I
> need to do, which is the parcel profile. Whenever I try to do it, I get an
> error stating, "Pressure increases between at least two points in your
> sounding. Using scipy.signal.medfilt may fix this." I am not sure how to
> go about using this suggestion, or if there is anything I am doing wrong
> specifically.
> _______________________________________________
> NOTE: All exchanges posted to Unidata maintained email lists are
> recorded in the Unidata inquiry tracking system and made publicly
> available through the web.  Users who post to any of the lists we
> maintain are reminded to remove any personal information that they
> do not want to be made public.
>
>
> python-users mailing list
> python-users@xxxxxxxxxxxxxxxx
> For list information, to unsubscribe, or change your membership options,
> visit: https://www.unidata.ucar.edu/mailing_lists/
>


-- 
Ryan May
Unidata Deputy Director
UCAR
Boulder, CO
  • 2023 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the python-users archives: