Skip to content

Commit

Permalink
Improve compatibility with Numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Jan 11, 2024
1 parent ee47f7e commit 51a3369
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stingray/pulse/overlapandsave/ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def prepareh(h, nfft: List[int], rfftn=None):
The FFT-transformed, conjugate filter array
"""
rfftn = rfftn or np.fft.rfftn
return np.conj(rfftn(flip(np.conj(h)), nfft))
return np.conj(rfftn(flip(np.conj(h)), nfft, axes=np.arange(len(nfft))))


def slice2range(s: slice):
Expand Down Expand Up @@ -365,7 +365,9 @@ def olsStep(
for (start, length, nh, border) in zip(starts, lengths, nh, border)
)
xpart = padEdges(x, slices, mode=mode, **kwargs)
output = irfftn(rfftn(xpart, nfft) * hfftconj, nfft)
output = irfftn(
rfftn(xpart, nfft, axes=np.arange(len(nfft))) * hfftconj, nfft, axes=np.arange(len(nfft))
)
return output[tuple(slice(0, s) for s in lengths)]


Expand Down

0 comments on commit 51a3369

Please sign in to comment.