Skip to content

Commit

Permalink
the last commit doesn't work, change the logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-fan-wang committed Aug 17, 2024
1 parent 51fd57d commit 899fb22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pycbc/waveform/bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,14 +828,17 @@ def __getitem__(self, index):
ttotal = htilde.length_in_time
else:
ttotal = None
if hasattr(htilde, 'chirp_length'):
# First try to load template_duration from get_waveform_filter,
# if not exists, check if the template bank file contains template_duration,
# if none of them exists, return None
if hasattr(htilde, 'chirp_length') and htilde.chirp_length is not None:
template_duration = htilde.chirp_length
self.table[index].template_duration = template_duration
elif self.table[index].template_duration > 0:
# The template bank file contains 'template_duration'
template_duration = self.table[index].template_duration
else:
template_duration = None
self.table[index].template_duration = None

htilde = htilde.astype(self.dtype)
htilde.f_lower = f_low
Expand Down

0 comments on commit 899fb22

Please sign in to comment.