-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_qso.py
39 lines (38 loc) · 1.81 KB
/
map_qso.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
from auto_geo_update import dump_rm_rbn_history
from expe_kml_defs import expe_kml
from qso_spot_kml import qso_spot_kml
import auto_geo_vars
import argparse
def map_qsos():
#read QSOs to be mapped, fetch geo_location data and return a list of
#mappable QSOs sorted by QSO time, earliest to latest
result = dump_rm_rbn_history()
#creates a list of QSO formatted the same as rm_rnb_histor_pres.csv
#then, gathers up spotting entries from the same file, and returns a list
#of strings formatted as lines in the file that are passed on
#to qso_spot_kml to produce a kml map
if(len(result) != 0):
if(auto_geo_vars.hh == False):
result = expe_kml(result[0][1], result[0][2],result[0][4],result[len(result)-1][4],result)
else:
qso_times = [result[0][4],result[len(result)-1][4]]
trange = auto_geo_vars.time_hh(qso_times)
#print(trange)
result = expe_kml(result[0][1], result[0][2],trange[0],trange[1],result)
#print(result)
result = qso_spot_kml("",77,result,auto_geo_vars.kml_title,auto_geo_vars.kml_desc)
parser = argparse.ArgumentParser(
prog='map_qso',
description='Creates kml maps using qso_update.csv',
epilog='Text at the bottom of help')
parser.add_argument('-hh', action='store_true')
parser.add_argument('-rbn_off', action='store_true')
parser.add_argument('-llb', type=int, default=60, \
help='Number of map window minutes on either side of lab log book entry')
args = parser.parse_args()
auto_geo_vars.hh = args.hh
auto_geo_vars.hhwindow = args.llb
auto_geo_vars.rbn_off = args.rbn_off
#There are no required args because the tx station lng, lat, and the map title
#are in the first three lines of the QSOs file respectively
map_qsos()