Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Kyle Y. Parsotan
@Kyl67899
How would you calculate the virtual profile? Would it be similar to the way I calculated the regular temperature?
Ryan May
@dopplershift
@Kyl67899 Email responded to. For future reference, it's best to ask your question in only a single support forum rather than sending it to all of them. That helps keep us from getting overwhelmed and helps keep the content all in one place.
Kyle Y. Parsotan
@Kyl67899
I dont know how to do that on here. But I will try to do that. I can respond on here rather than the emails. Hitting enter sends the messages instead of going to the next line even when I edit it.
Dr Dan Jones 🇦🇶🌊👩‍💻
@DanJonesOcean_twitter

Hi, all. Could I request some help with this issue I've run into when calculating specific humidity? Thanks in advance from a humble oceanographer who is trying to work with atmospheric data (and learn python).

https://stackoverflow.com/questions/68114074/errors-when-using-metpy-to-calculate-specific-humidity

Ryan May
@dopplershift
Hi @DanJonesOcean_twitter! I've posted a response over at https://stackoverflow.com/questions/68114074/errors-when-using-metpy-to-calculate-specific-humidity/68122144#68122144. If that doesn't get your issue solved, feel free to add some comments over there.
Gerrit Holl
@gerritholl
Hi. I'm researching if metpy can save me time interacting with NOAA/NCEI/NWS databases such as the Integrated Surface Dataset (ISD) or the Storm Events Database, compared to directly using pandas. It seems metpy's strength and scope lies more with meteorological calculations than with I/O, though. I would write a function for myself with functionality such as "search storm with those characteristics" in the storm events database, interpret the dates and times (which are in local time), associate units to numbers, and return it as perhaps a pint-pandas object. Would someone know if such functionality exists publicly, either in metpy or elsewhere? Would it be something that might fit in metpy?
Ryan May
@dopplershift
Hi @gerritholl ! I'm not aware of any tools out there to do what you're looking for. If you could create such a function that had general, well-defined functionality (and tests), then we'd be interested in considering it for inclusion.
1 reply
Kyle Y. Parsotan
@Kyl67899
@dopplershift I received your email. The following link has the coding and the error messages attached. Please visit: https://github.com/Kyl67899/wx367
Ryan May
@dopplershift

@Kyl67899 Your problem is this code:

    p,t,td,prof_t = mpcalc.parcel_profile_with_lcl(p,T,Td)

You overwrite the original p variable, which doesn't contain the LCL level, with a new array p that contains the LCL. You then use this p with the extra level together with your original T and Td arrays, rather than the new ones that contain the interpolated values for the LCL, which you put in t and td. Thus they contain different amounts of data and lead to the error message:

ValueError: x and y must have same first dimension, but have shapes (95,) and (96,)

2 replies
Kyle Y. Parsotan
@Kyl67899
@MethaneRain I kind of understan what you are saying about the p and overwriting that same variable ratger than using a different one. However i tried to put the P and changed it in the beginning to be different from the way i read it in. But i will try to fix that and repost if there are additional problems. I did do line by line on the comments to find the error but I didnt think it would be that. Fir the second part I don't understand what you are saying...
4 replies
Sorry about the misspelled words. My phone like to autocorrect.
jmedinah09
@jmedinah09

Hi, I'm getting a strange behavior of the parcel_profile method when using in a skew-t plot. The thing is that it seems to be drawing a bigger area between the parcel path and the observed air temperature. I'm also getting different values of some indexes related of this profile (CAPE, CIN, LIFT, EQLV, and so on)compared with the Wyoming sounding calculation.

I'm calculating this path as follow:
parcel_path = mpcalc.parcel_profile(d['pressure'], d['temperature'][0], d['dewpoint'][0]).

3 replies
jmedinah09
@jmedinah09
índices.png
41 replies
2021071912.78486.skewt.parc.gif
Those plots are based on the same observation of today at 12z.
Ryan May
@dopplershift
@jmedinah09 The difference looks entirely due to the use of different parcels to calculate the vertical parcel profile. You control this with the temperature and dewpoint values you pass to parcel_profile. In the code above, you are passing d['temperature'][0] and d['dewpoint'][0], so you are telling it to use a surface profile. If you want a mixed parcel like Wyoming uses, look at the mixed_layer function.
1 reply
WxmanJ
@WxmanJ
@dopplershift, does MetPy offer the ability to contour a RAOB upper air analysis? I am looking to plot the 700mb Temperature from a global UA netcdf file from ruc.noaa.gov/raobs.
2 replies
Steven Briscoe
@nevets963
Hi folks! I'm processing the L2 Chunks (from AWS) using MetPy. Does anyone know how I get the speed/velocity (or 'rpm') of the radar rotation? I.e. I want to know how long it took for it complete 60 deg. I checked out l2File.rda["AZ_LAT"] but that seems to be the latency for something else I'm yet to understand. Thanks!
3 replies
kimutaijoy
@kimutaijoy
Hi. I want to do a cross_section analysis of NetCDF data with a time dimension longer than one. metpy.parse_cf().squeeze() does not work for that. How should handle the data?
6 replies
jmedinah09
@jmedinah09
Hi everyone! How can I calculate the freezing level in a sounding?
4 replies
Gerrit Holl
@gerritholl
I think the workflows on Unidata/MetPy#1962 will not run until a maintainer approves them. Could a maintainer please do so? Unit tests pass locally but should be tested on GitHub too.
Ryan May
@dopplershift
@gerritholl Looks like it's been run. We'll get to a review on that after we get over the hump getting 1.1 out the door.
Claude Dicaire
@eliteuser26
I've been trying to put a comment on one issue in the Metpy repository but I am unable to send it. It comes back with an error code where I can't comment at this moment. Anyone encountered this issue?
Tried the Android app and the web.
Claude Dicaire
@eliteuser26
Well it resolved itself now about commenting on an issue.
Kyle Y. Parsotan
@Kyl67899
Hello, How do I get the High and low-pressure symbols to show up like on tropicaltidbits website? Code: https://github.com/Kyl67899/Hurricane-Irma-/blob/master/Hurricane_Irma_life_cycle_KYP_project_WX272_halperin_032720.py
54 replies
Kyle Y. Parsotan
@Kyl67899
Is there a mp.calc function for calculating the precipitable water?
2 replies
Kyle Y. Parsotan
@Kyl67899

Can anyone help me as to why when I calculate the mix layer I am getting an error on the height?

p = data['pressure']

T = data['temperature']

Td = data['dewpoint']

hei = data['height']

#https://stackoverflow.com/questions/65985185/cape-cin-returning-incorrect-values

# Calculate the mixed parcel--need to pass pressure as an additional variable to "mix" so that we get
# an appropriate "average pressure" to use as the mixed parcel
    parcel_temp, parcel_dewp, mixed_press = mpcalc.mixed_layer(data['pressure'], data['temperature'],
                                                           data['dewpoint'], data['pressure'],
                                                           height=data['height'], depth=500 * units.m)

#also calculates the same thing
   parcel_temp, parcel_dewp, mixed_press = mpcalc.mixed_layer(p, T, Td, p, hei, depth=500 * units.m)

Error Message:

Traceback (most recent call last):

  File "/home/students/parsotak/wx367/Advanced_Sounding.py", line 168, in <module>
    height=data['height'], depth=500 * units.m)

  File "/wx/python/anaconda3/envs/metpy/lib/python3.7/site-packages/metpy/xarray.py", line 677, in wrapper
    return func(*args, **kwargs)

  File "/wx/python/anaconda3/envs/metpy/lib/python3.7/site-packages/metpy/units.py", line 305, in wrapper
    bound_args = sig.bind(*args, **kwargs)

  File "/wx/python/anaconda3/envs/metpy/lib/python3.7/inspect.py", line 3015, in bind
    return args[0]._bind(args[1:], kwargs)

  File "/wx/python/anaconda3/envs/metpy/lib/python3.7/inspect.py", line 3006, in _bind
    arg=next(iter(kwargs))))

TypeError: got an unexpected keyword argument 'height'

Use this website: https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.mixed_layer.html

