Skip to content
Snippets Groups Projects
Commit 15ea38a1 authored by Patrick Godwin's avatar Patrick Godwin Committed by ChiWai Chan
Browse files

gstlal_inspiral: switch from expected SNR calc in injections to simply trimming down inj list

parent 73ef09d3
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !114. Comments created here will be created in the context of that merge request.
...@@ -775,27 +775,20 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url, ...@@ -775,27 +775,20 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
options.upload_time_before_merger = {row.template_id: abs(row.end.gpsSeconds) + 1e-9*abs(row.end.gpsNanoSeconds) for bank in list(banks.items())[0][-1] for row in bank.sngl_inspiral_table} options.upload_time_before_merger = {row.template_id: abs(row.end.gpsSeconds) + 1e-9*abs(row.end.gpsNanoSeconds) for bank in list(banks.items())[0][-1] for row in bank.sngl_inspiral_table}
# #
# calculate expected injection SNR if processing injections # trim down injection list to the job's analysis segments if processing
# and a PSD is available. if so, this will filter the set # injections. this is done for two reasons:
# of injections, calculate the expected the SNR and write # 1. increase efficiency for the injection element
# the new injection file to disk before the pipeline starts up # 2. decrease size of sim_inspiral table in output trigger files
# #
if (options.injections and options.reference_psd) and not options.data_source in ("lvshm", "framexmit"): if options.injections:
if options.verbose:
print("calculating expected SNR for injections...", file=sys.stderr)
# read in injections # read in injections
xmldoc = ligolw_utils.load_filename(options.injections, verbose = options.verbose, contenthandler = LIGOLWContentHandler) xmldoc = ligolw_utils.load_filename(options.injections, verbose = options.verbose, contenthandler = LIGOLWContentHandler)
sim_inspiral_table = lsctables.SimInspiralTable.get_table(xmldoc) sim_inspiral_table = lsctables.SimInspiralTable.get_table(xmldoc)
# calculate expected SNR # trim injection list to analysis segments
# NOTE: f_high is determined from the bank's highest sampling injections = [inj for inj in sim_inspiral_table if inj.time_geocent in detectors.seg]
# rate with a fudge factor to safely deal with roll-off sim_inspiral_table[:] = injections
f_low = min(set(bank.f_low for ifo in banks.keys() for bank in banks[ifo]))
max_rate = max(set(rate for ifo in banks.keys() for bank in banks[ifo] for rate in bank.get_rates()))
f_high = 0.8 * (max_rate / 2.)
inspiral.calc_sim_inspiral_table_snrs(sim_inspiral_table, psd, detectors.seg, f_low = f_low, f_high = f_high, sample_rate = max_rate)
# write the injection file back out to a temporary directory # write the injection file back out to a temporary directory
f, fname = tempfile.mkstemp(".xml.gz") f, fname = tempfile.mkstemp(".xml.gz")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment