-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtpp.py
More file actions
23 lines (17 loc) · 888 Bytes
/
tpp.py
File metadata and controls
23 lines (17 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import common
import cycle
import sys
region = sys.argv[1] # must specify one of 9 regions for which to do plates
start_date = cycle.get_version_start(cycle.get_cycle_download()) # to download which cycle
all_charts = common.list_crawl("https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/dtpp/", "^http.*DDTPP[A-E]+_" + start_date.replace("-", "")[2:] + ".zip$")
all_charts.append("https://www.outerworldapps.com/WairToNowWork/avare_aptdiags.php")
# download
common.download_list(all_charts)
# make a list of airports for tagging
d = {}
with open("avare_aptdiags.php") as f:
for line in f:
(key, val0, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11) = line.rstrip().split(",")
d[str(key)] = val6 + "," + val7 + "," + val8 + "," + val9 + "," + val10 + "," + val11
common.process_plates(d, region)
common.zip_plates(region)