diff --git a/gracedb/translator.py b/gracedb/translator.py index e74a232b165e16dec443e5453cb5ed0e1dd3b47c..b375fd4931241abb8c166f2f02082756f1019ee5 100644 --- a/gracedb/translator.py +++ b/gracedb/translator.py @@ -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]