Observations¶
-
class
historical_obs_sqlalchemy.
Observation
(recorded_at)¶ -
created_at
¶ The time the observation was added into the system.
-
delete
()¶ Deletes the observation and all measurements.
-
id
¶ A string represention an obs’ unique identifier.
-
measure
(parameter, value, unit=None)¶ Records a measurement for the observation with the given parameter and value.
-
measurements
(parameters=None)¶ Retrieves the measurements for an observation.
Here’s an example of requesting all measurements for a station’s latest observation:
from historical_obs_sqlalchemy import Station station = Station.by_id('my-station-of-interest') observation = station.latest_observation() measurements = observation.measurements()
If we were only interested in precipitation and temperature for this observation, we can use our parameters filter:
measurements = observation.measurements(parameters=['precipitation', 'temperature'])
Parameters: (optional) (parameters) – a list of parameters to filter.
-
recorded_at
¶ The time the observation took place.
-
save
()¶ Saves the observation.
-
station
= None¶ The station reporting the observation.
-