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
0
votes
1 answer

mpcalc.advection dim_order in example, and missing values

on the metpy webpage, they example provided for the 850hPa temperature advection is as follows: adv = mpcalc.advection(temp_850 * units.kelvin, [u_wind_850, v_wind_850], (dx, dy), dim_order='yx') * units('K/sec') But based on the…
Jat
  • 1
0
votes
1 answer

Cartopy (0.14.2) / MetPy (0.12.2) parse(cf) error when using Google Colab

I have a student facing a problem that is similar to what others are reporting when using older versions of MetPy and Cartopy. The issue is the parse_cf() command under metpy. And it's happening under Google Colaboratory, of which I have little…
0
votes
1 answer

convert metpy units GFS precipitation_rate

I followed the example here (https://unidata.github.io/python-gallery/examples/Precipitation_Map.html) but when trying to access the units I get a dimensionality error. I'm assuming this is to do with pint and the way it parses units and the fact…
Preston
  • 3
  • 1
0
votes
1 answer

How to Save Cross Section Data to netCDF

I want to save the cross section data along a transect line between two coordinates as a netCDF file. I'm following the example code described in Metpy's Cross Section Analysis: Here's the modified code adding the remove crs command: import…
rgraulus
  • 41
  • 4
0
votes
1 answer

Cross Section Analysis Issue

I'm trying to perform a Cross Section Analysis on a gridded data set following the example code from the Metpy website. First of all, I'm able to read the original grib2 dataset with xarray and also after converting it to netCDF format. I…
rgraulus
  • 41
  • 4
0
votes
1 answer

Why do I get this error when importing MetPy submodules?

I just installed MetPy for the first time using conda install -c conda-forge metpy under Mac OS X 10.14 (Mojave). I appear to have gotten metpy-0.11.1 The following line then generates the error diagnotics copied at the bottom. from metpy.plots…
Grant Petty
  • 1,151
  • 1
  • 13
  • 27
0
votes
1 answer

Add labels to metpy skewt lines

I am trying to add labels to the lines on a skewt diagram using metpy. I'm not sure if it possible (looked at the GitHub for metpy and seems like they haven't yet implemented this ability). But essentially I just want to have labels for moist…
MichaelaS
  • 71
  • 1
  • 8
0
votes
1 answer

suppress printing axis label in metpy

I am generating SkewT plots using MetPy. I am trying to suppress the automatic generation of axis labels and use my own. The automatic labels generated are hectopascal and degree_Celsius.I can't find a way to disable the automatic axis labels so the…
nucci
  • 17
  • 3
0
votes
1 answer

MetPy suface_based_cape_cin returning error with units

At my site, we're having an issue with MetPy returning a units error when trying to call surface_based_cape_cin I am seeing the following error: Traceback (most recent call last): File "Advanced_Sounding_3Dnetcdf2.py", line 202, in
nucci
  • 17
  • 3
0
votes
1 answer

metpy vertical velocity unit issue

I'm trying to estimate the vertical wind velocity from vertical pressure velocity. I found metpy.calc.vertical_velocity(omega, pressure, temperature,…
shimaSH
  • 55
  • 10
0
votes
1 answer

Skewt composite parameter issue

I'm plotting some observed soundings with some composite parameters included in the plot, but I'm having a tiny issue with STP output: it always comes with the square brackets. I tried to check if something with the unities could be causing this,…
Souda
  • 63
  • 4
0
votes
0 answers

Array Element with Sequence Metpy

Hi there I am getting this error: ValueError: setting an array element with a sequence. When I run this code: import metpy.calc as mpcalc from metpy.units import units import cartopy.crs as ccrs import cartopy.feature as cfeat import os from…
0
votes
1 answer

Masking Winds Using Xarray and Metpy

My goal is to plot wind barbs only when they exceed 2/3 the max wind speed observed in the domain of interest (this is one part of the standard Miller Composite map). The code in the MetPy examples that does this for the Miller plot wspd_500 =…
Jack Sillin
  • 75
  • 1
  • 9
0
votes
1 answer

metpy.plots issue with Cartopy Natural Earth

I just noticed that when I try to import metpy.plots on NCAR's Cheyenne supercomputer, it loads and works fine when using metpy 0.10.0 (with Cartopy 0.17.0), but I get an error with metpy 0.12.0 or 0.12.1 (with Cartopy 0.18.0b2). This is the error I…
Jared Lee
  • 53
  • 4
0
votes
1 answer

How to keep the same units from my precipitation data when using masked_array?

I am attempting to create a precipitation map with one nc file, similar to a NWS example that I found here. In my case, though, my precipitation data is already in mm. How do I keep the same units? I did read the following, Create a…
Jocelyn
  • 3
  • 1