Skip to content

Commit

Permalink
remove checks around the psd_var_val
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Oct 11, 2023
1 parent 4f71e1a commit faf002c
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions bin/all_sky_search/pycbc_bin_trigger_rates_dq
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,13 @@ ifo = args.ifo
# This works as a pre-filter as SNR is always greater than or equal
# to sngl_ranking, except in the psdvar case, where it could increase.

def check_snr_psdvar(snr, psd_var_val):
"""
Convenience function to calculate the maximum possible ranking statistic
value given SNR and psd variation statistic
"""
rw_snr = snr / psd_var_val ** 0.5
rw_snr[psd_var_val == 0] = 0
return rw_snr >= args.stat_threshold

with HFile(args.trig_file, 'r') as trig_file:
n_triggers_orig = trig_file[f'{ifo}/snr'].size
logging.info("Trigger file has %d triggers", n_triggers_orig)
logging.info('Generating trigger mask')
if f'{ifo}/psd_var_val' in trig_file:
idx, _, _ = trig_file.select(
check_snr_psdvar,
lambda snr, psdvar: snr / psdvar ** 0.5 >= args.stat_threshold,
f'{ifo}/snr',
f'{ifo}/psd_var_val',
return_indices=True
Expand Down

0 comments on commit faf002c

Please sign in to comment.