pyiem.nws.product module#

Base Class encapsulating a NWS Text Product

pyiem.nws.product.damage_survey_pns(prod, data)[source]#

Glean out things, hopefully.

pyiem.nws.product.checker(lon, lat, strdata)[source]#

make sure our values are within physical bounds

pyiem.nws.product.str2polygon(strdata)[source]#

Convert some string data into a polygon

pyiem.nws.product.qc_is_emergency(seg)[source]#

Belt + Suspenders check that this segment is an emergency.

class pyiem.nws.product.TextProductSegment(text, tp)[source]#

Bases: object

A segment of a Text Product

Parameters:

tp (TextProduct)

get_ugcs_tuple()[source]#

Helper to return a tuple useful for SQL.

get_ugcs_list()[source]#

Helper to return a list useful for SQL.

get_hvtec_nwsli()[source]#

Return the first hvtec NWSLI entry, if it exists

get_hvtec_cause()[source]#

Return the first hvtec cause entry, if it exists

get_hvtec_severity()[source]#

Return the first hvtec severity entry, if it exists

get_hvtec_record()[source]#

Return the first hvtec record entry, if it exists

Special search the product for special text

process_bullets()[source]#

Figure out the bulleted segments

process_tags()[source]#

Find various tags in this segment

special_tags_to_text()[source]#

Convert the special tags into a nice text

process_latlon()[source]#

Parse the segment looking for the ‘standard’ LAT…LON encoding

process_time_mot_loc()[source]#

Try to parse the TIME…MOT…LOC

parse_headlines()[source]#

Find headlines in this segment

get_affected_wfos()[source]#

Based on the ugc_provider, figure out which WFOs are impacted by this product segment

Return type:

list[str]

class pyiem.nws.product.TextProduct(text, utcnow=None, ugc_provider=None, nwsli_provider=None, parse_segments=True)[source]#

Bases: WMOProduct

class representing a NWS Text Product

Parameters:

ugc_provider (UGCProvider | dict | None)

suv_iter()[source]#

Yield [(segment, ugcs, vtec)] combos found in product.

is_resent()[source]#

Check to see if this product is a …RESENT product

is_correction()[source]#

Is this product a correction?

Sadly, this is not as easy as it should be. It turns out that some products do not have a proper correction mechanism, so offices will just brute force in a note into the MND header. So we have to do some further checking…

Returns:

Is this product a correction?

Return type:

bool

parse_attn_rfc()[source]#

Figure out which RFCs this product is seeking attention

parse_attn_wfo()[source]#

Figure out which WFOs this product is seeking attention

get_channels()[source]#

Return a list of channels

get_nicedate()[source]#

Nicely format the issuance time of this product

get_main_headline(default='')[source]#

Return a string for the main headline, if it exists

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

Return a tuple of jabber messages [(plain, html, xtra_dict)]

Parameters:

uri (str) – the base URI to use to construct links

Returns:

[(str, str, dict)]

get_signature()[source]#

Attempt to glean the free form text that is a signature.

Return type:

str | None

parse_segments()[source]#

Split the product by its $$

get_affected_wfos()[source]#

Based on the ugc_provider, figure out which WFOs are impacted by this product