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
1
vote
1 answer

Error using .assign_latitude_longitude: AttributeError: crs attribute is not available

I am working with the NDFD forecast datasets and would like to assign lat and long within the array to give me the ability to plot the data outside of matplotlib. My versions are: python 3.8,metpy 1.0.0,cartopy 0.18.0, xarray 0.16.2, siphon…
1
vote
1 answer

Metpy and dewpoint_rh

I just started getting the following error while running a program with Metpy: importerror: cannot import name 'dewpoint_rh' from 'metpy.calc' Yesterday my program was working fine. Here is the snippet of code: from metpy.calc import…
1
vote
1 answer

How deal with the UndefinedUnitError?

I downloaded data from noaa and i wanted to calculate vertical velocity using the function vertical_velocity=metpy.calcmpcalc.vertical_velocity(omega,pressure,temperature). But something wrong when i dealing with the units of varibles. import xarray…
1
vote
1 answer

metpy.calc.dewpoint_from_relative_humidity w/ GFS data : ValueError: operands could not be broadcast together with shapes (31,) (34,)

I'm trying to do metpy.plots.SkewT() from GFS data. When I try to calculate Td (from T, rh), the pressure levels don't match up. Is there some clever way (w/ xarray ?) to slice and dice so they line up ? The following code plots the temperature on a…
klueless
  • 33
  • 6
1
vote
2 answers

Error in metpy.calc.wind_direction with era5 data

I downloaded Era5 U and V wind components from era-5 and I am using xarray to read the .nc file and select several lat lon points from the data. After i need to calculate wind speed and direction using metpy.calc function: ds =…
CBernardo
  • 13
  • 2
1
vote
1 answer

Issue with the computation of advection in Metpy

I downloaded ERA5 netcdf data covering the region [30°W-30°E; 0-20°N]. This data downloaded contain horizontal wind components (u, v) and specific humidity (q). I need to calculate horizontal advection of humidity through the use of Metpy function…
1
vote
1 answer

moist_lapse has error "IndexError: invalid index to scalar variable." and has no reason it should

I am using both dry_lapse and moist_lapse to try and find the showalter index of a dataset. I was able to get dry_lapse to run successfully and wanted to use the temperature output of dry in the moist_lapse function. Currently, my code looks like…
MichaelaS
  • 71
  • 1
  • 8
1
vote
1 answer

Error computing frontogenesis with mpcalc

My goal is to compute frontogenesis at a given pressure level using the mpcalc.frontogenesis method. I have read in the relevant data from NOMADS: t7 = data['temp'].sel(lev=700.0,lat=lats,lon=lons) u7 =…
Jack Sillin
  • 75
  • 1
  • 9
1
vote
1 answer

Displaying two horizontal colorbars on this precipitation map leading to large white spaces

I am working on making a nice precipitation map using Metpy. I think this is more of a matplotlib question, but I am stumped on how to add two horizontal colorbars onto this figure. The overall idea is to have snow and rain rates shown on this map…
Matthew B
  • 13
  • 3
1
vote
1 answer

Problem with generating Countour Plot using MetPy

I am trying to generate isobars using MetPy and ContourPlot. I use pressure data from my own netCDF file. The background heatmap is generated correctly, but for contours, there seems to be a kind of an interpolation error. Does anyone know how to…
Marcin Kawka
  • 277
  • 2
  • 9
1
vote
1 answer

calling .metpy.parse_cf() on an xarray.Dataset gives 'ctables' is not defined

calling .metpy.parse_cf() on an xarray.Dataset gives 'ctables' is not defined import xarray as xr import metpy ds = xr.open_dataset('https://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p25deg/Best') >>>…
Ray Bell
  • 1,508
  • 4
  • 18
  • 45
1
vote
1 answer

metpy interpolate_to_grid not working for me with simple data

I have an issue when adapting a simple dataset to generate temperature interpolation map from points #!apt-get update #!apt-get -qq install python-cartopy python3-cartopy #!pip install metpy installed dependecies as using a colab notebook import…
neavilag
  • 609
  • 1
  • 8
  • 20
1
vote
1 answer

Level 2 radar file "is not in the registry"

I'm trying to plot level2 radar data for a tornado outbreak in Michigan 2016. When I try calling the radar data file, it gives me a "File 'myfilename' is not in the registry". However, when I use the exact example KTLX file used in the Metpy website…
Matt T.
  • 21
  • 2
1
vote
1 answer

issue trying to use parcel profile

Novice user here. I'm running into an issue when trying to use parcel_profile, it keeps kicking out an error saying the variable has no units associated with it: Traceback (most recent call last): File "Advanced_Sounding_3Dnetcdf2.py", line 165,…
nucci
  • 17
  • 3
1
vote
1 answer

MetPy Geocolor Satellite Tutorial Breakage

I am encountering an error in MetPy when following the geocolor satellite imagery tutorial. Specifically, the section entitled "Plot with Cartopy Geostationary Projection". This breakage occurred roughly two weeks ago and functionality has yet to…
jlave
  • 226
  • 3
  • 7