-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task2F.py
26 lines (23 loc) · 917 Bytes
/
Task2F.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_highest_rel_level
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.plot import plot_water_level_with_fit
import datetime
stations = build_station_list()
update_water_levels(stations)
names = stations_highest_rel_level(stations, 5)
print (names)
list_names=[]
for name in names:
list_names.append(name[0])
print (list_names)
#list_names.remove("Bampton Grange")
for station in stations:
if station.name in list_names:
dt = 2
dates, levels = fetch_measure_levels(station.measure_id,
dt=datetime.timedelta(days=dt))
if len(dates)==0:
print ("NO AVAILABLE DATA for:", station.name)
else:
plot_water_level_with_fit(station, dates, levels, 4)