233 questions
0
votes
0
answers
41
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 ...
0
votes
1
answer
97
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
83
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 ...
1
vote
2
answers
167
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, ...
0
votes
1
answer
74
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
94
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. ...
-1
votes
1
answer
82
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
253
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 ...
1
vote
1
answer
34
views
Can MetPy PlotGeometry be used to add a Shapely LineString to a contour plot?
The reference guide for metpy.plots.PlotGeometry states that the geometry attribute is a collection of Shapely objects to plot. Unfortunately, I can't get this to work.
Here is a reduction of the ...
0
votes
1
answer
104
views
metpy divergence module array indexing error
I am trying to find out moisture divergence using metpy divergence module .Now I am doing it for a dictionary with years being the keys,
HMD = {}
for year in [2012, 2018, 2019]:
# Get the ...
0
votes
1
answer
78
views
Why is this index error occurring with MetPy?
I tried to calculate an index such as LCL using Metpy.
The following is the result of trying print(p, t, td).
[34.5 30.0 29.1 25.6 20.0 19.9 16.4 15.1 12.0 10.3 10.1] hectopascal [-56.3 -56.1 -56.9 -...
0
votes
0
answers
143
views
Meteo station point data to raster interpolation in Python, pandas and geopandas
I'm looking for assistance to solve a spatial Kriging problem in Python (or any other solution you might suggest) that involves integrating multiple variables from the columns of the same dataframe ...
1
vote
1
answer
84
views
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 ...
0
votes
1
answer
183
views
How can I add the value in every point to a Contour Plot?
Right now I'm using matplotlib to generate contour plots of climatic variables. Now I wanted to add the numeric value on each point so that the final plot looks something like this:
So, I was ...
-1
votes
1
answer
129
views
calculate the MCS index
I would like to optimize the code to calculate the MCS index for the Southern Hemisphere using the formula ( # SA − MCS index = [Shear (0–6 km) –20.01] ∕7.87 + [ gradiente_horizontal (775 hPa) –4.84 × ...
1
vote
1
answer
166
views
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. ...
1
vote
1
answer
59
views
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 ...
0
votes
1
answer
625
views
How to vertically integrate over a region with different integral bounds at every lat lon point?
I am trying to calculate the vertical integral of the horizontal advection of Moist Static Energy uisng ERA5 data over a particular region. I am using xarray hence I know how to interpolate and ...
0
votes
1
answer
191
views
What's the right code to include a legend in my Python map for threat categories of SPC convective outlook using Matplotlib panel plot?
I've written a code to plot an SPC convective outlook. I have the map created, cities, states, lakes, etc., that I want on there. I also want to put a legend for the map as well outlining the ...
0
votes
2
answers
120
views
Metpy Precipitable Water Given Arguments with Incorrect Units
I am trying to do a simple calculation using Metpy's precipitable water function. The code below matches their example:
import metpy.calc as mpcalc
from metpy.units import units
import ...
1
vote
1
answer
142
views
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: ...
1
vote
1
answer
559
views
How to calculate moist adiabatic lapse rate using metpy?
I am wondering to calculate the moist adiabatic lapse rate using metpy function moist_lapse. But this function results a lapse value at each pressure level instead a single lapse rate value across ...
1
vote
1
answer
83
views
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 ...
0
votes
1
answer
88
views
metpy get_layer returns only the the first three values
All,
The MetPy get_layer function returns only the first 3 pressure values from the following pressure array (is that is correct?)
import numpy as np
from metpy.calc import get_layer
plev = np.array(( ...
0
votes
0
answers
101
views
using metpy package to find the moist_static_energy of different variables of temeparture, height and specific himifty
Code:
mi =[]
for T in np.array(df_use['TEMP']):
for z in np.array(df_use['HGHT']):
for q in qv:
moist_stat_energy = moist_static_energy(z* units.meters,T* units.degC, q * units(...