pyiem.nws.products.saw module#

Parsing of Storm Prediction Center SAW Product

This does not process the legacy SAW products that did not have LAT…LON

class pyiem.nws.products.saw.SAWProduct(text, utcnow=None)[source]#

Bases: TextProduct

Class representing a SAW Product

TORNADO = 0#
SEVERE_THUNDERSTORM = 1#
ISSUES = 0#
CANCELS = 1#
find_replaces()[source]#

Figure out what this watch replaces.

Return type:

int | None

find_action()[source]#

Figure out if this is an issuance or cancells statement

Returns:

either ISSUES or CANCELS

Return type:

(int)

compute_wfos(_txn=None)[source]#

Figure out who is impacted by this watch

sql(txn)[source]#

Do the necessary database work

Parameters:

(psycopg.transaction) – a database transaction

find_time()[source]#

Find the start and end valid time of this watch

Returns:

representing the time of this watch

Return type:

(datetime, datetime)

find_ww_num()[source]#

Find the Weather Watch Number

Returns:

The Weather Watch Number

Return type:

(int)

is_test()[source]#

Is this a test watch?

Returns:

boolean if this SAW is a test or not

find_ww_type()[source]#

Find the Weather Watch Type

Returns:

The Weather Watch Type

Return type:

(int)

find_polygon()[source]#

Search out the text for the LAT…LON polygon

Returns:

Well Known Text (WKT) representation

Return type:

(str)

get_jabbers(uri, _uri2=None, **kwargs)[source]#

Generate the jabber messages for this product.

NOTE: In the past, the messages generated here have tripped twitter’s spam logic, so we are careful to craft unique messages

NOTE: Since interesting watch information comes within three products from SPC, there is some magic in pyWWA/watch_parser.py that awaits the arrival of all three.

Parameters:
  • uri (str) – link to IEM Watch Overview page.

  • _uri2 (str) – unused in this context.

  • wwpprod (WWPProduct) – the WWPProduct object.

  • selprod (SELProduct) – the SELProduct object.

pyiem.nws.products.saw.parser(text, utcnow=None, _ugc_provider=None, _nwsli_provider=None)[source]#

parser of raw SPC SAW Text

Parameters:
  • text (str) – the raw text to parse

  • utcnow (datetime) – the current datetime with timezone set!

Returns:

SAWProduct instance