Commit 2523b757 authored by Sigurd M. Albrektsen's avatar Sigurd M. Albrektsen

Fixed combine dirs. Fixed default ublox values.

parent 8bc0df8e
......@@ -91,9 +91,7 @@ def handle_data_directory(sb_data_dir, parsers, outdir):
return
def do_combine_data(data_dir, combined_dir, overwrite, newnames=None):
if newnames is None:
newnames = {}
def do_combine_data(data_dir, combined_dir, overwrite):
if os.path.exists(combined_dir):
if not overwrite:
return combined_dir
......@@ -102,6 +100,7 @@ def do_combine_data(data_dir, combined_dir, overwrite, newnames=None):
sensor_files = {}
for pardir in sorted(glob(os.path.join(data_dir, '*_[0-9]*'))):
print 'pardir:', pardir
for p in glob(os.path.join(pardir, '*')):
print('Handling %s' % os.path.abspath(p))
_, fname = os.path.split(p)
......@@ -111,11 +110,7 @@ def do_combine_data(data_dir, combined_dir, overwrite, newnames=None):
sensor_files[fname] = [p]
for n, filelist in sensor_files.items():
try:
newname = newnames[n]
except KeyError:
newname = n
newname = n
with open(os.path.join(combined_dir, newname), 'wb') as out_f:
for fn in filelist:
with open(fn, 'rb') as in_f:
......@@ -149,6 +144,7 @@ if __name__ == '__main__':
else:
print('not combining')
outdir = os.path.join(sb_data_dir, outdir_name)
print('Getting data from', sb_data_dir)
print('Writing data to:', outdir)
parsers = {'adis': AdisParser(), 'aeroprobe': AeroprobeParser(),
......
......@@ -292,10 +292,11 @@ if __name__ == '__main__':
if len(sys.argv) > 1:
PATH = sys.argv[1]
live = True
reader = SyncboardReader(PATH)
reader.register_allowed_ids('ublox', UbloxParser.allowed_ids)
reader.show_warnings = True
reader.old_style = True
reader.old_style = False
parser = UbloxParser()
i=0
......@@ -315,22 +316,20 @@ if __name__ == '__main__':
ids[package.ubx_id] = package
if package == None:
continue
#print(repr(package.ID))
if not package.ubx_id == UbloxPackageRxmRawX.ubx_id:
continue
if start_time == None:
start_time = time()
if p_done:
if p_done or live:
d_time = time()-start_time
if d_time == 0:
d_time = 1
fps = float(i)/(d_time)
package_data = (fps, package.dict['tov'], package.dict['tov'])
data = package.dict['RXM_RAWX']
package_data = (fps, data['tov'], data['toa'])
text = '\rfps: %03.2f\t TOV:\t%d\tTOA:\t%d\t' % package_data
text += str(package.dict)
sys.stdout.write(text)
# sys.stdout.write(text + '\tsplinter:\t%d' % reader.splinter_time)
sys.stdout.flush()
i+=1
except Exception as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment