pyiem.observation module#
A class representing an observation stored in the IEM database
- pyiem.observation.get_summary_table(valid)[source]#
Optimize the summary table we potentially use.
- Parameters:
valid (datetime with time zone) – Datetime
- Returns:
str table to query
- pyiem.observation.bounded(val, floor, ceiling)[source]#
Make sure this is not NaN and between some value.
- pyiem.observation.summary_update(txn, data)[source]#
Updates the summary table and returns affected rows.
- class pyiem.observation.Observation(station=None, network=None, valid=None, iemid=None, tzname=None)[source]#
Bases:
objectmy observation object
- save(txn, force_current_log=False, skip_current=False)[source]#
Save this observation to the database via a psycopg transaction @param txn is a psycopg transaction @param force_current_log boolean - make sure this observation goes to the current_log table in the case that it is old, this allows reprocessing by the METAR ingestor et al @param skip_current boolean - optionally skip updating the current table. This is useful for partial obs @return: boolean if this updated one row each