sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
216 stars 112 forks source link

[BUG] Numpy has trouble creating profiles for certain dates #204

Open PerLundquist opened 3 years ago

PerLundquist commented 3 years ago

Hello, all

I'm a student who recently started a project that uses SHARPpy heavily, and have run into a problem when creating profiles. When decoding certain SPC files that I downloaded from OU's SHARPpy archives, I will occasionally get the following error:

Traceback (most recent call last): File "dataCollecter20200803.py", line 357, in <module> prof = profile.create_profile(pres=pres, hght=hght, tmpc=tmpc, dwpc=dwpc, wspd=wspd, \ File "C:\Users\perrl\anaconda3\envs\SHARPpy-env\lib\site-packages\sharppy\sharptab\profile.py", line 95, in create_profile return ConvectiveProfile(**kwargs) File "C:\Users\perrl\anaconda3\envs\SHARPpy-env\lib\site-packages\sharppy\sharptab\profile.py", line 552, in __init__ self.get_fire() File "C:\Users\perrl\anaconda3\envs\SHARPpy-env\lib\site-packages\sharppy\sharptab\profile.py", line 643, in get_fire self.pblmaxwind = winds.max_wind(self, lower=0, upper=self.pbl_h) File "C:\Users\perrl\anaconda3\envs\SHARPpy-env\lib\site-packages\sharppy\sharptab\winds.py", line 407, in max_wind return maxu[0], maxv[0], prof.pres[inds[0]] File "C:\Users\perrl\anaconda3\envs\SHARPpy-env\lib\site-packages\numpy\ma\core.py", line 3188, in __getitem__ dout = self.data[indx] IndexError: index 0 is out of bounds for axis 0 with size 0

I'm quite new to python programming, but as far as I can understand, the error is coming from the create_profile function getting confused with certain data, resulting in the function not outputting any information to Numpy. My project has a very large sample size, so it's easy for me to reject bad data, but I thought I'd mention it to you guys

To Reproduce This error occurs when I create a convective profile using the SPCDecoder on the following file: http://sharp.weather.ou.edu/soundings/archive/1995/07/28/12/ALB.txt

There are also many many others, but I've been omitting data by the day, not the file, so I don't have specific files written down. Here are some dates that include bad data: 1993-6-14 1993-10-12 1994-7-6 1995-6-15 1995-6-28 1996-4-15

Versioning Information (please complete the following information):

Hope this helps!

kwodzicki commented 2 years ago

Having a similar issue:

SHARPpy v1.4.0+1.g684d8251 Andover
Crash time: 2021-08-20 11:39:54.568365
Traceback (most recent call last):
  File "runsharp/full_gui.py", line 136, in doCrasher
  File "runsharp/full_gui.py", line 1001, in openFile
  File "runsharp/full_gui.py", line 767, in skewApp
  File "sharppy/viz/SPCWindow.py", line 857, in addProfileCollection
  File "sharppy/sharptab/prof_collection.py", line 145, in getHighlightedProf
  File "sharppy/sharptab/profile.py", line 184, in copy
  File "sharppy/sharptab/profile.py", line 552, in __init__
  File "sharppy/sharptab/profile.py", line 643, in get_fire
  File "sharppy/sharptab/winds.py", line 407, in max_wind
  File "site-packages/numpy/ma/core.py", line 3188, in __getitem__
IndexError: index 0 is out of bounds for axis 0 with size 0

sln015flt.dat_spc.txt