Skip to content

Commit

Permalink
Fix trapezoid call
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Sep 2, 2024
1 parent 697831e commit 0b197e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion stingray/multitaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
import warnings

import numpy as np

try:
from numpy import trapezoid
except ImportError:
from numpy import trapz as trapezoid

import scipy.optimize
import scipy.stats
from scipy import signal, interpolate
Expand Down Expand Up @@ -460,7 +466,7 @@ def _get_adaptive_psd(self, freq_response, eigvals, max_iter=150):

psd_est = self.psd_from_freq_response(freq_response, sqrt_eigvals[:, np.newaxis])

var = np.trapz(psd_est, dx=np.pi / n_freqs) / (2 * np.pi)
var = trapezoid(psd_est, dx=np.pi / n_freqs) / (2 * np.pi)
del psd_est

psd = np.empty(n_freqs)
Expand Down

0 comments on commit 0b197e8

Please sign in to comment.