From 3e401628b25edae67f780197bc3e43b8b7598941 Mon Sep 17 00:00:00 2001 From: Francesco Pannarale Date: Wed, 22 Jan 2025 02:03:24 -0800 Subject: [PATCH] Apply single IFO cut only when more than 2 IFOs are used by PyGRB --- bin/pycbc_multi_inspiral | 2 +- pycbc/events/coherent.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/pycbc_multi_inspiral b/bin/pycbc_multi_inspiral index 0d2c92a8c4c..d62c2544bdf 100755 --- a/bin/pycbc_multi_inspiral +++ b/bin/pycbc_multi_inspiral @@ -709,7 +709,7 @@ with ctx: # indices from that IFO, i.e., IFO 0; otherwise, this # method finds coincidences and applies the single IFO cut, # namely, triggers must have at least 2 IFO SNRs above - # args.sngl_snr_threshold. + # args.sngl_snr_threshold when 3 or more IFOs are involved. if nifo > 1: coinc_idx = coh.get_coinc_indexes( idx_dict, time_delay_idx[slide][position_index] diff --git a/pycbc/events/coherent.py b/pycbc/events/coherent.py index dd13ce9513a..8e19b1690b7 100644 --- a/pycbc/events/coherent.py +++ b/pycbc/events/coherent.py @@ -59,9 +59,11 @@ def get_coinc_indexes(idx_dict, time_delay_idx): [coinc_list, idx_dict[ifo] - time_delay_idx[ifo]] ) # Search through coinc_idx for repeated indexes. These must have been loud - # in at least 2 detectors. + # in at least 2 detectors if the analysis uses more than 2 detectors. counts = np.unique(coinc_list, return_counts=True) - coinc_idx = counts[0][counts[1] > 1] + coinc_idx = ( + counts[0][counts[1] > 1] if len(idx_dict.keys()) > 2 else counts[0] + ) return coinc_idx