Skip to content

Commit

Permalink
FIx modulus issue
Browse files Browse the repository at this point in the history
  • Loading branch information
spxiwh committed Sep 9, 2022
1 parent 543ec9b commit 215d548
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pycbc/events/eventmgr_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def logsignalrateinternals_computepsignalbins(
for idx in range(length):
ridx = rtype[idx]
pdif[idx] = (pref[ridx] - p[ridx]) % (M_PI * 2)
if pdif[idx] < 0:
# C modulus operator is not same as python's, correct for this
pdif[idx] += (M_PI * 2)
tdif[idx] = shift[ridx] * to_shift_ref + tref[ridx] - shift[ridx] * to_shift_ifo - t[ridx]
sdif[idx] = (s[ridx] * sense * sqrt(sigref[ridx])) / (sref[ridx] * senseref * sqrt(sig[ridx]))

Expand Down

0 comments on commit 215d548

Please sign in to comment.