8 replies
Kyle Y. Parsotan
@Kyl67899
Hello, Is there a way to calculate the lift of the parcel without the use of metpy? Since the university and system admin at the school refuses to update the metpy to be able to use the function to easily calculate the value?
Ryan May
@dopplershift
If you can't get MetPy updated, then you could always try to follow the docs for that version: https://unidata.github.io/MetPy/v0.12/
35 replies
kimutaijoy
@kimutaijoy
Hi. I'm doing cross-section analysis and I'm calculating Relative Humidity from Specific humidity. In my dataset, the name for temperature variable is ta. From the error, it seems the variable name must read temperature.
ValueError: This function changed in 1.0--double check that the function is being called properly.
relative_humidity_from_specific_humidity given arguments with incorrect units: temperature requires "[temperature]" but given "dimensionless"
26 replies
kimutaijoy
@kimutaijoy
image.png
Ryan May
@dopplershift
@kimutaijoy Can you open an issue or discussion over on GitHub ? That would help get the attention of some other people who are more experienced using cross_section. I'm not quite sure if this is a bug in MetPy or a metadata issue.
Jon Thielen
@jthielen
@dopplershift @kimutaijoy cross_section issue? I can take a look if you point me to the source files and code. From what I can gather in the replies above, my guess is something weird with xarray's keep_attrs behavior (which MetPy's internals may or may not be correctly handling), but won't be able to tell for sure without digging into the actual data and code.
Ryan May
@dopplershift
@jthielen Since I have your attention, I'll kick it over to Discussions real quick since I have the data and repro code snippet
Jon Thielen
@jthielen
:thumbsup:
Ryan May
@dopplershift
@jthielen One quick clarifying question: we should be able to make a cross-section directly on a lat/lon (1D each) grid, right?
Jon Thielen
@jthielen
Yes; the key is having horizontal dimension coordinates and a corresponding metpy_crs added.
Kyle Y. Parsotan
@Kyl67899
Where would I be able to retrieve data archives for GLM and are their examples of python plots with GLM plotted?
1 reply
Kyle Y. Parsotan
@Kyl67899
This message was deleted
1 reply
Kyle Y. Parsotan
@Kyl67899
This message was deleted
Kyle Y. Parsotan
@Kyl67899
This message was deleted
Cath Lagare
@cathrenelag

Hello. I'm trying to calculate the horizontal distribution of the depth of a MAUL (∂θe/∂z < 0). Thanks for the suggestion in stackexhange to try asking here.
I'm processing a WRFout file. First, I tried this

import numpy as np
import xarray as xr
from wrf import (getvar)

eth = np.array(getvar(ncfile, "eth", timeidx=time))
z = np.array(getvar(ncfile, "z", timeidx=time, units="km"))

deth = np.gradient(eth, axis=0)
dz = np.gradient(z, axis=0)
deth_dz = deth/dz

dthdz = xr.DataArray(data=deth_dz, dims=['Height', 'Latitude', 'Longitude'])

But when I do dthdz.sum(dim='Height'), I get very low depth values.
So I tried the suggestion of using thickness_hydrostatic by

eth = getvar(ncfile, "eth", timeidx=time)
pres = getvar(ncfile, "pressure", timeidx=time)
dthdz = mpcalc.thickness_hydrostatic(pres, eth)

However, the results are in 1D so I'm not sure how to do the horizontal plot of the depth.
I would just like to know where I'm doing it wrong. Thank you!

5 replies
Sid Gupta
@sidguptaCS
Hi everyone! My name is Sid and I am new to the MetPy development project. I look forward to contributing and creating an impact! :)
Are there any "major" issues ongoing for this package?
Ryan May
@dopplershift
Hi @sidguptaCS ! If you don't have any issues from your own use of MetPy, I'd take a look at the issue tracker and see what seems clear. I'd recommend starting with something simple since you're just starting out.
Sid Gupta
@sidguptaCS
Sounds good!
jmedinah09
@jmedinah09
Hi folks, where can I find suitable svg tropical cyclone icons as used in this tutorial:https://www.youtube.com/watch?v=Hggn5r3IKJA?
Not sure why it has been so difficult to me to find them although it seems to be kind of simple.
Ryan May
@dopplershift
@jmedinah09 I'm not sure. We have Unidata/MetPy#226 open about trying to add the ability to plot such a symbol to MetPy.
1 reply
Gerrit Holl
@gerritholl
Why did https://github.com/Unidata/MetPy/runs/3235203696 "fail to import metpy.io"?
2 replies