Skip to content

Commit

Permalink
Merge branch 'StingraySoftware:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti authored Sep 4, 2024
2 parents 490e03b + 241f81a commit f4ae6a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/acknowledgements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Acknowledgements

Thank you to JetBrains for the free use of `PyCharm <https://www.jetbrains.com/pycharm/>`_.

Stingray participated in the `Google Summer of Code <https://summerofcode.withgoogle.com>`_ in 2018 and 2020 under `Open Astronomy <http://openastronomy.org>`_, in 2017 under the `Python Software Foundation <https://www.python.org/psf/>`_, and in 2016 under `Timelab <http://timelabtechnologies.com>`_.
Stingray participated in the `Google Summer of Code <https://summerofcode.withgoogle.com>`_ in 2018, 2020, 2021, 2022, 2023, 2024 under `Open Astronomy <http://openastronomy.org>`_, in 2017 under the `Python Software Foundation <https://www.python.org/psf/>`_, and in 2016 under Timelab.
2 changes: 1 addition & 1 deletion docs/citing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://help.zenodo.org/faq/#versioning>`__, `10.5281/zenodo.1490116 <https://zenodo.org/record/1490116>`__ (`BibTeX <https://zenodo.org/record/1490116/export/hx>`__), 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 <https://zenodo.org/help/versioning>`__, `10.5281/zenodo.1490116 <https://zenodo.org/record/1490116>`__ (`BibTeX <https://zenodo.org/record/1490116/export/hx>`__), which will always resolve to the latest release.

Papers
======
Expand Down
8 changes: 7 additions & 1 deletion stingray/multitaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
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 = integration_func(psd_est, dx=np.pi / n_freqs) / (2 * np.pi)
del psd_est

psd = np.empty(n_freqs)
Expand Down

0 comments on commit f4ae6a1

Please sign in to comment.