pyiem.nws.products.vtec module#

A NWS TextProduct that contains VTEC information.

exception pyiem.nws.products.vtec.VTECProductException[source]#

Bases: TextProductException

Something we can raise when bad things happen!

class pyiem.nws.products.vtec.VTECProduct(text, utcnow=None, ugc_provider=None, nwsli_provider=None)[source]#

Bases: TextProduct

A TextProduct that contains VTEC information.

get_jabbers(uri, river_uri=None)#

Return a list of triples representing how this goes to social

Returns: [[plain, html, xtra]] – A list of triples of plain text, html, xtra

Parameters:
Return type:

list[tuple[str, str, dict]]

sql(txn)[source]#

Persist to the database

Parameters:

txn (psycopg.transaction) – A database transaction object that we can exec() database calls against.

do_sql_vtec(txn, segment, vtec)[source]#

Persist the non-SBW stuff to the database

Arguments: txn – A psycopg transaction segment – A TextProductSegment instance vtec – A vtec instance

do_sbw_geometry(txn, segment, vtec)[source]#

Storage of Storm Based Warning geometry

The IEM uses a seperate table for the Storm Based Warning geometries.

Parameters:
  • txn (psycopg) – Database transaction/cursor

  • segment (TextProduct.TextProductSegment) – Segment

  • vtec (pyiem.vtec.VTEC) – VTEC instance

is_single_action()[source]#

Is this product just 1 VTEC action?

is_homogeneous()[source]#

Test to see if this product contains just one VTEC event

get_first_non_cancel_vtec()[source]#

Return the first non-CANcel VTEC

get_first_non_cancel_segment()[source]#

Return the first segment that is a non-CAN

is_skip_con()[source]#

Should this product be skipped from generating jabber messages

Return type:

bool

pyiem.nws.products.vtec.parser(text, utcnow=None, ugc_provider=None, nwsli_provider=None)[source]#

Helper function that actually converts the raw text and emits an VTECProduct instance or returns an exception

Parameters:

text (str)

Return type:

VTECProduct