Skip to content
Snippets Groups Projects
Commit 3b9b7273 authored by Kipp Cannon's avatar Kipp Cannon Committed by Kipp Cannon
Browse files

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.
parent ff23c5af
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment