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] Scripting causes crash with 3 letter station ID's #197

Open githubuser055 opened 4 years ago

githubuser055 commented 4 years ago

When trying to script SHARPpy to generate output from a model station ID that has 3 letters it program crashes.

Command syntax: python full_gui.py --datasource SREF --station ABL --datetime 20200403/03

(Site ABL located in northeast Alabama near Gadsden, data is retrieved perfectly using SHARPpy Sounding Picker GUI)

Output: SHARPpy v1.4.0+6.gbc150d10 Andover Crash time: 2020-04-03 14:30:10.389301 Traceback (most recent call last): File "full_gui.py", line 136, in doCrasher ret = func(*args, **kwargs) File "full_gui.py", line 1114, in search_and_plotDB main_win.picker.disp_name = main_win.picker.loc['icao'] TypeError: 'NoneType' object is not subscriptable

Traceback (most recent call last): File "full_gui.py", line 1236, in main() File "full_gui.py", line 1223, in main win.close() AttributeError: 'NoneType' object has no attribute 'close'

Environment: Python 3.7 Anaconda using NumPy, PySide2 SharpPy distribution using conda

This may be due a syntax error, I was unable to find guidance for handling 3 letter ID's in the documentation.


I also request guidance for scripting output for a forecast hour from a model for a station. I did not find this information in existing documentation.

Command Syntax: python full_gui.py --datasource SREF --station TCL --datetime 20200403/03

Output: Returns the 04/03/20 03Z SREF 00 hour forecast sounding for station TCL perfectly.

Issue: What syntax is required to return the output for the 03Z SREF 02 hour forecast sounding for station TCL?

python full_gui.py --datasource SREF --station TCL --datetime 20200403/03F002 generates a syntax error.

wblumberg commented 4 years ago

Hi @githubuser055 . Thank you so much for your bug report - it's very clear and informative! I'm able to reproduce it on my laptop as well. I took a look at the sref.csv file that is deployed in each users' home directory (~/.sharppy/datasources/). It seems that location doesn't have an ICAO or IATA listed underneath it, which is why the location is unable to be loaded via the command line - it looks for records with those IDs. That's probably also why TCL works - that location has a complete record. I'm not sure what a good fix for that would be, but it's clear the error messages aren't sufficient in this case. @tsupinie, any ideas?

Regarding the scripting output, I don't think we've added that feature yet to output a specific forecast time. I don't know if I'll be able to add it, but during this time of COVID-19 I may be able to find some time! We've also been discussing redoing the data system since we have some new data sources available (aircraft soundings), so we might group this into a larger project.