pyiem.nws.products.metarcollect module#

Encapsulates a text product holding METARs.

pyiem.nws.products.metarcollect.normalize_temp(val)[source]#

When temperatures are close to an int, return that int!

pyiem.nws.products.metarcollect.normid(station_id)[source]#

Normalize a station identifer.

Parameters:

station_id (str)

Return type:

str

pyiem.nws.products.metarcollect.wind_logic(iem, mtr)[source]#

Hairy logic for now we handle winds.

Parameters:

mtr (Metar)

pyiem.nws.products.metarcollect.trace(pobj)[source]#

Convert this precip object to a numeric value

pyiem.nws.products.metarcollect.to_metar(textprod, text)[source]#

Create a METAR object, if possible

Return type:

Metar

pyiem.nws.products.metarcollect.sanitize(text)[source]#

Clean our text string with METAR data

pyiem.nws.products.metarcollect.wind_message(mtr)[source]#

Convert this into a Jabber style message

Parameters:

mtr (Metar)

Return type:

Tuple[str, int]

pyiem.nws.products.metarcollect.over_wind_threshold(mtr)[source]#

Is this METAR over the wind threshold for alerting

Parameters:

mtr (Metar)

Return type:

bool

pyiem.nws.products.metarcollect.to_iemaccess(txn, mtr, iemid, tzname, force_current_log=False, skip_current=False)[source]#

Persist parsed data to IEMAccess Database.

Parameters:
  • txn (psycopg.cursor) – database cursor / transaction

  • mtr (Metar) – Metar instance

  • iemid (int) – The iem station identifier

  • tzname (str) – Local timezone of station.

  • force_current_log (boolean) – should this ob always go to current_log

  • skip_current (boolean) – should this ob always skip current table

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

Bases: TextProduct

A TextProduct containing METAR information

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

Make this into jabber messages

split_and_parse()[source]#

Create METAR objects as we find products in the text

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

Helper function