From 0ac46637ce44c50aba81d8318f298938338b81e5 Mon Sep 17 00:00:00 2001 From: akrherz Date: Sat, 30 Apr 2022 16:48:36 -0500 Subject: [PATCH] send WWP through watch_parser see akrherz/pyIEM#595 --- examples/WWP9.txt | 33 +++++++++++++++++++++++++ parsers/pywwa/workflows/watch_parser.py | 15 ++++++++--- pqact.d/pqact.conf | 9 ++++--- util/run_examples.sh | 2 +- 4 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 examples/WWP9.txt diff --git a/examples/WWP9.txt b/examples/WWP9.txt new file mode 100644 index 00000000..1632f562 --- /dev/null +++ b/examples/WWP9.txt @@ -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. + +$$ + \ No newline at end of file diff --git a/parsers/pywwa/workflows/watch_parser.py b/parsers/pywwa/workflows/watch_parser.py index a62a4d72..509facf3 100644 --- a/parsers/pywwa/workflows/watch_parser.py +++ b/parsers/pywwa/workflows/watch_parser.py @@ -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 @@ -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): diff --git a/pqact.d/pqact.conf b/pqact.d/pqact.conf index 8059d8f5..e4fc5b38 100644 --- a/pqact.d/pqact.conf +++ b/pqact.d/pqact.conf @@ -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 diff --git a/util/run_examples.sh b/util/run_examples.sh index 3ea01ba7..0b759797 100644 --- a/util/run_examples.sh +++ b/util/run_examples.sh @@ -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