gid = alert['uid'] print "graceid : " + gid labels = [label['name'] for label in gdb.labels(gid).json()['labels']] print "labels : " + ", ".join(labels) if "DQV" in labels: print "already labeled DQV" sys.exit(0) event = gdb.event(gid).json() print "pipeline : " + event['pipeline'] if event['pipeline'].lower() not in allowed_pipelines: print " not allowed to label this pipeline" sys.exit(1) logs = gdb.logs(gid).json()['log'] result = dict((ifo, 1) for ifo in ifos) for log in logs: comment = log['comment'] if "minimum glitch-FAP for" in comment: gFAP = float(comment.split()[-1]) for ifo in ifos: if ifo in comment: result[ifo] = gFAP break jFAP = np.prod(result.values()) ### take product of gFAPs for 2 IFOs if jFAP <= jFAP_thr: message = "iDQ veto generator computed joint glitch-FAP : %.3e <= %.3e; <b>This is probably a glitch</b> and I am applying a DQV label" % ( jFAP, jFAP_thr)
"lalfinish", "snr", "lalsnr", "mchirp", "lalmchirp", ) # creates a header string to organize the array for e in all_events: # loops through all events satisfying our conditions and collects important data and compiles it into an array graceid = e["graceid"] far = e["far"] mchirp = e["extra_attributes"]["CoincInspiral"]["mchirp"] snr = e["extra_attributes"]["CoincInspiral"]["snr"] logs = g.logs(graceid).json()["log"] lalstart = "Not Started" lalfinish = "Not finished as of %s/%s/%s %s:%s:%s" % ( now.month, now.day, now.year, now.hour, now.minute, now.second, ) lalmchirp = "None" lalsnr = "None" for log in logs: # checks to see if lalinference started and/or ended comment = log["comment"]
if un is not None and pw is not None: args+=["--user",un,"--password",pw,"--no-check-certificate"] retcode=subprocess.call(['wget']+[url]+args) return retcode string = "%10s | %20s | %20s | %45s | %15s | %40s | %20s | %40s"%("graceid", "far", "lalstart", "lalfinish", "snr", "lalsnr", "mchirp", "lalmchirp") #creates a header string to organize the array for e in all_events: #loops through all events satisfying our conditions and collects important data and compiles it into an array graceid = e['graceid'] far = e['far'] mchirp = e['extra_attributes']['CoincInspiral']['mchirp'] snr = e['extra_attributes']['CoincInspiral']['snr'] logs = g.logs(graceid).json()['log'] lalstart = "Not Started" lalfinish = "Not finished as of %s/%s/%s %s:%s:%s" % (now.month, now.day, now.year, now.hour, now.minute, now.second) lalmchirp = "None" lalsnr = "None" for log in logs: #checks to see if lalinference started and/or ended comment = log['comment'] if "LALInference online parameter estimation started." in comment: lalstart = log['created'] if "LALInference online parameter estimation finished." in comment: lalfinish = log['created'] http = comment.find("http") html = comment.find(">resu")