Skip to content

Commit e4435cd

Browse files
committed
moving lines version 1.55 with bug fixes and improvements to file saving formats for each different platforms
1 parent 50503f2 commit e4435cd

File tree

14 files changed

+2028
-1716
lines changed

14 files changed

+2028
-1716
lines changed

movinglines/MSS.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
MSS_Bocachica,https://bocachica.arc.nasa.gov/wms/?
2-
MSS_Leipzig,http://tornado.meteo.uni-leipzig.de/
2+
#MSS_Leipzig,http://tornado.meteo.uni-leipzig.de/
3+
#mss_cloudagzer2,http://192.168.10.201:8081/?

movinglines/aeronet_locations.txt

Lines changed: 12 additions & 1604 deletions
Large diffs are not rendered by default.

movinglines/aeronet_locations_full.txt

Lines changed: 1615 additions & 0 deletions
Large diffs are not rendered by default.

movinglines/excel_interface.py

Lines changed: 70 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def __init__(self,lon0='14 38.717E',lat0='22 58.783S',speed=130.0,UTC_start=7.0,
127127
if profile:
128128
lon0,lat0,UTC_start = profile['Start_lon'],profile['Start_lat'],profile['UTC_start']
129129
UTC_conversion,alt0,name,campaign = profile['UTC_conversion'],profile['start_alt'],profile['Plane_name'],profile['Campaign']
130+
self.profile = profile
130131
self.__version__ = version
131132
self.comments = [' ']
132133
self.wpname = [' ']
@@ -165,6 +166,9 @@ def __init__(self,lon0='14 38.717E',lat0='22 58.783S',speed=130.0,UTC_start=7.0,
165166
self.campaign = campaign
166167
self.datestr_verified = datestr_verified
167168
self.platform, self.p_info,use_file = self.get_platform_info(name,platform_file)
169+
for k in profile:
170+
if k not in self.p_info:
171+
self.p_info[k] = profile[k]
168172
self.pilot_format = self.p_info.get('pilot_format','DD MM SS')
169173
if use_file:
170174
print('Using platform data for: {} from platform file: {}'.format(self.platform,os.path.abspath(platform_file)))
@@ -1220,7 +1224,7 @@ def print_points_kml(self,folder,includepng=False):
12201224
except:
12211225
pnt.style.iconstyle.icon.href = get_curdir()+'//map_icons//number_{}.png'.format(self.WP[i])
12221226
else:
1223-
pnt.style.iconstyle.icon.href = 'http://maps.google.com/mapfiles/kml/paddle/{}-lv.png'.format(self.WP[i])
1227+
pnt.style.iconstyle.icon.href = 'https://www.samueleleblanc.com/img/icons/{}.png'.format(self.WP[i])
12241228
pnt.description = """WP=#%02f\nUTC[H]=%2.2f\nWPname=%s\nLocal[H]=%2.2f\nCumDist[km]=%f\nspeed[m/s]=%4.2f\ndelayT[min]=%f\nSZA[deg]=%3.2f\nAZI[deg]=%3.2f\nBearing[deg]=%3.2f\nClimbT[min]=%f\nComments:%s""" % (self.WP[i],
12251229
self.utc[i],self.wpname[i],self.local[i],self.cumdist[i],
12261230
self.speed[i],self.delayt[i],self.sza[i],
@@ -1516,15 +1520,24 @@ def save2xl_for_pilots(filename,ex_arr):
15161520
else:
15171521
sh = wb_pilot.sheets.add(name=a.name,after=wb_pilot.sheets[wb_pilot.sheets.count-1])
15181522
#wb_pilot.sheets(1).add(name=a.name)
1523+
15191524
xw.Range('A1').value = '{name} - {daystr} - '.format(name=a.name,daystr=a.datestr)
15201525
xw.Range('A1').font.bold = True
15211526
xw.Range('A1').font.size = 24
1522-
#for st in ['A','B','C','D','E','F','G']:
1523-
xw.Range('A1:G1').color = rgb_to_int(to_rgb(a.color))
1524-
#import ipdb; ipdb.set_trace()
1525-
xw.Range('A2').value = ['WP','WP name','Lat\n[+-90]','Lon\n[+-180]',
1527+
1528+
if not a.p_info.get('include_mag_heading',False):
1529+
xw.Range('A2').value = ['WP','WP name','Lat\n[+-90]','Lon\n[+-180]',
15261530
'Altitude\n[kft]','UTC\n[hh:mm]','Comments']
1527-
xw.Range('A2:G2').font.bold = True
1531+
letter_range = ['A','B','C','D','E','F','G']
1532+
last_rgs = 'G'
1533+
else:
1534+
xw.Range('A2').value = ['WP','WP name','Lat\n[+-90]','Lon\n[+-180]',
1535+
'Altitude\n[kft]','UTC\n[hh:mm]','Mag Heading\n[deg]','Comments']
1536+
letter_range = ['A','B','C','D','E','F','G','H']
1537+
xw.Range('G3:G%i'% (a.n+2)).number_format = '0.0'
1538+
last_rgs = 'H'
1539+
xw.Range('A1:'+last_rgs+'1').color = rgb_to_int(to_rgb(a.color))
1540+
xw.Range('A2:'+last_rgs+'2').font.bold = True
15281541
#freeze_top_pane(wb_pilot)
15291542
xw.Range('F3:F%i'% (a.n+2)).number_format = 'hh:mm'
15301543
xw.Range('E3:E%i'% (a.n+2)).number_format = '0.00'
@@ -1545,12 +1558,17 @@ def save2xl_for_pilots(filename,ex_arr):
15451558
comment = 'delay: {:2.1f} min, {}'.format(a.delayt[i],a.comments[i])
15461559
else:
15471560
comment = a.comments[i]
1548-
xw.Range('A{:d}'.format(i+3)).value = [a.WP[i],a.wpname[i],lat_f,lon_f,a.alt_kft[i],a.utc[i]/24.0,comment]
1561+
if not a.p_info.get('include_mag_heading',False):
1562+
xw.Range('A{:d}'.format(i+3)).value = [a.WP[i],a.wpname[i],lat_f,lon_f,a.alt_kft[i],a.utc[i]/24.0,comment]
1563+
else:
1564+
mag_decl = a.p_info.get('mag_declination',13.0)
1565+
xw.Range('A{:d}'.format(i+3)).value = [a.WP[i],a.wpname[i],lat_f,lon_f,a.alt_kft[i],a.utc[i]/24.0,(360.0+a.bearing[i]-mag_decl)%360,comment]
15491566
if i%2:
1550-
for st in ['A','B','C','D','E','F','G']:
1567+
for st in letter_range:
15511568
xw.Range('{}{:d}'.format(st,i+2)).color = rgb_to_int(make_lighter(to_rgb(a.color)))
15521569
xw.Range('A{:d}'.format(i+5)).value = 'One line waypoints for foreflight:'
15531570
xw.Range('A{:d}'.format(i+6)).value = one_line_points(a)
1571+
sh.page_setup.print_area = '$A$1:$'+last_rgs+'$%i'% (a.n+2)
15541572
wb_pilot.save(filename)
15551573
try:
15561574
wb_pilot.close()
@@ -1578,26 +1596,27 @@ def save2csv_for_FOREFLIGHT_UFP(filename,ex,foreflight_only=True,verbose=True):
15781596
"""
15791597
if filename.endswith('.csv'):
15801598
filename = filename[:-4]
1581-
if verbose: print('.. saving FOREFLIGHT csv to {}'.format(filename+'_'+ex.name+'_FOREFLIGHT.csv'))
1582-
f = open(filename+'_'+ex.name+'_FOREFLIGHT.csv','w+')
1583-
f.write('Waypoint,Description,LAT,LONG\n')
1584-
ex.wpname = ex.get_waypoint_names(fmt=ex.p_info.get('waypoint_format','{x.name[0]}{x.datestr.split("-")[2]}{w:02d}'))
1585-
for i in range(ex.n):
1586-
if ex.wpname[i] in ex.wpname[0:i]: continue
1599+
if 'foreflight' in ex.p_info.get('preferred_file_format',['foreflight']):
1600+
if verbose: print('.. saving FOREFLIGHT csv to {}'.format(filename+'_'+ex.name+'_FOREFLIGHT.csv'))
1601+
f = open(filename+'_'+ex.name+'_FOREFLIGHT.csv','w+')
1602+
f.write('Waypoint,Description,LAT,LONG\n')
1603+
ex.wpname = ex.get_waypoint_names(fmt=ex.p_info.get('waypoint_format','{x.name[0]}{x.datestr.split("-")[2]}{w:02d}'))
1604+
for i in range(ex.n):
1605+
if ex.wpname[i] in ex.wpname[0:i]: continue
15871606

1588-
comm = ex.comments[i]
1589-
if ex.comments[i]:
1590-
comm = ex.comments[i].replace(',', '')
1591-
f.write("""%s,ALT=%3.2f kft %s ,%+2.12f,%+2.12f\n""" %(
1592-
ex.wpname[i],ex.alt_kft[i],comm,ex.lat[i],ex.lon[i]))
1593-
f.close()
1607+
comm = ex.comments[i]
1608+
if ex.comments[i]:
1609+
comm = ex.comments[i].replace(',', '')
1610+
f.write("""%s,ALT=%3.2f kft %s ,%+2.12f,%+2.12f\n""" %(
1611+
ex.wpname[i],ex.alt_kft[i],comm,ex.lat[i],ex.lon[i]))
1612+
f.close()
15941613

1595-
if verbose: print('.. saving FOREFLIGHT one liner to {}'.format(filename+'_'+ex.name+'_FOREFLIGHT_oneline.txt'))
1596-
fo = open(filename+'_'+ex.name+'_FOREFLIGHT_oneline.txt','w+')
1597-
fo.write(one_line_points(ex,wpnames=ex.wpname))
1598-
fo.close()
1614+
if verbose: print('.. saving FOREFLIGHT one liner to {}'.format(filename+'_'+ex.name+'_FOREFLIGHT_oneline.txt'))
1615+
fo = open(filename+'_'+ex.name+'_FOREFLIGHT_oneline.txt','w+')
1616+
fo.write(one_line_points(ex,wpnames=ex.wpname))
1617+
fo.close()
15991618

1600-
if 'er2' in ex.platform:
1619+
if 'er2' in ex.p_info.get('preferred_file_format',['foreflight']):
16011620
if verbose: print('.. saving ER2 csv to {}'.format(filename+'_'+ex.name+'.csv'))
16021621
fe = open(filename+'_'+ex.name+'.csv','w+')
16031622
fe.write('ID,Description,LAT,LONG,Altitude [kft],UTC [hh:mm],Comments\n')
@@ -1608,38 +1627,40 @@ def save2csv_for_FOREFLIGHT_UFP(filename,ex,foreflight_only=True,verbose=True):
16081627
w = ex.WP[i]
16091628
x = ex
16101629
wp_str = eval("f'{}'".format(ex.p_info.get('waypoint_format','{x.name[0]}{x.datestr.split("-")[2]}{w:02d}')))
1611-
desc = ex.wpname[i]
1630+
desc = '.'+ex.wpname[i]
16121631
if wp_str in ex.wpname[i]:
16131632
desc = '.'+wp_str[0]+wp_str[3:5]
16141633
fe.write("""%2.0f,%s,%+2.12f,%+2.12f,%3.2f,%2.0f:%02.0f,%s\n""" %(
16151634
ex.WP[i],desc,ex.lat[i],ex.lon[i],ex.alt_kft[i],np.floor(ex.utc[i]),(ex.utc[i]-np.floor(ex.utc[i]))*60.0,comm))
16161635
fe.close()
16171636
return #no need to print out the rest
16181637

1619-
if verbose: print('.. saving UFP csv to {}'.format(filename+'_'+ex.name+'_UFP.csv'))
1620-
fu = open(filename+'_'+ex.name+'_UFP.csv','w+')
1621-
fu.write('Waypoint,LAT,LONG,Description\n')
1622-
for i in range(ex.n):
1623-
if ex.wpname[i] in ex.wpname[0:i]: continue
1624-
comm = ex.comments[i]
1625-
if ex.comments[i]:
1626-
comm = ex.comments[i].replace(',', '')
1627-
fu.write("""%s,%+2.12f,%+2.12f,ALT=%3.2f kft %s\n""" %(
1628-
ex.wpname[i],ex.lat[i],ex.lon[i],ex.alt_kft[i],comm))
1629-
fu.close()
1638+
if 'ufp' in ex.p_info.get('preferred_file_format',['foreflight']):
1639+
if verbose: print('.. saving UFP csv to {}'.format(filename+'_'+ex.name+'_UFP.csv'))
1640+
fu = open(filename+'_'+ex.name+'_UFP.csv','w+')
1641+
fu.write('Waypoint,LAT,LONG,Description\n')
1642+
for i in range(ex.n):
1643+
if ex.wpname[i] in ex.wpname[0:i]: continue
1644+
comm = ex.comments[i]
1645+
if ex.comments[i]:
1646+
comm = ex.comments[i].replace(',', '')
1647+
fu.write("""%s,%+2.12f,%+2.12f,ALT=%3.2f kft %s\n""" %(
1648+
ex.wpname[i],ex.lat[i],ex.lon[i],ex.alt_kft[i],comm))
1649+
fu.close()
16301650

1631-
if verbose: print('.. saving Honeywell csv to {}'.format(filename+'_'+ex.name+'_Honeywell.csv'))
1632-
fh = open(filename+'_'+ex.name+'_Honeywell.csv','w+')
1633-
fh.write('E,WPT,FIX,LAT,LON\n')
1634-
for i in range(ex.n):
1635-
if ex.wpname[i] in ex.wpname[0:i]: continue
1636-
lat_str,lon_str = format_lat_lon(ex.lat[i],ex.lon[i],format='NDDD MM.SS')
1637-
comm = ex.comments[i]
1638-
if ex.comments[i]:
1639-
comm = ex.comments[i].replace(',', '')
1640-
fh.write("""x,%s,ALT=%3.2f kft %s,%s,%s\n""" %(
1641-
ex.wpname[i],ex.alt_kft[i],comm,lat_str,lon_str))
1642-
fh.close()
1651+
if 'honeywell' in ex.p_info.get('preferred_file_format',['foreflight']):
1652+
if verbose: print('.. saving Honeywell csv to {}'.format(filename+'_'+ex.name+'_Honeywell.csv'))
1653+
fh = open(filename+'_'+ex.name+'_Honeywell.csv','w+')
1654+
fh.write('E,WPT,FIX,LAT,LON\n')
1655+
for i in range(ex.n):
1656+
if ex.wpname[i] in ex.wpname[0:i]: continue
1657+
lat_str,lon_str = format_lat_lon(ex.lat[i],ex.lon[i],format='NDDD MM.SS')
1658+
comm = ex.comments[i]
1659+
if ex.comments[i]:
1660+
comm = ex.comments[i].replace(',', '')
1661+
fh.write("""x,%s,ALT=%3.2f kft %s,%s,%s\n""" %(
1662+
ex.wpname[i],ex.alt_kft[i],comm,lat_str,lon_str))
1663+
fh.close()
16431664

16441665

16451666

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% PP, PP_offset, length
2+
PP+PP_offset, length/2
3+
PP+PP_offset, length/2

movinglines/gui.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,6 +2233,7 @@ def __init__(self,default_profiles,title='Enter map defaults',
22332233
self.default_profiles = default_profiles
22342234
self.profile = self.default_profiles[0]
22352235
self.proj_list = proj_list
2236+
self.oked = False
22362237
parent = tk._default_root
22372238
tkSimpleDialog.Dialog.__init__(self,parent,title)
22382239

@@ -2328,6 +2329,13 @@ def apply(self):
23282329
self.profile['UTC_conversion'] = float(self.utc_convert.get())
23292330
self.profile['start_alt'] = float(self.start_alt.get())
23302331
self.profile['Campaign'] = self.pname.get()
2332+
print('..Applying selected profile')
2333+
self.oked = True
2334+
return self.profile
2335+
2336+
def cancel(self,event=None):
2337+
if not self.oked: self.profile = False
2338+
super().cancel(event=event)
23312339
return self.profile
23322340

23332341
def check_input(self,s,isletter=False):

movinglines/labels.txt

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ UCSB_SBC_PACE2,-119.90633,34.250167,+c
9393
P&B5,-119.92833,34.2035,+c
9494
P&B6,-119.950167,34.15683,+c
9595
P&B7,-120.03333,34.08333,+c
96+
GliderE, -119.84345,34.258133,+m
97+
GliderW, -119.9388167,34.3021333,+m
9698
##############################################
9799
#Arctic ground stations / radiosondes
98100
##############################################
@@ -175,20 +177,46 @@ BUOYR, -73.184456,83.917512,vb
175177
##############################################
176178
#PACE-PAX air traffic navigation waypoints
177179
##############################################
178-
PENNI, -122.106333,36.7125,^y
179-
EUGEN, -122.444167,37.0935,^y
180-
PIRAT, -122.863333,37.257667,^y
181-
RAINS, -123.243333,37.167833,^y
182-
TPCAT, -122.963833,37.125,^y
183-
MOVER, -121.889833,36.857167,^y
184-
SANTY, -122.073075,36.979239,^y
185-
GARLK, -121.997289,36.757214,^y
186-
LISSY, -122.1960,36.88706,^y
180+
PENNI, -122.106333,36.7125,^m
181+
EUGEN, -122.444167,37.0935,^m
182+
PIRAT, -122.863333,37.257667,^m
183+
RAINS, -123.243333,37.167833,^m
184+
TPCAT, -122.963833,37.125,^m
185+
MOVER, -121.889833,36.857167,^m
186+
SANTY, -122.073075,36.979239,^m
187+
GARLK, -121.997289,36.757214,^m
188+
LISSY, -122.1960,36.88706,^m
189+
ROSIE, -118.2065,34.8525,^m
190+
MITEL, -118.5840778,36.68442222,^m
191+
HAMBO, -117.6425,37.2,^m
192+
SKIZM, -121.2568778,37.13184167,^m
193+
ZOMAN, -120.833102777778, 36.8837111111111,^m
194+
DAGGS, -116.95,34.98333333,^m
195+
HEINY, -116.5425,35.85833333,^m
187196
##############################################
188197
#PACE-PAX sites of interest
189198
##############################################
190199
# Ivanpah playa
191200
IVAN1, -115.395,35.548,xg
192201
# solar panels near Primm
193202
SOLP1, -115.36, 35.623,xy
194-
203+
GlID1, -119.93881667, 34.3021333,+m
204+
GLID2, -119.84345, 34.2581833,+m
205+
HYPR1, -119.55494, 33.70721,xm
206+
##############################################
207+
#AirSHARP points
208+
##############################################
209+
OFSH1, -122.2408306, 36.93356111,+y
210+
OFSH2,-122.2065389,36.93358889,+y
211+
ARTI1,-122.1371417,36.93290833,+y
212+
WILD1,-122.1039056,36.93127778,+y
213+
LML11,-122.0687556,36.93000556,+y
214+
CIRC1,-122.0342444,36.93205833,+y
215+
WHRF1,-122.00005,36.93482222,+y
216+
RTI11,-121.9662333,36.93726667,+y
217+
CEME1,-121.9327,36.94001389,+y
218+
SEAS1,-121.8981778,36.94194167,+y
219+
MBAC1,-121.8730472,36.90190556,+y
220+
HARB1,-122.0078,36.956217,+y
221+
SCWR1,-122.0183333,36.95941667,+y
222+
CPWR1,-121.953231,36.969276,+y

0 commit comments

Comments
 (0)