Sometimes, the NWS issues alert messages long before the actual event is occurring. For instance, this Heat Advisory where the alert message is effective starting 2023-06-24T03:46:00-05:00, but the alert itself will not be onset until 2023-06-25T10:00:00-05:00. When SkywarnPlus.py detects that the alert is not yet active, it ignores it until it is active. A small error in code organization causes the process to exit before it is fully complete in this scenario.
NWS API Data:
...
"sent": "2023-06-24T03:46:00-05:00",
"effective": "2023-06-24T03:46:00-05:00",
"onset": "2023-06-25T10:00:00-05:00",
"expires": "2023-06-24T15:30:00-05:00",
"ends": "2023-06-25T20:00:00-05:00",
"status": "Actual",
"messageType": "Alert",
"category": "Met",
"severity": "Moderate",
"certainty": "Likely",
"urgency": "Expected",
"event": "Heat Advisory",
"sender": "w-nws.webmaster@noaa.gov",
"senderName": "NWS Little Rock AR",
"headline": "Heat Advisory issued June 24 at 3:46AM CDT until June 25 at 8:00PM CDT by NWS Little Rock AR"
...
Produces these conditions:
Current time: 2023-06-24 17:08:22Alert start: 2023-06-25 15:00:00Alert end 2023-06-26 01:00:00
Causes the following error:
root@repeater:/usr/local/bin/SkywarnPlus# ./SkywarnPlus.py
Traceback (most recent call last):
File "./SkywarnPlus.py", line 1098, in <module>
main()
File "./SkywarnPlus.py", line 1018, in main
alerts = getAlerts(countyCodes)
File "./SkywarnPlus.py", line 410, in getAlerts
logger.debug("getAlerts: Skipping alert %s, not active.", event)
UnboundLocalError: local variable 'event' referenced before assignment
Resolve by reorganizing getAlerts structure.
Bring out a parameter to config.yaml for users to select whether to use onset or effective time for alerting
Small bug that won't be noticed by most users.
Sometimes, the NWS issues alert messages long before the actual event is occurring. For instance, this
Heat Advisory
where the alert message is effective starting2023-06-24T03:46:00-05:00
, but the alert itself will not be onset until2023-06-25T10:00:00-05:00
. WhenSkywarnPlus.py
detects that the alert is not yet active, it ignores it until it is active. A small error in code organization causes the process to exit before it is fully complete in this scenario.NWS API Data:
Produces these conditions:
Current time: 2023-06-24 17:08:22
Alert start: 2023-06-25 15:00:00
Alert end 2023-06-26 01:00:00
Causes the following error:
getAlerts
structure.config.yaml
for users to select whether to useonset
oreffective
time for alerting