Skip to content

Commit

Permalink
Update pycbc_multi_inspiral
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiangomezlopez authored Feb 19, 2025
1 parent a93ab82 commit 3943e97
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions bin/pycbc_multi_inspiral
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand All @@ -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


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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]]
]
}
Expand Down Expand Up @@ -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]]
]
)
Expand Down Expand Up @@ -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]]
]
)
Expand Down

0 comments on commit 3943e97

Please sign in to comment.