-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index out of bounds sbcape #1011
Comments
ping @dopplershift |
My guess is that one particular column from the grid has some conditions that our CAPE code is not happy with. Any way to identify which set of indices is being worked on when the error occurs? |
I think this is the same as #945, for which I have a PR. |
@sgdecker any way to work around it? |
The fix will be in master soon. Since the problem is internal to the |
Hearing nothing on this, I'm going to close this issue. |
Hi @zbruick sorry for the late response. I'm still getting this error, even with the PR implemented. It also occurs on the |
To confirm, you've updated to the current version of master and tested again? Just want to make sure before investigating more, as the PR hasn't been released yet, but will be in 0.11 when that's released shortly. |
I also get this error with all CAPE related calculations ie. most_unstable_cape_cin, surface_based_cape_cin. |
Hey @michaelsessa! Can you provide any more details and do you have a reproducible example for this? Is it erring out for any point, or are you doing this on a grid? If we can get a reproducible example for this problem, that would be a great help in solving it! |
Given that line 424 of thermo.py is not a return statement in master, I will second #1011 (comment) |
@michaelsessa, thanks for the traceback. Could you test against the master branch of MetPy (install it in a new Conda environment)? If you need instructions, you can find them here. There was a PR that might have fixed this issue, and any testing that could be done to verify that would be very helpful! Otherwise, feel free to drop me your data file via email and I can play with it and see what's up. |
I created a new Conda environment and tested against the master branch of Metpy and the issue appears to be resolved! |
Ok thanks for checking...I'm glad to hear it! |
Bumping from 0.11, but please do let me know if this still a problem. |
Sorry for re-upping an old thread, but I get an "index out of bounds" error when attempting to calculate wet bulb temperatures. Oddly, it only occurs with certain sounding data (i.e. certain dates/observations): works for:
doesn't work for:
Dates are generally selected at random except for a few local severe events. Any ideas? ============================================================ df = WyomingUpperAir.request_data(date, station) #pressure, height, temp, dp, direction, speed, u_wind, v_wind, station, station_number, time, lat, lon, elev
print(df)
p = df['pressure'].values * units.hPa
T = df['temperature'].values * units.degC
Td = df['dewpoint'].values * units.degC
wind_speed = df['speed'].values * units.knots
wind_dir = df['direction'].values * units.degrees
u, v = mpcalc.wind_components(wind_speed, wind_dir)
mask = p >= 100 * units.hPa
Tw = mpcalc.wet_bulb_temperature(p, T, Td).to('degC') ============================================================ Traceback (most recent call last):
File ".\MetPy_Sounding.py", line 42, in <module>
Tw = mpcalc.wet_bulb_temperature(p, T, Td).to('degC')
File "C:\ProgramData\Anaconda3\lib\site-packages\metpy\xarray.py", line 655, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\metpy\units.py", line 320, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\metpy\calc\thermo.py", line 2413, in wet_bulb_temperature
ret[...] = moist_adiabat_temperatures[-1].magnitude
File "C:\ProgramData\Anaconda3\lib\site-packages\pint\quantity.py", line 1719, in __getitem__
return type(self)(self._magnitude[key], self._units)
IndexError: index -1 is out of bounds for axis 0 with size 0 |
Shouldn't this be a new issue? The original problem here was with |
I went ahead and copied that comment to #1332. |
Kind of follows on from issues #972 and #997 -
With a simple example, the
surface_based_cape_cin
function works fine:but when applying it to my loop, where pressure, temperature & dewpoint are definitely of shape (8,):
I get the following traceback:
edit: works when taking just one point from the loop, so definitely not the data that's the problem?
The text was updated successfully, but these errors were encountered: