Skip to content
Snippets Groups Projects
Commit 6fa09468 authored by Wanting Niu's avatar Wanting Niu :speech_balloon:
Browse files

read process params table from bank splitter to calculate f_max with better accuracy

parent f35cc99a
No related branches found
No related tags found
1 merge request!320read process params table from bank splitter to calculate f_max with better accuracy
Pipeline #469062 passed
......@@ -64,6 +64,7 @@ from gstlal import templates
from gstlal.psd import condition_psd, HorizonDistance
from gstlal import chirptime
from gstlal import spawaveform
class DefaultContentHandler(ligolw.LIGOLWContentHandler):
pass
......@@ -286,30 +287,27 @@ def cal_higher_f_low(template_bank_url, bank_xmldoc, flow, max_duration):
bank_sngl_table = lsctables.SnglInspiralTable.get_table(bank_xmldoc)
f_high = check_ffinal_and_find_max_ffinal(bank_xmldoc) # maximum frequency cut off
approximant, = ligolw_process.get_process_params(bank_xmldoc, 'gstlal_bank_splitter', '--approximant')
time_constrained_f_low = []
for row in bank_sngl_table:
m1_SI = lal.MSUN_SI * row.mass1
m2_SI = lal.MSUN_SI * row.mass2
spin1 = (row.spin1x**2 + row.spin1y**2 + row.spin1z**2)**.5
spin2 = (row.spin2x**2 + row.spin2y**2 + row.spin2z**2)**.5
f_max = f_high
# we should use f_max below for subsolar mass search (but have to call approximants like gstlal_inspiral_bank_splitter)
# f_max = min(row.f_final, 2 * chirptime.ringf(lal.MSUN_SI * row.mass1 + lal.MSUN_SI * row.mass2, chirptime.overestimate_j_from_chi(max((row.spin1x**2 + row.spin1y**2 + row.spin1z**2)**.5, (row.spin2x**2 + row.spin2y**2 + row.spin2z**2)**.5))) if approximant in templates.gstlal_IMR_approximants else spawaveform.ffinal(row.mass1, row.mass2, 'bkl_isco'))
f_max = min(row.f_final, 2 * chirptime.ringf(lal.MSUN_SI * row.mass1 + lal.MSUN_SI * row.mass2, chirptime.overestimate_j_from_chi(max((row.spin1x**2 + row.spin1y**2 + row.spin1z**2)**.5, (row.spin2x**2 + row.spin2y**2 + row.spin2z**2)**.5))) if approximant in templates.gstlal_IMR_approximants else spawaveform.ffinal(row.mass1, row.mass2, 'bkl_isco'))
time_constrained_f_low.append(scipy.optimize.fsolve(time_freq_bound, x0 = flow, args = (max_duration, m1_SI, m2_SI, spin1, spin2, f_max)))
f_low = float(max(flow, max(time_constrained_f_low)))
if f_high is not None and f_high < f_low:
raise ValueError("Lower frequency must be lower than higher frequency cut off! Input max_duration is too short.")
for row in bank_sngl_table:
row.template_duration = chirptime.imr_time(f_low,
lal.MSUN_SI * row.mass1,
lal.MSUN_SI * row.mass2,
(row.spin1x**2 + row.spin1y**2 + row.spin1z**2)**.5,
(row.spin2x**2 + row.spin2y**2 + row.spin2z**2)**.5,
f_max = f_high)
# we should use f_max below for subsolar mass search (but have to call approximants like gstlal_inspiral_bank_splitter)
# f_max = min(row.f_final, 2 * chirptime.ringf(lal.MSUN_SI * row.mass1 + lal.MSUN_SI * row.mass2, chirptime.overestimate_j_from_chi(max((row.spin1x**2 + row.spin1y**2 + row.spin1z**2)**.5, (row.spin2x**2 + row.spin2y**2 + row.spin2z**2)**.5))) if approximant in templates.gstlal_IMR_approximants else spawaveform.ffinal(row.mass1, row.mass2, 'bkl_isco')))
f_max = min(row.f_final, 2 * chirptime.ringf(lal.MSUN_SI * row.mass1 + lal.MSUN_SI * row.mass2, chirptime.overestimate_j_from_chi(max((row.spin1x**2 + row.spin1y**2 + row.spin1z**2)**.5, (row.spin2x**2 + row.spin2y**2 + row.spin2z**2)**.5))) if approximant in templates.gstlal_IMR_approximants else spawaveform.ffinal(row.mass1, row.mass2, 'bkl_isco')))
# save the overwrite
ligolw_utils.write_filename(bank_xmldoc, template_bank_url)
return f_low
......
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