Skip to content

Commit

Permalink
Update pycbc_inspiral_skymax by removing redundant portions (gwastro#…
Browse files Browse the repository at this point in the history
…3566)

* Updated working pycbc_inspiral_skymax

* Modified part of the code
  • Loading branch information
koustavchandra authored Dec 17, 2020
1 parent 6f8a559 commit 1a0efb6
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions bin/pycbc_inspiral_skymax
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down Expand Up @@ -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)

Expand All @@ -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")

0 comments on commit 1a0efb6

Please sign in to comment.