Skip to content
Snippets Groups Projects
Commit 58646979 authored by Brian Moe's avatar Brian Moe
Browse files

Extract FAR from CWB data

parent b232e324
No related branches found
No related tags found
No related merge requests found
......@@ -397,8 +397,18 @@ class CwbData(Translator):
# ...
# keyN: value value*
# piles of other data not containing ':'
# ...
# more data we don't care about here
# ...
# #significance based on the last 24*6 processed jobs, 4000-1 time shifts
# 318 1.98515e-05 1026099328 1026503796 53644
# ...
#
# The 2nd number following the "24*6" line is FAR.
#
rawdata = {}
# Get Key/Value info
for line in datafile:
line = line.split(':',1)
if len(line) == 1:
......@@ -406,6 +416,22 @@ class CwbData(Translator):
key, val = line
rawdata[key] = val.split()
# scan down for FAR
next_line_is_far = False
for line in datafile:
if line.startswith("#significance based on the last 24*6"):
next_line_is_far = True
break
if next_line_is_far:
# Can't just do datafile.readline() -- Python objects.
for line in datafile:
try:
rawdata['far'] = [float(line.split()[1])]
except Exception, e:
# whatever.
pass
break
data = {}
data['rawdata'] = rawdata
data['gpstime'] = rawdata.get('time',[None])[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment