233 questions
0
votes
0
answers
57
views
MetPy "interpolate_to_isosurface" results in "IndexError: Unlabeled multi-dimensional array cannot be used for indexing: pressure_level"
I need help on the usage of MetPy's interpolate_to_isosurface function (link).
My goal was to interpolate a gridded meteorological dataset, such that its vertical coordinate is transformed from ...
3
votes
1
answer
818
views
How can I resolve xarray "unrecognized engine cfgrib"?
An example HRRR file I'm trying to open with xarray: https://storage.googleapis.com/high-resolution-rapid-refresh/hrrr.20250427/conus/hrrr.t18z.wrfprsf06.grib2
When trying to open the dataset with ...
0
votes
1
answer
122
views
Unrealistic very large negative CAPE from metpy surface_based_cape_cin() and most_unstable_cape_cin()
From one grid point of ERA5 reanalysis pressure-level data, both surface_based_cape_cin() and most_unstable_cape_cin() functions returned a very large negative CAPE. Tried but haven't figured out ...
0
votes
1
answer
268
views
How to use numpy masked arrays to create a masked xarray DataArray?
I'm using metpy.calc.windchill in order to calculate wind chill values, and it automatically spits out an array with a numpy mask on it.
t2m, uwind, and vwind all come from ERA5 (on the Google Cloud: ...
0
votes
1
answer
104
views
How can I run a code where I can plot and save multiple hours of the latest GFS model run?
I want to plot precip type from the start of the GFS run (hour 0) through hour 240 at 6-hour intervals. (in this code I only try to go to hour 108) Also, at the end of the code when saving the the ...
0
votes
0
answers
108
views
Metpy: Plotting snowfall analysis but issue with colormap
The plot I made for snowfall analysis looks good but when I plot the colorbar, for some reason it skips over the second to last color and using the extend = 'max' function, it only plots the last ...
1
vote
2
answers
200
views
How to properly run Python multiprocessing pool inside larger loop and shut it down before next loop starts
I have a large script where I am processing terabytes of weather/climate data that comes in gridded format. I have a script that uses an outer loop (over years - 1979 to 2024), and for each year, ...
1
vote
1
answer
120
views
How to include exception handling within a Python pool.starmap multiprocess
I'm using the metpy library to do weather calculations. I'm using the multiprocessing library to run them in parallel, but I get rare exceptions, which completely stop the program. I am not able to ...
0
votes
1
answer
86
views
Confusion with metpy water vapor functions
I'm trying to solve for surface turbulent latent heat flux and I need surface saturation humidity (qs) and surface air humidity (qa)
I currently have the 2m dew point temperature and 2m temperature ...
0
votes
1
answer
126
views
How to properly open NARR Grib1 file in Python using MetPy
I am trying to properly open and read a GRIB1 NARR data file as obtained from https://thredds.rda.ucar.edu/thredds/catalog/files/g/d608000/3HRLY/catalog.html.
I have tried using xr.open_dataset with ...
0
votes
1
answer
101
views
Installing Metpy on macOS using pip3
I installed Metpy using pip3 install metpy. However when I try a simple example for using the dew point temperature I get nothing but errors. The errors are related (I think) to the import statements. ...
0
votes
1
answer
1k
views
Metpy error - AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead
Basic python with numpy 2.0 is throwing a big error. I thought metpy 1.6 fixed numpy 2.0 issues. Is anyone still having this? Thanks.
OS: Ubuntu 24.04
Code:
#!/home/ccc/miniconda3/bin/python
import ...
-1
votes
1
answer
92
views
Is hourly climate forecast data for the coming hour? [closed]
Is hourly climate forecast data, for example NOAA GFS model datafiles, for the coming hour, e.g. the 11 AM datafile is for the time from 11:00 to 11:59 AM?
This is what I have been assuming. However, ...
0
votes
1
answer
84
views
errors importing downdraft cape from metpy
I am trying to calculate downdraft CAPE using the Metpy calc function. Although, when I attempt to import this calculation by using:
from metpy.calc import downdraft_cape
But I receiving an import ...
0
votes
1
answer
276
views
Computation of Divergence is metpy 1.6
I think there's a potential issue with the computation that I wanted to raise, but first I needed to figure out exactly how this is computed to verify exactly what might be going wrong, and I think ...