fname=ofname + '.geo', mode='w') coo_wrt = GeoWriter(dist='.4f', angle='RAD', fname=ofname + '.coo', mode='w') ts = TotalStation(stationtype, mu, iface) # get station data coo = {} coo['id'] = raw_input("Station id: ") coo['east'] = GetFloat("Station east ") coo['north'] = GetFloat("Station north ") coo['elev'] = GetFloat("Station elev ") ih = GetFloat("Instrument height ") coo_wrt.WriteData(coo) # upload station coordinates and instrument height to the instrument res = {'errorCode': 0} i = 1 while 'errorCode' in res and i < 3: res = ts.SetStation(coo['east'], coo['north'], coo['elev'], ih) i += 1 if 'errorCode' in res: print("Failed to upload station coordinates code: {:d}".format( res['errorCode'])) exit() geo = {} if otype == 'geo': geo['station'] = coo['id'] geo['ih'] = ih geo_wrt.WriteData(geo)
geo_wrt = GeoWriter(dist='.4f', angle='RAD', fname=ofname+'.geo', mode='w') coo_wrt = GeoWriter(dist='.4f', angle='RAD', fname=ofname + '.coo', mode='w') else: geo_wrt = CsvWriter(dist='.4f', fname=ofname+'.dmp', \ header=True, filt=['station', 'id', 'hz', 'v', 'faces']) coo_wrt = CsvWriter(dist='.4f', fname=ofname+'.csv', \ header=True, filt=['id', 'east', 'north', 'elev']) ts = TotalStation(stationtype, mu, iface) # get station data coo = {} coo['id'] = raw_input("Station id: ") coo['east'] = float(raw_input("Station east: ")) coo['north'] = float(raw_input("Station north: ")) coo['elev'] = float(raw_input("Station elev: ")) coo_wrt.WriteData(coo) ih = float(raw_input("Instrument height: ")) geo = {} if otype == 'geo': geo['station'] = coo['id'] geo['ih'] = ih geo_wrt.WriteData(geo) faces = int(raw_input("Number of faces: ")) while 1: t_id = raw_input("Target id: ") if len(t_id) == 0: break t_mode = "" while t_mode not in modes1: t_mode = raw_input("Target mode(" + modes_str + "): ").upper()
# load input data set if ifname[-4:] == '.coo': g = GeoReader(fname=ifname, filt=['id', 'east', 'north', 'elev']) else: g = CsvReader(fname=ifname, filt=['id', 'east', 'north', 'elev']) data = g.Load() if ofname[-4:] == '.geo': geo_wrt = GeoWriter(dist = '.4f', angle = 'RAD', fname = ofname, \ filt = ['station', 'id', 'hz', 'v', 'distance', 'faces', 'ih', \ 'code'], mode = 'w') else: geo_wrt = CsvWriter(dist = '.4f', angle = 'RAD', fname = ofname, \ header = True, mode = 'w', \ filt = ['station', 'id', 'hz', 'v', 'distance', 'faces', 'ih', \ 'code']) og = ObsGen(data, station_id, station_ih) if og.station_east is None or og.station_north is None or og.station_elev is None: print "station coordinates not found: ", station_id exit(-1) observations = og.run() for obs in observations: # heck for dmp output if ofname[-4:] != '.geo': if 'station' in obs: station = obs['station'] continue else: obs['station'] = station geo_wrt.WriteData(obs)