Skip to content

Commit

Permalink
send WWP through watch_parser
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Apr 30, 2022
1 parent 8113476 commit 0ac4663
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
33 changes: 33 additions & 0 deletions examples/WWP9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

551
WWUS40 KWNS 292158
WWP9

TORNADO WATCH PROBABILITIES FOR WT 0159
NWS STORM PREDICTION CENTER NORMAN OK
0455 PM CDT FRI APR 29 2022

WT 0159
PROBABILITY TABLE:
PROB OF 2 OR MORE TORNADOES : 60%
PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES : 50%
PROB OF 10 OR MORE SEVERE WIND EVENTS : 50%
PROB OF 1 OR MORE WIND EVENTS >= 65 KNOTS : 30%
PROB OF 10 OR MORE SEVERE HAIL EVENTS : 60%
PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES : 60%
PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS : 90%

&&
ATTRIBUTE TABLE:
MAX HAIL /INCHES/ : 5.0
MAX WIND GUSTS SURFACE /KNOTS/ : 65
MAX TOPS /X 100 FEET/ : 600
MEAN STORM MOTION VECTOR /DEGREES AND KNOTS/ : 24030
PARTICULARLY DANGEROUS SITUATION : NO

&&
FOR A COMPLETE GEOGRAPHICAL DEPICTION OF THE WATCH AND
WATCH EXPIRATION INFORMATION SEE WOUS64 FOR WOU9.

$$

Expand Down
15 changes: 12 additions & 3 deletions parsers/pywwa/workflows/watch_parser.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
""" SPC Watch Ingestor """
""" SPC Watch (SAW, WWP) Ingestor """

# 3rd Party
from twisted.internet import reactor
from pyiem.util import LOG
from pyiem.nws.products.saw import parser as sawparser
from pyiem.nws.products.wwp import parser as wwpparser

# Local
from pywwa import common
Expand All @@ -13,12 +14,20 @@

def real_process(txn, raw):
"""Process the product, please"""
prod = sawparser(raw)
iswwp = False
if raw.find("PROBABILITY TABLE") > -1:
prod = wwpparser(raw)
iswwp = True
else:
prod = sawparser(raw)
# NOTE: insure parsers are implmenting the same interface
if prod.is_test():
LOG.info("TEST watch found, skipping")
LOG.info("TEST watch found %s, skipping", prod.get_product_id())
return
if common.dbwrite_enabled():
prod.sql(txn)
if iswwp:
return
prod.compute_wfos(txn)
baseurl = common.SETTINGS.get("pywwa_watch_url", "pywwa_watch_url")
for (txt, html, xtra) in prod.get_jabbers(baseurl):
Expand Down
9 changes: 5 additions & 4 deletions pqact.d/pqact.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ DDS|PPS /pSPS(...)
# database write disabled for non-NWSChat
DDS|PPS /pSPENES
PIPE python pyWWA/parsers/spe_parser.py -d
#
#

###
# Convective Watches
#
DDS|PPS ^WWUS30 KWNS
# WWUS30 SAW
# WWUS40 WWP
DDS|PPS ^WWUS(34)0 KWNS
PIPE python pyWWA/parsers/watch_parser.py
#
# SPC Mesoscale discussions
Expand Down
2 changes: 1 addition & 1 deletion util/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ for fn in $gp; do
cat examples/${fn}.txt | python parsers/vtec_parser.py $OPTS || exit 2
done

cat examples/SAW.txt | python parsers/watch_parser.py $OPTS || exit 2
cat examples/SAW.txt examples/WWP9.txt | python parsers/watch_parser.py $OPTS || exit 2

cat examples/TAF.txt | python parsers/taf_parser.py $OPTS || exit 2

Expand Down

0 comments on commit 0ac4663

Please sign in to comment.