print "no triggers found for gps : %.3f" % (gps) continue else: raise ValueError("no triggers found for gps : %.3f" % (gps)) for s, e in coverage: if s < gps: if gps - s < minwin: minwin = gps - s elif e > gps: if e - gps < minwin: minwin = e - gps else: print "\t\tminwin = %.3f" % (minwin) ### load triggers trgdict = event.trigdict() for filename in filenames: if opts.verbose: print "\t\t%s" % (filename) trgdict.add(event.loadkwm(filename)) trgdict.include( [[gps - opts.window, gps + opts.window]], tcent=event.col_kw["tcent"] ) ### keep only those within big window for key, values in trgdict.items(): ### add shifted times so they are measured relative to gps trgdict[key] = [trg + [trg[event.col_kw["tcent"]] - gps] for trg in values] trgdata[gps] = (minwin, trgdict) # ----------------------------------- if opts.verbose: print "plotting signif scatters for :"
if (trg[event.col_kw['tstop']] - trg[event.col_kw['tstart']] >= durmin) and ( trg[event.col_kw['tstop']] - trg[event.col_kw['tstart']] <= durmax) ] else: if opts.verbose: print "\t\tWARNING: channel=%s not found, inserting an empty list" % chan kwtrgdict[chan] = [] if opts.verbose: print "\t\t\tchannel=%s -> %d triggers" % ( chan, len(kwtrgdict[chan])) else: kwtrgdict = event.trigdict() #============================================= # Omicron triggers #============================================= if ochannels: if opts.verbose: print "\tdiscovering Omicron triggers within [%.9f, %.9f]" % ( gps - maxwindow, gps + maxwindow) otrgdict = idq.retrieve_OmicronTrigs(ogdsdir, ifo, int(np.floor(gps - maxwindow)), 2 * maxwindow + 1, ostride, ochannels, verbose=opts.overbose)
else: print 'analyzing data regardless of science segements' #==================== # samples -> just the supplied gps time #==================== samples = [[gps, 1, 1.0, 0.0, 0.0]] # fake sample with fields filled in for kw data clean_gps = [ ] ### we don't need this, but it's faster to define this than to clean up the following code... #==================== # aux triggers #==================== print "aggregating auxiliary triggers" trgdict = event.trigdict() ### load auxiliary triggers from current stride aux_trgdict = idq.retrieve_kwtrg(AUXgdsdir, AUXkwbasename, t, stride, sleep=(t + stride - idq.nowgps()) + delay, ntrials=2, logger=logger) if aux_trgdict == None: raise Warning(' no auxiliary triggers were found') ### we do not skip, although we might want to? else: trgdict.add(aux_trgdict)
signifmax, fmin, fmax, durmin, durmax, ) else: if opts.verbose: print "\t\tWARNING: channel=%s not found, inserting an empty list" % chan kwtrgdict[chan] = [] if opts.verbose: print "\t\t\tchannel=%s -> %d triggers" % (chan, len(kwtrgdict[chan])) else: kwtrgdict = event.trigdict() # ============================================= # Omicron triggers # ============================================= if ochannels: if opts.verbose: print "\tdiscovering Omicron triggers within [%.9f, %.9f]" % (gps - opts.window, gps + opts.window) otrgdict = idq.retrieve_OmicronTrigs( ogdsdir, ifo, int(np.floor(gps - opts.window)), 2 * opts.window + 1, ostride, ochannels, verbose=opts.overbose,