From 3b9b72734205bac8101743bea619fbe7f76a01ae Mon Sep 17 00:00:00 2001 From: Kipp Cannon <kcannon@cita.utoronto.ca> Date: Wed, 4 Apr 2018 01:18:52 +0900 Subject: [PATCH] inspiral.py: fix rounding problem - when determining which instruments are on for histograming noise triggers, trigger times are LIGOTimeGPS but segment boundaries are floats and don't provide enough precision to tell if triggers near the segment boundaries are in or out of the segment - "fix" by protracting the segment boundaries 1 ms. --- gstlal-inspiral/python/inspiral.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gstlal-inspiral/python/inspiral.py b/gstlal-inspiral/python/inspiral.py index 51bd46b1f8..9b37beaa42 100644 --- a/gstlal-inspiral/python/inspiral.py +++ b/gstlal-inspiral/python/inspiral.py @@ -808,11 +808,21 @@ class Data(object): # times when SNR was available. used only for code # correctness checks one_or_more_instruments = segmentsUtils.vote(snr_segments.values(), 1) + # FIXME: this is needed to work around rounding + # problems in safety checks below, trying to + # compare GPS trigger times to float segment + # boundaries (the boundaries don't have enough + # precision to know if triggers near the edge are + # in or out). it would be better not to have to + # screw around like this. + one_or_more_instruments.protract(1e-3) # 1 ms # times when at least 2 instruments were generating # SNR. used to sieve triggers for inclusion in the # denominator. two_or_more_instruments = segmentsUtils.vote(snr_segments.values(), 2) + # FIXME: see comment above. + two_or_more_instruments.protract(1e-3) # 1 ms # run stream thinca. update the parameter # distribution data from sngls that weren't used in @@ -933,7 +943,11 @@ class Data(object): discard_boundary = float(self.stream_thinca.discard_boundary) snr_segments = segments.segmentlistdict((instrument, ratebinlist[lower_bound_in_seglist(ratebinlist, discard_boundary):].segmentlist()) for instrument, ratebinlist in self.rankingstat.denominator.triggerrates.items()) one_or_more_instruments = segmentsUtils.vote(snr_segments.values(), 1) + # FIXME: see comment in appsink_new_buffer() + one_or_more_instruments.protract(1e-3) # 1 ms two_or_more_instruments = segmentsUtils.vote(snr_segments.values(), 2) + # FIXME: see comment in appsink_new_buffer() + two_or_more_instruments.protract(1e-3) # 1 ms ratebinlists = self.rankingstat.denominator.triggerrates.values() for event in self.stream_thinca.flush(self.coincs_document.xmldoc, self.coincs_document.process_id, snr_segments, fapfar = self.fapfar): -- GitLab