From 1a0efb6e72522b0bc5f1be628d286ce98a3bc1ed Mon Sep 17 00:00:00 2001 From: Koustav Chandra <56917539+KoustavChandra@users.noreply.github.com> Date: Thu, 17 Dec 2020 21:02:45 +0530 Subject: [PATCH] Update pycbc_inspiral_skymax by removing redundant portions (#3566) * Updated working pycbc_inspiral_skymax * Modified part of the code --- bin/pycbc_inspiral_skymax | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/bin/pycbc_inspiral_skymax b/bin/pycbc_inspiral_skymax index a7ffaa22d5e..f082f7d3841 100755 --- a/bin/pycbc_inspiral_skymax +++ b/bin/pycbc_inspiral_skymax @@ -143,6 +143,8 @@ parser.add_argument("--keep-loudest-num", type=int, parser.add_argument("--keep-loudest-stat", default="newsnr", choices=events.ranking.sngls_ranking_function_dict.keys(), help="Statistic used to determine loudest to keep") +parser.add_argument("--keep-loudest-log-chirp-window", type=float, + help="Keep loudest triggers within ln chirp mass window") parser.add_argument("--finalize-events-template-rate", default=None, type=int, metavar="NUM TEMPLATES", help="After NUM TEMPLATES perform the various clustering " @@ -354,38 +356,6 @@ event_mgr.consolidate_events(opt, gwstrain=gwstrain) event_mgr.finalize_events() logging.info("Found %s triggers" % str(len(event_mgr.events))) -if opt.chisq_threshold and opt.chisq_bins: - logging.info("Removing triggers with poor chisq") - event_mgr.chisq_threshold(opt.chisq_threshold, opt.chisq_bins, - opt.chisq_delta) - logging.info("%d remaining triggers" % len(event_mgr.events)) - -if opt.newsnr_threshold and opt.chisq_bins: - logging.info("Removing triggers with NewSNR below threshold") - event_mgr.newsnr_threshold(opt.newsnr_threshold) - logging.info("%d remaining triggers" % len(event_mgr.events)) - -if opt.keep_loudest_interval: - logging.info("Removing triggers not within the top %s loudest of a %s " - "second interval by %s" % (opt.keep_loudest_num, - opt.keep_loudest_interval, - opt.keep_loudest_stat)) - event_mgr.keep_loudest_in_interval(opt.keep_loudest_interval * opt.sample_rate, - opt.keep_loudest_num, - statname=opt.keep_loudest_stat) - logging.info("%d remaining triggers" % len(event_mgr.events)) - -if opt.injection_window and hasattr(gwstrain, 'injections'): - logging.info("Keeping triggers within %s seconds of injection" % opt.injection_window) - event_mgr.keep_near_injection(opt.injection_window, gwstrain.injections) - logging.info("%d remaining triggers" % len(event_mgr.events)) - -if opt.maximization_interval: - logging.info("Maximizing triggers over %s ms window" % opt.maximization_interval) - window = int(opt.maximization_interval * gwstrain.sample_rate / 1000) - event_mgr.maximize_over_bank("time_index", "snr", window) - logging.info("%d remaining triggers" % len(event_mgr.events)) - logging.info("Writing out triggers") event_mgr.write_events(opt.output) @@ -396,3 +366,4 @@ if opt.fftw_output_double_wisdom_file: fft.fftw.export_double_wisdom_to_filename(opt.fftw_output_double_wisdom_file) logging.info("Finished") +