def __init__(self, instrument, interval, width):
     self.fig, self.axes = SnglBurstUtils.make_burst_plot(
         r"$f_{\mathrm{recovered}} / f_{\mathrm{injected}}$",
         "Event Number Density")
     self.axes.loglog()
     self.instrument = instrument
     self.found = 0
     # 21 bins per filter width
     bins = int(float(abs(interval)) / width) * 21
     binning = rate.NDBins((rate.LinearBins(interval[0], interval[1],
                                            bins), ))
     self.offsets = rate.BinnedDensity(binning)
     self.coinc_offsets = rate.BinnedDensity(binning)
 def __init__(self, instrument, interval, width):
     self.fig, self.axes = SnglBurstUtils.make_burst_plot(
         r"$t_{\mathrm{recovered}} - t_{\mathrm{injected}}$ (s)",
         "Triggers per Unit Offset")
     self.axes.semilogy()
     self.instrument = instrument
     self.found = 0
     # 21 bins per filter width
     bins = int(float(abs(interval)) / width) * 21
     binning = rate.NDBins((rate.LinearBins(interval[0], interval[1],
                                            bins), ))
     self.offsets = rate.BinnedDensity(binning)
     self.coinc_offsets = rate.BinnedDensity(binning)
Ejemplo n.º 3
0
	def __init__(self, ifo, width, max):
		self.fig, self.axes = SnglBurstUtils.make_burst_plot("Delay (s)", "Count / Delay")
		self.ifo = ifo
		self.nevents = 0
		# 21 bins per filter width
		interval = segments.segment(0, max + 2)
		self.bins = rate.BinnedDensity(rate.NDBins((rate.LinearBins(interval[0], interval[1], int(float(abs(interval)) / width) * 21),)))
		self.axes.semilogy()
Ejemplo n.º 4
0
	def __init__(self, ifo, interval, width):
		self.fig, self.axes = SnglBurstUtils.make_burst_plot("Peak Frequency (Hz)", "Trigger Rate Spectral Density (triggers / s / Hz)")
		self.ifo = ifo
		self.nevents = 0
		# 21 bins per filter width
		bins = int(float(abs(interval)) / width) * 21
		binning = rate.NDBins((rate.LinearBins(interval[0], interval[1], bins),))
		self.rate = rate.BinnedDensity(binning)
Ejemplo n.º 5
0
 def __init__(self, binning):
     self.found = 0
     self.offsets = rate.BinnedDensity(binning)
options, filenames = parse_command_line()

#
# =============================================================================
#
#   Custom SnglBurstTable append() method to put triggers directly into bins
#
# =============================================================================
#

nbins = int(
    float(abs(options.read_segment)) / options.window) * bins_per_filterwidth
binning = rate.NDBins((rate.LinearBins(options.read_segment[0],
                                       options.read_segment[1], nbins), ))
trigger_rate = rate.BinnedDensity(binning)

num_triggers = 0


def snglburst_append(self, row, verbose=options.verbose):
    global num_triggers, rate
    t = row.peak
    if t in options.read_segment:
        trigger_rate.count[t, ] += 1.0
    num_triggers += 1
    if verbose and not (num_triggers % 125):
        print >> sys.stderr, "sngl_burst rows read:  %d\r" % num_triggers,


lsctables.SnglBurstTable.append = snglburst_append