From 3943e975f6f75e611566f8b8256b654c738452ba Mon Sep 17 00:00:00 2001 From: segomezlo <92443572+sebastiangomezlopez@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:02:37 +0100 Subject: [PATCH] Update pycbc_multi_inspiral --- bin/pycbc_multi_inspiral | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bin/pycbc_multi_inspiral b/bin/pycbc_multi_inspiral index bc988d6082e..2f29f253aff 100755 --- a/bin/pycbc_multi_inspiral +++ b/bin/pycbc_multi_inspiral @@ -53,14 +53,14 @@ from pycbc.tmpltbank.sky_grid import SkyGrid def slide_limiter(args): ''' This function computes the number of shortslides used by the coherent - matched filter statistic to obtain as most background triggers as + matched filter statistic to obtain as most background triggers as possible. It bounds the number of slides to avoid counting triggers more than once. If the data is not time slid, there is a single slide for the zero-lag. ''' low, upp = 1, args.segment_length[args.instruments[0]] - if args.do_shortslides and and len(args.instruments[:])>1: + if args.do_shortslides: n_ifos = len(args.instruments) stride_dur = args.segment_length[args.instruments[0]]/2 num_slides = np.int32(1 + @@ -70,7 +70,7 @@ def slide_limiter(args): f" = ({args.slide_shift:.2f},{stride_dur*2:.2f})"\ f" goes over the allowed upper bound {upp}" else: - num_slides = 0 + num_slides = 1 return num_slides @@ -412,10 +412,8 @@ with ctx: ) logging.info("Determining time slide shifts and time delays") - # create an array of slide_ids using the syntax: start, stop, step - # where values are generated within the half-open interval [start, stop) - slide_ids = np.arange(0, num_slides+1, 1) # Create a dictionary of time slide shifts; IFO 0 is unshifted + slide_ids = np.arange(num_slides) time_slides = { ifo: args.slide_shift * slide_ids * ifo_idx for ifo_idx, ifo in enumerate(args.instruments) @@ -763,7 +761,7 @@ with ctx: # and their SNRs elif len(coinc_idx) != 0 and nifo == 1: coinc_triggers = { - args.instruments[0]: snr[args.instruments[0]][ + args.instruments[0]: snr_dict[args.instruments[0]][ coinc_idx_det_frame[args.instruments[0]] ] } @@ -974,7 +972,7 @@ with ctx: ) else: rho_sngl = abs( - snr[args.instruments[0]][ + snr_dict[args.instruments[0]][ coinc_idx_det_frame[args.instruments[0]] ] ) @@ -1039,7 +1037,7 @@ with ctx: network_out_vals['coherent_snr'] = rho_coinc else: network_out_vals['coherent_snr'] = abs( - snr[args.instruments[0]][ + snr_dict[args.instruments[0]][ coinc_idx_det_frame[args.instruments[0]] ] )