diff --git a/docs/acknowledgements.rst b/docs/acknowledgements.rst index ba8bcc193..e6277171c 100644 --- a/docs/acknowledgements.rst +++ b/docs/acknowledgements.rst @@ -4,4 +4,4 @@ Acknowledgements Thank you to JetBrains for the free use of `PyCharm `_. -Stingray participated in the `Google Summer of Code `_ in 2018 and 2020 under `Open Astronomy `_, in 2017 under the `Python Software Foundation `_, and in 2016 under `Timelab `_. +Stingray participated in the `Google Summer of Code `_ in 2018, 2020, 2021, 2022, 2023, 2024 under `Open Astronomy `_, in 2017 under the `Python Software Foundation `_, and in 2016 under Timelab. diff --git a/docs/citing.rst b/docs/citing.rst index 6d23f5091..13c27e343 100644 --- a/docs/citing.rst +++ b/docs/citing.rst @@ -12,7 +12,7 @@ If possible, we ask that you cite a DOI corresponding to the specific version of .. include:: _zenodo.rst -If this isn't possible — for example, because you worked with an unreleased version of the code — you can cite Stingray's `concept DOI `__, `10.5281/zenodo.1490116 `__ (`BibTeX `__), which will always resolve to the latest release. +If this isn't possible — for example, because you worked with an unreleased version of the code — you can cite Stingray's `concept DOI `__, `10.5281/zenodo.1490116 `__ (`BibTeX `__), which will always resolve to the latest release. Papers ====== diff --git a/stingray/multitaper.py b/stingray/multitaper.py index 6de5bfab7..3d93f5d91 100644 --- a/stingray/multitaper.py +++ b/stingray/multitaper.py @@ -16,6 +16,12 @@ from .lightcurve import Lightcurve from .utils import rebin_data, simon, fft, rfft, rfftfreq +try: + integration_func = np.trapezoid +except AttributeError: + # < Numpy 2.0.0 + integration_func = np.trapz + __all__ = ["Multitaper"] # Inspired from nitime (https://nipy.org/nitime/) @@ -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 = integration_func(psd_est, dx=np.pi / n_freqs) / (2 * np.pi) del psd_est psd = np.empty(n_freqs)