Skip to content
Snippets Groups Projects
Commit 741b0c7f authored by Patrick Godwin's avatar Patrick Godwin
Browse files

gstlal_inspiral, inspiral.py: use f_lower from injection to create waveform,...

gstlal_inspiral, inspiral.py: use f_lower from injection to create waveform, use f_min, f_max from SVD bank to calculate expected SNR
parent aa5e41ec
No related branches found
No related tags found
No related merge requests found
......@@ -764,15 +764,18 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
if options.injections and options.reference_psd:
if options.verbose:
print("calculating expected SNR for injections...")
print("calculating expected SNR for injections...", file=sys.stderr)
# read in injections
xmldoc = ligolw_utils.load_filename(detectors.injection_filename, verbose = options.verbose, contenthandler = LIGOLWContentHandler)
sim_inspiral_table = lsctables.SimInspiralTable.get_table(xmldoc)
# calculate expected SNR
# NOTE: f_high is determined from the bank's highest sampling
# rate with a fudge factor to safely deal with roll-off
f_low = min(set(bank.f_low for ifo in banks.keys() for bank in banks[ifo]))
f_high = max(set(rate for ifo in banks.keys() for bank in banks[ifo] for rate in bank.get_rates()))
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)
# write the injection file back out to a temporary directory
......
......@@ -248,13 +248,8 @@ def calc_expected_injection_snr(inj, psd, f_low = 15.0, f_high = 2048.0, sample_
if approximant == lalsimulation.NR_hdf5:
LALparams = lal.CreateDict()
lalsimulation.SimInspiralWaveformParamsInsertNumRelData(LALparams, str(inj.numrel_data))
f_min = inj.f_lower
else:
LALparams = None
if f_low is None:
f_min = inj.f_lower
else:
f_min = f_low
h_plus, h_cross = lalsimulation.SimInspiralTD(
m1 = inj.mass1*lal.MSUN_SI,
......@@ -272,7 +267,7 @@ def calc_expected_injection_snr(inj, psd, f_low = 15.0, f_high = 2048.0, sample_
eccentricity = 0.0,
meanPerAno = 0.0,
deltaT = 1.0 / sample_rate,
f_min = f_min,
f_min = inj.f_lower,
f_ref = 0.0,
LALparams = LALparams,
approximant = approximant
......
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