LowellObservatory / NightShift

Collection of sub-modules used in the NightWatch (and other Night*) project
Mozilla Public License 2.0
1 stars 1 forks source link

Unhandled exception with bad radar files #9

Closed astrobokonon closed 5 years ago

astrobokonon commented 5 years ago
2019-08-03 17:55:03,757 INFO     Reading: ./outputs/radar//raws/KFSX20190802_235905
2019-08-03 17:55:03,761 ERROR    Traceback (most recent call last):
2019-08-03 17:55:03,761 ERROR      File "looper_nexradaws.py", line 157, in <module>
2019-08-03 17:55:03,761 ERROR    forceDown=forceDownloads, forceRegen=forceRegenPlot)
2019-08-03 17:55:03,761 ERROR      File "looper_nexradaws.py", line 99, in main
2019-08-03 17:55:03,761 ERROR    forceRegen=forceRegen)
2019-08-03 17:55:03,761 ERROR      File "/home/lig/Codes/NightShift/nightshift/radar/plot.py", line 163, in makePlots
2019-08-03 17:55:03,761 ERROR    radar = readNEXRAD(each)
2019-08-03 17:55:03,761 ERROR      File "/home/lig/Codes/NightShift/nightshift/radar/plot.py", line 39, in readNEXRAD
2019-08-03 17:55:03,762 ERROR    dat = read_nexrad_archive(filename, linear_interp=False)
2019-08-03 17:55:03,762 ERROR      File "/opt/conda/lib/python3.7/site-packages/pyart/io/nexrad_archive.py", line 118, in read_nexrad_archive
2019-08-03 17:55:03,762 ERROR    nfile = NEXRADLevel2File(prepare_for_read(filename))
2019-08-03 17:55:03,762 ERROR      File "/opt/conda/lib/python3.7/site-packages/pyart/io/nexrad_level2.py", line 173, in __init__
2019-08-03 17:55:03,762 ERROR    raise ValueError('No MSG31 records found, cannot read file')
2019-08-03 17:55:03,762 ERROR    ValueError
2019-08-03 17:55:03,762 ERROR    :
2019-08-03 17:55:03,762 ERROR    No MSG31 records found, cannot read file
astrobokonon commented 5 years ago

This particular crash is fixed by f1b2dd56da7ad318293a2f54e773c7d1ba00e959, though I suppose there could be other unhandled exceptions that pop out. Testing now.

astrobokonon commented 5 years ago

Needed a small change to the exception handling (662b3d6e95f5584de9bd82695cbca7be390324c1) as well, to catch the case where dat is None.

astrobokonon commented 5 years ago

Seems ok now, so I think this particular crash is fixed.