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

MetPy Skew-T Fiducial Lines and Limits

When making a skew-T chart with MetPy, it can be difficult to see the temperature and dew point traces with the fiducial lines (mixing ratio, moist adiabats, etc.) plotted as well. Is there a method (not seen in the documentation that I see) to fade…
geo_leeman
  • 35
  • 6
2
votes
1 answer

Pint Python module in MetPy - pint.UnitRegistry TypeError - unexpected keyword argument

I'm trying to use a newish Python package for meteorological purposes, MetPy. It relies on using Pint to support units. I'm struggling to import any of the basic modules of MetPy because of an error in the Pint/units part, which is part of the code…
amy712
  • 73
  • 2
  • 6
1
vote
1 answer

Temperature array difference for MetPy

I'm trying to use a metpy script to make Skew-T diagram. My source data uses the Dew Point Depression (dewpt) parameter and the original script uses the Dew Point (Td) parameter. Knowing the Temperature (T), I should change the script for Dew Point…
Marina
  • 13
  • 3
1
vote
1 answer

metpy cross_section function gives nan in output

I'm trying to use metpy to take a cross-section of oceanographic data, because I'm not managing with the OceanSpy package and don't know if there are other packages more suitable for doing this. Advice is welcome :-) I downloaded some sample data…
emmadd
  • 13
  • 4
1
vote
2 answers

Is there a method to convert a Metpy output to numpy variable

I calculated the wind direction using Metpy. How can I extract the values and use the values as input in another part of my program? In the sample code below, I would like to display the direction as a numpy variable, so I can use it in my…
Tee
  • 41
  • 7
1
vote
1 answer

Gridding data to edge of bounds

I have some scatter data of mesonet stations and I want to generate maps for a specific variable. I first want to grid the data and store it in a NetCDF for repeated access. I'm using metpy to generate the grids for the…
deadpickle
  • 115
  • 2
  • 15
1
vote
1 answer

Can height rises/falls be added to the station plots in a DIFAX chart replica?

First, I would like to thank Kevin Goebbert and the MetPy team for providing this very helpful Python code for creating a DIFAX chart replica: https://unidata.github.io/python-gallery/examples/Upperair_Obs.html. I just have a quick question…
1
vote
1 answer

How to resolve 'module 'metpy' has no attribute 'calc'' error when using MetPy in Python?

I have got this error with metpy: AttributeError: module 'metpy' has no attribute 'calc' The code is as follows; import metpy as mp import numpy as np from metpy.units import units df = pd.read_csv('wind.csv', header = 0) u =…
tok
  • 13
  • 3
1
vote
1 answer

Plotting the Parcel Virtual Temp Profile in Metpy 1.5

MetPy 1.5.0 was rolled out earlier today and I get the chance to test out the virtual temperature corrected CAPE/CIN thermo parameters. But, upon trying it out on my end with my novice skills as seen in the figure, the corrected profile (dashed…
CGHA
  • 37
  • 5
1
vote
1 answer

Why is mixing ratio at LCL not the same as for starting condition?

I'm very new to metpy. As a first example I tried to calculate the LCL of an air parcel with T=25°C, p=950hPa and relative humidity=70%. First, the mixing ratio of this air is calculated to be mr: 15.016493919350289 gram / kilogram Afterwards,…
MichaelW
  • 1,328
  • 1
  • 15
  • 32
1
vote
2 answers

Plotting Colorized Map of Specific US Counties with Cartopy - Python

I am attempting to plot colored US counties based on some data, using Cartopy. I have created a dataset of FIPS codes and the count of 1950-2022 tornadoes for the state of Michigan. I have it in a pandas dataframe and a dict (below). I assume I need…
1
vote
1 answer

Type hints for MetPy quantities

I am trying to use type hints throughout my code. For metpy quantities, I find this to be quite hard as they inherit from pint. If I check the type of the quantities I am using I find out that they…
1
vote
1 answer

What is the unit of NEXRAD DPR L3 products when reading with MetPy?

I am currently working with DPR L3 products from NEXRAD and reading them with the metpy library. As far as I understand, the data should be stored as 16-bits integers, but the values are way higher than what I expected. I wanted to have confirmation…
acolin
  • 11
  • 1
1
vote
1 answer

Parallelizing CAPE calculation using metpy function and multi-processing pool

I have tried using pool.map() and pool.allpy() for parallelizing the CAPE estimation but getting errors, below is the code I have been running: import multiprocessing from multiprocessing import Pool from pytictoc import TicToc # conda install…
1
vote
1 answer

Why does subtraction of two units.degC quantities give a units.delta_degC result but subtracting two units.kelvin gives a units.kelvin result in metpy

I'm a metpy user. I was calculating the unit of temperature using metpy. I found one difference in the process of subtraction. For Celsius and Fahrenheit temperatures, subtracting or adding values will output delta_degree_celsius, but for kelvin…
이수현
  • 11
  • 2
1 2
3
14 15