Skip to content
Snippets Groups Projects
Commit 1bf0cce6 authored by chad.hanna's avatar chad.hanna
Browse files

gstlal_inspiral: move the make_horizon_distance function to svd_bank

parent b17d8585
No related branches found
No related tags found
No related merge requests found
......@@ -534,25 +534,6 @@ class OneTimeSignalHandler(object):
#
def make_horizon_distance_func(banks, sngl_inspiral_table):
# span is [15 Hz, 0.85 * Nyquist frequency]
# find the Nyquist frequency for the PSD to be used for each
# instrument. require them to all match
nyquists = set(max(rate for bank in banklist for rate in bank.get_rates()) // 2 for instrument, banklist in banks.items())
assert len(nyquists) == 1, "all banks must have the same Nyquist frequency to define a consistent horizon distance function (got %s)" % ", ".join("%g" % rate for rate in sorted(nyquists))
# assume default 32 s PSD. this is not required to be correct, but
# for best accuracy it should not be larger than the true value and
# for best performance it should not be smaller than the true
# value.
deltaF = 1. / 32.
# pick (m1, m2) from the median template ranked by Mchirp^(5/3)
# to provide the canonical waveform model. See Maggiore equation
# (4.3).
assert len(sngl_inspiral_table) > 0, "no templates: must have templates to define horizon distance function"
median_row = sorted(sngl_inspiral_table, key = lambda row: row.mchirp**(5./3.))[len(sngl_inspiral_table) // 2]
return reference_psd.HorizonDistance(15.0, 0.85 * max(nyquists), deltaF, median_row.mass1, median_row.mass2)
#
# =============================================================================
#
......@@ -824,7 +805,7 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
verbose = options.verbose
),
rankingstat = rankingstat,
horizon_distance_func = make_horizon_distance_func(banks, sngl_inspiral_table),
horizon_distance_func = svd_bank.make_horizon_distance_func(banks),
gracedbwrapper = inspiral.GracedBWrapper(
instruments = rankingstat.instruments,
far_threshold = options.gracedb_far_threshold,
......
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