Skip to content

Commit

Permalink
PhaseTD pregenerate hist will not work on some code paths
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jan 13, 2025
1 parent 7c0dc27 commit edac533
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pycbc/events/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,12 @@ def __init__(
self.pbin = numpy.zeros(128, dtype=numpy.int32)
self.sbin = numpy.zeros(128, dtype=numpy.int32)

if pregenerate_hist and not len(ifos) == 1:
# Is the histogram needed to be pre-generated?
hist_needed = pregenerate_hist
hist_needed &= not len(ifos) == 1
hist_needed &= (type(self).__name__ == "PhaseTD" or self.kwargs["phasetd"])

if hist_needed:
self.get_hist()
elif len(ifos) == 1:
# remove all phasetd files from self.files and self.file_hashes,
Expand Down Expand Up @@ -1628,6 +1633,8 @@ def rank_stat_coinc(
ln_s = 0

if self.kwargs["phasetd"]:
if not self.has_hist:
self.get_hist()
# Find total volume of phase-time-amplitude space occupied by
# noise coincs, so that the logsignalrate function is properly
# normalized
Expand Down

0 comments on commit edac533

Please sign in to comment.