diff --git a/gstlal-inspiral/python/far.py b/gstlal-inspiral/python/far.py index 1840307d418a6fdec0fb97ce3ef7fb799a97c7c1..268ab93f28a5c819a0272517e54689ab696f61ed 100644 --- a/gstlal-inspiral/python/far.py +++ b/gstlal-inspiral/python/far.py @@ -731,7 +731,10 @@ WHERE # that have too small a count to have been well measured, # and/or can't be modelled correctly by this fit anyway. mode, = zl.argmax() - mask = (x < mode) | (zl.at_centres() < zl[mode,] - 15.) + zlcumsum = zl.array.cumsum() + assert zlcumsum[-1] > 1000, "Need at least 1000 zero lag events to compute extinction model" + one_hundred_events_lr = x[zlcumsum.searchsorted(zlcumsum[-1] - 100)] + mask = (x < mode) | (x > one_hundred_events_lr) zl = numpy.ma.masked_array(zl.array, mask) bg = numpy.ma.masked_array(bg, mask)