-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.py
47 lines (37 loc) · 1.3 KB
/
app.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'''
Editor: Thomas Chavakis
Year: 2022
Tools:
Description: Service of downloading pressure, wind and temperature.
Output folder structure
/tmp/weather/(wind,pressure,temp)
- 20220202 (date)
- 12 (run 0,6,12,18)
- gfs.f000.grb2
- gfs.f003.grb2
- gfs.f006.grb2
- gfs.f012.grb2
- gfs.f015.grb2
- gfs.f018.grb2
- gfs.f021.grb2
- gfs.f024.grb2
'''
import threading
import grib_downloader
def download_pressure(levelOfDetail):
grib_downloader.download_gfs(levelOfDetail, "PRES", "lev_80_m_above_ground", "/tmp/grib/pressure/")
threading.Timer(20.0, updateGribFiles, [levelOfDetail]).start()
def download_wind(levelOfDetail):
grib_downloader.download_gfs(levelOfDetail, "UGRD,VGRD", "lev_10_m_above_ground", "/tmp/grib/wind/")
threading.Timer(20.0, updateGribFiles, [levelOfDetail]).start()
def download_temperature(levelOfDetail):
grib_downloader.download_gfs(levelOfDetail, "TMP", "lev_surface", "/tmp/grib/temp/")
threading.Timer(20.0, updateGribFiles, [levelOfDetail]).start()
def updateGribFiles(levelOfDetail):
print("Checking For Updates")
download_pressure(levelOfDetail)
download_wind(levelOfDetail)
download_temperature(levelOfDetail)
print ("Update Started...")
# level of detail p25 --> 0.25 Degree, p1 --> 1 Degree
updateGribFiles('p25')