Questions tagged [metpy]

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.

MetPy is a Python library for reading, visualizing and performing calculations with weather data. It leverages heavily the xarray library for its data model, though it is designed to work on any data that you can get into a numpy array--sometimes needing unit information, which is provided through the Pint library.

Resources

211 questions
2
votes
1 answer

Getting Value Error for Latitude Argument When Trying to Plot Absolute Vorticity in metpy?

I'm trying to plot a 500 hPa vorticity and keep running into a valueerror and haven't been able to figure it out. Have tried several ideas, including ones from my instructor, and still hasn't worked. My code isn't finished, trying to figure out the…
2
votes
1 answer

How to use vorticiy calculation in metpy version 1.0?

I want to used metpy.calc.vorticity. Previously, its structure was (u, v, dx, dy), but change to (u, v, *, dx=None, dy=None, x_dim=- 1, y_dim=- 2). What is * at the new structure? When I use (u, v), it seems other arguments are optional, I faced…
Ehsan
  • 53
  • 1
  • 7
2
votes
1 answer

How to apply MetPy's cross section analysis to a data set with 2-dimensional lat and lon?

I have 4-dimensional data (time, depth, y, and x), but the latitude and longitude are both 2d arrays. y and x are just the indices, so just integers going from 0, 1...end etc. Very similar to the example data set provided by…
wabash
  • 779
  • 5
  • 21
2
votes
1 answer

Moisture flux divergence using numpy and metpy differ

As described in this question I want to calculate moisture flux divergence at 850 hPa. For this, I have used the code described here, which makes use of the np.gradient function from the numpy package. The code I am using is this: from matplotlib…
2
votes
1 answer

How to calculate moisture flux divergence in python

I want to calculate moisture flux divergence (MFD) over southern Africa. I use u and v wind components at 850 hPa and specific humidity at 850 hPa, for a specific day. I have followed the steps described here: Calculating wind divergence of u and v…
2
votes
1 answer

Metpy mpcalc.absolute_vorticity() with incompatible grids

I'm attempting to follow this training example to calculate QG omega on NCEP/NCAR data but I'm getting hung up on mpcalc.absolute_vorticity. import xarray as xr import metpy.calc as mc import metpy.constants as mpconstants from metpy.units import…
2
votes
1 answer

Can metpy.parse_cf() be used on WRF files?

I'm trying to follow the MetPy cross-section plotting example (https://unidata.github.io/MetPy/latest/examples/cross_section.html), but applying it to WRF output data. I read in the WRF file as an xarray dataset, and then apply…
Jared Lee
  • 53
  • 4
2
votes
1 answer

Metpy: hodograph place point at specified wind data?

I am trying to include wind data at specific heights above the ground into the hodograph of the atmospheric soundings. More specifically, I would like the winds at the surface, 1 km, 3 km, 6 km and 9 km to be plotted as a dot. So far, I just…
user5618251
  • 317
  • 1
  • 9
2
votes
1 answer

How to properly calculate temperature advection with metpy, error with units

I'm kinda new with Metpy. I've been trying to calculate the temperature advection with Metpy but it's been unsuccessful. Since I'm new with this package, I don't understand why needs to have units to work properly. When I calculate temperature…
2
votes
1 answer

Problem adding features overlay to matplotlib plot after interpolation

I have to confess I still have problems understanding the proper setup and relation of the plots and the parts of it with matplotlib, is still confusing how fig with plt with ax relates each other so I just has gone trial and error, docs are…
neavilag
  • 609
  • 1
  • 8
  • 20
2
votes
1 answer

cTables Undefined when importing from metpy.plots?

longtime programmer but new to python and metpy. I'm trying to learn by following the examples on the unidata site and youtube (metpy mondays) I'm trying to follow along with building a simple skew-t lesson and running into an issue. When I try to…
2
votes
2 answers

Is there an issue with the metpy.units function?

I am trying to use a metpy.calc function however every time I attempt to assign units using metpy.units, it will not run. It will sit there and continue running for hours if I let it. The metpy function has worked perfectly fine for me in the past…
2
votes
0 answers

Problems encountered with the Q-Vector Example of MetPy

I'm trying to reproduce the Q-Vector example in MetPy, and am getting an error when applying the command: q_div = -2*mpcalc.divergence(uqvect, vqvect, dx, dy, dim_order='yx') Error: ValueError: divergence given arguments with incorrect units:…
2
votes
1 answer

Calculating vorticity for multiple vertical levels in MetPy

I'm trying to calculate vorticity in MetPy for multiple (consecutive) vertical levels. When I try to calculate it for a single level, everything works fine. Here's the code; I've used the example for cross sections from…
Alex Konrad
  • 47
  • 1
  • 5
2
votes
1 answer

metpy: is there a hurricane marker?

I see metpy has some meteorological symbols in https://github.com/Unidata/MetPy/blob/master/metpy/plots/wx_symbols.py and shown in the gallery here…
Ray Bell
  • 1,508
  • 4
  • 18
  • 45
1
2
3
14 15