Skip to content

Commit

Permalink
cleanup reversion to descope
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Oct 9, 2023
1 parent d5003c3 commit c17a2fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions bin/all_sky_search/pycbc_bin_trigger_rates_dq
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ with HFile(args.trig_file, 'r') as trig_file:
logging.info('Generating trigger mask')
idx, _ = trig_file.select(
lambda snr: snr > args.stat_threshold if args,
*[f'{ifo}/{trig_s}' for trig_s in trig_stats],
return_indices=True,
f'{ifo}/snr',
return_indices=True
)
data_mask = np.zeros(n_triggers_orig, dtype=bool)
data_mask[idx] = True
Expand All @@ -87,16 +87,19 @@ trig_times_int = trig_times.astype('int')

del trigs

logging.info("Cutting triggers with --sngl-ranking below threshold")
if not args.sngl_ranking == 'snr':
keep = stat > args.stat_threshold
tmplt_ids = tmplt_ids[keep]
trig_times = trig_times[keep]
stat = stat[keep]
trig_times_int = trig_times_int[keep]

n_triggers = tmplt_ids.size

logging.info("Applying %s > %.3f cut", args.sngl_ranking,
args.stat_threshold)
# Calculate the sngl-ranking and apply mask based on that
stat = ranking.get_sngls_ranking_from_trigs(trigs, args.sngl_ranking)
keep = stat > args.stat_threshold
tmplt_ids = tmplt_ids[keep]
trig_times = trig_times[keep]
trig_times_int = trig_times_int[keep]
logging.info("Removed %d triggers, %d remain",
n_triggers - tmplt_ids.size, tmplt_ids.size)

dq_logl = np.array([])
dq_times = np.array([])

Expand Down
2 changes: 1 addition & 1 deletion pycbc/io/hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def __init__(self, trig_file, bank_file, veto_file,
logging.info('Loading bank')
self.bank = HFile(bank_file, 'r')
else:
logging.info('No bank file given')
logging.info('No bank file given to SingleDetTriggers')
# empty dict in place of non-existent hdf file
self.bank = {}

Expand Down

0 comments on commit c17a2fc

Please sign in to comment.