Skip to content
Snippets Groups Projects
Commit 4197e459 authored by Chad Hanna's avatar Chad Hanna
Browse files

templates.py: trap ValueError for some time slices which are too short to have valid inspiral times

parent d46e7b4b
No related branches found
No related tags found
No related merge requests found
......@@ -297,8 +297,11 @@ def time_slices(
if segment_samples_min > segment_samples_max:
raise ValueError("The input template bank must have fewer than %d templates, but had %d." % (segment_samples_max, 2 * len(sngl_inspiral_rows)))
longest_chirp = max(spawaveform.imrchirptime(row.mass1,row.mass2,this_flow,spawaveform.computechi(row.mass1, row.mass2, row.spin1z, row.spin2z)) for row in sngl_inspiral_rows)
try:
longest_chirp = max(spawaveform.imrchirptime(row.mass1,row.mass2,this_flow,spawaveform.computechi(row.mass1, row.mass2, row.spin1z, row.spin2z)) for row in sngl_inspiral_rows)
except ValueError as e:
print "Continuing decomposition by moving to next slice despite:\n\t", e
continue
# Do any of the templates go beyond the accumulated time?
# If so, we need to add some blocks at this sampling rate.
# If not, we can skip this sampling rate and move on to the next lower one.
......
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