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 c17a2fc commit 07fbaf3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bin/all_sky_search/pycbc_bin_trigger_rates_dq
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ with HFile(args.trig_file, 'r') as trig_file:
logging.info("Trigger file has %d triggers", n_triggers_orig)
logging.info('Generating trigger mask')
idx, _ = trig_file.select(
lambda snr: snr > args.stat_threshold if args,
lambda snr: snr > args.stat_threshold,
f'{ifo}/snr',
return_indices=True
)
data_mask = np.zeros(n_triggers_orig, dtype=bool)
data_mask[idx] = True

logging.info("Getting %s triggers from file with SNR > %.3f",
logging.info("Getting %s triggers from file with pre-cut SNR > %.3f",
idx.size, args.stat_threshold)

trigs = SingleDetTriggers(
Expand All @@ -90,9 +90,7 @@ del trigs
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)
args.stat_threshold)
keep = stat > args.stat_threshold
tmplt_ids = tmplt_ids[keep]
trig_times = trig_times[keep]
Expand Down Expand Up @@ -167,7 +165,7 @@ if args.prune_number > 0:
stat[remove] = 0
trig_stats_bin[remove_inbin] = 0
keep = np.flatnonzero(stat)
logging.info("%d triggers removed through pruning", len(keep))
logging.info("%d triggers removed through pruning", keep.size)
trig_times_int = trig_times_int[keep]
tmplt_ids = tmplt_ids[keep]
del stat
Expand Down

0 comments on commit 07fbaf3

Please sign in to comment.