def main(): f = open('x_results','r') a = f.readlines() f.close() a = [float(x.strip('\n')) for x in a] f = open('y_results','r') b = f.readlines() f.close() b = [float(x.strip('\n')) for x in b] x_results = [] y_results = [] i = 0 while ( i < len(a) ): x_results.append(a[i]) y_results.append(b[i]) i +=1 kml_write = sdr_kml_writer.kml_writer() for i in range(0,len(x_results)): coord = str(x_results[i])+','+str(y_results[i]) kml_write.add_placemark('','',coord) kml_write.write_to_file('/home/aryoung/Desktop/hyperbolas.kml')
def main(): g = geolocation_table('128.173.90.68') g.start_db() l= [] start = g.get_start() end = g.get_end() i = start while ( i <= end ): data = g.get_data(i) loc = data[6] loc = loc.strip(' ()') # format location loc = loc.split(',') loc[0] = np.float128(loc[0]) loc[1] = np.float128(loc[1]) l.append(loc) i += 1 g.stop_db() # print l[0] # print 'type(l[0]): ',type(l[0][0]) kml_write = sdr_kml_writer.kml_writer() kml_write.add_colored_pushpin('red-pushpin','ff0000ff') n = 1 for i in l: s = 'Guess' + str(n) kml_write.add_placemark(s,s,i,'red-pushpin') n += 1 filename = 'guesses_degen.kml' kml_write.write_to_file(filename)
def main(): g = geolocation_table('128.173.90.68') g.start_db() l = [] start = g.get_start() end = g.get_end() i = start while (i <= end): data = g.get_data(i) loc = data[6] loc = loc.strip(' ()') # format location loc = loc.split(',') loc[0] = np.float128(loc[0]) loc[1] = np.float128(loc[1]) l.append(loc) i += 1 g.stop_db() # print l[0] # print 'type(l[0]): ',type(l[0][0]) kml_write = sdr_kml_writer.kml_writer() kml_write.add_colored_pushpin('red-pushpin', 'ff0000ff') n = 1 for i in l: s = 'Guess' + str(n) kml_write.add_placemark(s, s, i, 'red-pushpin') n += 1 filename = 'guesses_degen.kml' kml_write.write_to_file(filename)
def write_kml(results): p_x = (0.5)*(results[0] + results[1]) p_y = (0.5)*(results[2] + results[3]) kml_write = sdr_kml_writer.kml_writer() coord = str(p_x)+','+str(p_y) kml_write.add_placemark('','',coord) filename = 'guess.kml' kml_write.write_to_file(filename)
def write_kml(results): p_x = (0.5) * (results[0] + results[1]) p_y = (0.5) * (results[2] + results[3]) kml_write = sdr_kml_writer.kml_writer() coord = str(p_x) + ',' + str(p_y) kml_write.add_placemark('', '', coord) filename = 'guess.kml' kml_write.write_to_file(filename)
def main(): # remove stop flag, but quietly silent = os.system('rm stop_flag 1>/dev/null 2>/dev/null') global shm shm = fifo_stack() # initialize all the kml stuff log = [] doc = kml_writer() coord = '-80.42451235968072' + ',' + '37.23096190882968' description = "<![CDATA[Mobile Command<br> Registered Teams: Blacksburg Rescue<br> Freq in Use: 468 MHz<br>" doc.add_placemark("Command Center", description, coord, 'command-center') doc.write_to_file('random.kml') # start radio receiver radio_thread = receiver_thread() radio_thread.start() while shm.length() == 0: pass coord = shm.pop() team_frequency = 468 coord = get_random_coord() description = "Object of the Search" doc.add_placemark("Lost Person", description, coord, 'plb') name = "Search Team" description = "<![CDATA[Blacksburg Rescue<br>Frequency: %d MHz<br><br>" % team_frequency doc.add_placemark(name, description, coord) doc.write_to_file('random.kml') while not_stop(): if not(shm.length() == 0): coord = shm.pop() doc.update_placemark("Search Team", coord) doc.write_to_file('random.kml') log.append(coord) if len(log) == 11: log.pop(0) f = open('sdr_ge_log', 'w') log_string = "\n".join(log) f.write(log_string) f.close()
def main(): # n = [2,3,4,5,6,7,8,9,10] # # n = [25,50,75,100,125,150] # for i in n: # f = open('/home/aryoung/batch_results/fessenden_2010-3-27/answer_%s_third_pass' %str(i),'r') # a = f.readlines() # f.close() # a = [float(x.strip('\n')) for x in a] f = open('/home/aryoung/batch_results/fessenden_2010-3-27/x_results','r') a = f.readlines() f.close() a = [float(x.strip('\n')) for x in a] f = open('/home/aryoung/batch_results/fessenden_2010-3-27/y_results','r') b = f.readlines() f.close() b = [float(x.strip('\n')) for x in b] x_results = [] y_results = [] i = 0 while ( i < len(a) ): x_results.append(a[i]) y_results.append(b[i]) i +=1 kml_write = sdr_kml_writer.kml_writer() # coord = str(a[0])+','+str(a[1]) # kml_write.add_placemark('','',coord) # kml_write.write_to_file('/home/aryoung/Desktop/guess_%s.kml' %i) for i in range(0,len(x_results)): coord = str(x_results[i])+','+str(y_results[i]) kml_write.add_placemark('','',coord) kml_write.write_to_file('/home/aryoung/Desktop/geoloc_kml_file.kml')
def main(): # n = [2,3,4,5,6,7,8,9,10] # # n = [25,50,75,100,125,150] # for i in n: # f = open('/home/aryoung/batch_results/fessenden_2010-3-27/answer_%s_third_pass' %str(i),'r') # a = f.readlines() # f.close() # a = [float(x.strip('\n')) for x in a] f = open('/home/aryoung/batch_results/fessenden_2010-3-27/x_results', 'r') a = f.readlines() f.close() a = [float(x.strip('\n')) for x in a] f = open('/home/aryoung/batch_results/fessenden_2010-3-27/y_results', 'r') b = f.readlines() f.close() b = [float(x.strip('\n')) for x in b] x_results = [] y_results = [] i = 0 while (i < len(a)): x_results.append(a[i]) y_results.append(b[i]) i += 1 kml_write = sdr_kml_writer.kml_writer() # coord = str(a[0])+','+str(a[1]) # kml_write.add_placemark('','',coord) # kml_write.write_to_file('/home/aryoung/Desktop/guess_%s.kml' %i) for i in range(0, len(x_results)): coord = str(x_results[i]) + ',' + str(y_results[i]) kml_write.add_placemark('', '', coord) kml_write.write_to_file('/home/aryoung/Desktop/geoloc_kml_file.kml')
# kml_write.add_placemark('','',coord) # # filename = 'answer' + '_' + str(num)+ '_' + s + '.kml' # filename = 'guess.kml' # kml_write.write_to_file(filename) if __name__=='__main__': results = geo_hist() print results p_x = (0.5)*(results[0] + results[1]) p_y = (0.5)*(results[2] + results[3]) print p_x,p_y kml_write = sdr_kml_writer.kml_writer() coord = str(results[0])+','+str(results[2]) kml_write.add_placemark('','',coord) coord = str(results[1])+','+str(results[3]) kml_write.add_placemark('','',coord) coord = str(p_x)+','+str(p_y) kml_write.add_placemark('','',coord) kml_write.write_to_file('guess.kml') # # f = open('/home/aryoung/prog/geolocation/geo_system_sim/x_results','r') # f = open('x_results','r') # a = f.readlines() # f.close() # a = [float(x.strip('\n')) for x in a]
#!/usr/bin/env python from random_move import get_random_coord from sdr_kml_writer import kml_writer import random if __name__ == '__main__': doc = kml_writer() coord = '-80.42451235968072' + ',' + '37.23096190882968' description = "<![CDATA[Mobile Command<br> " doc.add_placemark("Command Center", description, coord, 'command-center') n = 1 while n < 5: name = "Search Team %d" % n freq = random.randrange(460, 471) coord = get_random_coord() description = "<![CDATA[Search Team %d<br>Frequency: %d MHz<br><br>" % ( n, freq) doc.add_placemark(name, description, coord) n += 1 name = "Fire House 9" description = "<![CDATA[Fire Fighters<br>Standard Fire Engine" coord = '-80.41451340175786,37.22984292113826' doc.add_placemark(name, description, coord, 'fire-truck') name = "Fire Team 1" description = "<![CDATA[Local Fire Rescue Team"
# # kml_write.add_placemark('','',coord) # coord = str(p_x)+','+str(p_y) # kml_write.add_placemark('','',coord) # # filename = 'answer' + '_' + str(num)+ '_' + s + '.kml' # filename = 'guess.kml' # kml_write.write_to_file(filename) if __name__ == '__main__': results = geo_hist() print results p_x = (0.5) * (results[0] + results[1]) p_y = (0.5) * (results[2] + results[3]) print p_x, p_y kml_write = sdr_kml_writer.kml_writer() coord = str(results[0]) + ',' + str(results[2]) kml_write.add_placemark('', '', coord) coord = str(results[1]) + ',' + str(results[3]) kml_write.add_placemark('', '', coord) coord = str(p_x) + ',' + str(p_y) kml_write.add_placemark('', '', coord) kml_write.write_to_file('guess.kml') # # f = open('/home/aryoung/prog/geolocation/geo_system_sim/x_results','r') # f = open('x_results','r') # a = f.readlines() # f.close() # a = [float(x.strip('\n')) for x in a]