station module

This module provides a model for a monitoring station, and tools for manipulating/modifying station data

class station.MonitoringStation(station_id, measure_id, label, coord, typical_range, river, town)

Bases: object

This class represents a river level monitoring station

latest_level

The latest water level of the station

Type:float
coord

Coorinates of the station in (latitude, longitude)

Type:tuple
measure_id

measure_id

Type:str
name

Station name

Type:str
relative_water_level()

This method returns the latest water level as a fraction of the typical range.

Returns:0.0 (corresponds to a level at the typical low) to 1.0 (corresponds to a level at the typical high)
Return type:float
river

River name

Type:str
station_id

station_id

Type:str
town

Town name

Type:str
typical_range

Typical water level range of the station (typical_low, typical_high)

Type:tuple
typical_range_consistent()

This method checks whether the data it receives about the typical ranges are consistent(That data is available and the low range is lower than the high range).

Returns:Returns whether or not the data is consistent
Return type:Boolean
station.inconsistent_typical_range_stations(stations)

This function checks takes in the list of stations and checks to make sure the typical range for each are consistent.

Parameters:stations (list) – List of stations (type MonitoringStation).
Returns:List (type String) of all the stations with inconsistent typical ranges in alphabetical order
Return type:list