From bc375fc88491a8cb4747cc59853838ae012bf876 Mon Sep 17 00:00:00 2001 From: GstLAL CBC Offline <gstlalcbc.offline@cbc.ligo.caltech.edu> Date: Thu, 12 Sep 2019 08:50:23 -0700 Subject: [PATCH] don't allow Ligo + (virgo or kagra) time to cause ligo sngls to go in the background --- gstlal-inspiral/python/streamthinca.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gstlal-inspiral/python/streamthinca.py b/gstlal-inspiral/python/streamthinca.py index 50e584e8f4..4a6cc607a2 100644 --- a/gstlal-inspiral/python/streamthinca.py +++ b/gstlal-inspiral/python/streamthinca.py @@ -211,12 +211,13 @@ class backgroundcollector(object): elif len(event_ids) == 1: self.zerolag_singles.update(event_ids) - def pull(self, snr_min, two_or_more_instruments, flushed_events): + def pull(self, snr_min, hl_on, flushed_events): index = dict((id(event), event) for event in flushed_events) flushed_ids = set(index) background_ids = self.timeshifted_coincs & flushed_ids self.timeshifted_coincs -= flushed_ids - background_ids |= set(event_id for event_id in self.zerolag_singles & flushed_ids if float(index[event_id].end) in two_or_more_instruments) + # put all virgo and kagra in their own background + background_ids |= set(event_id for event_id in self.zerolag_singles & flushed_ids if ((float(index[event_id].end) in hl_on) or (index[event_id].ifo not in ("H1", "L1")))) self.zerolag_singles -= flushed_ids return [event for event in map(index.__getitem__, background_ids) if event.snr >= snr_min] @@ -349,11 +350,14 @@ class StreamThinca(object): # add selected singles to the noise model if flushed: - # times when at least 2 instruments were generating + # times when H and L were generating # SNR. used to select zero-lag singles for # inclusion in the denominator. - two_or_more_instruments = segmentsUtils.vote(snr_segments.values(), 2) + if "H1" in snr_segments and "L1" in snr_segments: + hl_on = snr_segments["H1"] & snr_segments["L1"] + else: + hl_on = segments.segmentlist([]) # FIXME: this is needed to work around rounding # problems in safety checks below, trying to # compare GPS trigger times to float segment @@ -361,9 +365,9 @@ class StreamThinca(object): # precision to know if triggers near the edge are # in or out). it would be better not to have to # screw around like this. - two_or_more_instruments.protract(1e-3) # 1 ms + hl_on.protract(1e-3) # 1 ms - for event in self.backgroundcollector.pull(rankingstat.snr_min, two_or_more_instruments, flushed): + for event in self.backgroundcollector.pull(rankingstat.snr_min, hl_on, flushed): rankingstat.denominator.increment(event) # add any triggers that have been used in coincidences for -- GitLab