Google Summer of Code 2021 Report
The Project: Integrating Multitaper Periodogram into Stingray
A one-line summary of the project can be stated as follows:
The project involved investigating, implementing, and integrating a superior spectral estimation technique, called the Multitaper Periodogram, into a software package named Stingray, which specializes in spectral-timing analysis of astrophysical X-ray time series.
The Stingray project is a sub-organization of OpenAstronomy, which, as given on its landing page, is a collaboration between open-source astronomy and astrophysics projects to share resources, ideas, and to improve code.
While the proposed milestones only included proof-of-concept and final implementations of the Multitaper algorithm, a proof-of-concept implementation of a recently showcased technique (A. Springford et al. (2020)) which uses the Multitapering concept to improve the Lomb-Scargle periodogram, a popular technique to obtain spectral estimates of time series with uneven temporal sampling, was also proposed as an optional milestone.
For exhaustive details of the project, such as motivation, improvements over other methods, references and more, please refer the project proposal.
Given below is a brief summary of the Multitaper spectrum estimate:
The Work
Not only the was Multitaper algorithm successfully implemented and merged, the Multitaper based Lomb-Scargle periodogram, of which only a proof-of-concept was proposed, was also fully implemented, and merged, extending on the prior implementation.
Repositories
https://github.com/StingraySoftware/stingray
https://github.com/StingraySoftware/notebooks
Milestones
-
Proof-of-concept implementation of the Multitaper algorithm.
-
Full implementation, integration of the algorithm into the Stingray framework, including tests and relevant documentation.
-
Proof-of-concept implementation of the Multitaper Lomb-Scargle algorithm. (Optional)
-
Full implementation, integration of the Multitaper Lomb-Scargle algorithm into the Stingray framework, including tests and relevant documentation. (Unproposed)
-
Tutorial Notebook.
-
Support for overlapping (tapered) data segments for use in averaged periodograms, like in the Welch method. (Optional) (The project took a different direction, and work was being done to add support for uneven time series)
Pull Requests
Pull Request | Commit | Status | Description |
---|---|---|---|
Multitaper Periodogram using SciPy | b053ebd | The core of the project, encapsulating almost all the work associated with the proposed milestones, including test and documentation. | |
Extending the Multitapering concept to unevenly sampled time-series: Multitaper Lomb-Scargle | 9826db4 | Contains the implementation of the Multitaper Lomb-Scargle, as derived from the research paper, with tests and documentation. Is implemented using Astropy’s Lomb-Scargle routine, for fast computation. | |
Extending the Multitapering concept to unevenly sampled time-series: Multitaper Lomb-Scargle | 40104c5 | This, too, contains the implementation of the Multitaper Lomb-Scargle. The default brute-force way to calculate the Lomb-Scargle Periodogram runs in O(n^2) time complexity and is thus impractical for research purposes. Thus, this PR contained an O(n log(n)) implementation of the same, implemented in Stingray itself, which is presented in Press & Rybicki (2012). It was closed in favor of the PR above to minimize potential break points and use Astropy’s implementation instead, as Astropy was already a dependency. | |
Proof-of-Concept Multitaper Periodogram Implementation | aef0f39 | This contains the initial proof-of-concept implementation, which was a wrapper around another package called ‘nitime’. This PR was created before submitting the proposal for prototyping purposes. Final implementation uses SciPy for greater granularity and flexibility, and also to keep dependencies, thus, break points, at a minimum. | |
Multitaper example notebook | 4ea1b5d | A jupyter notebook showcasing the new Multitaper method, while also giving an intuitive insight at the workings of the technique. |
The Result
This project, completed under the Google Summer of Code 2021 program, successfully implemented, and integrated a spectral estimation technique which hopefully proves to be a valuable tool in a time series analyst’s arsenal, accounting to is desirable noise properties.
Below is a jupyter notebook, showcasing the use of this technique:
Beyong GSoC, logical next steps
At the time of writing, support for time series with uneven temporal sampling (Lomb-Scargle)
for the Powerspectrum
class is being worked upon, with possible extension
to the Crossspectrum
class.
- Add support for Lomb-Scargle periodograms/uneven time-series to
Powerspectrum
- Add support for Lomb-Scargle periodograms/uneven time-series to
Crossspectrum
Acknowledgements
I would like to thank the mentors, Daniela Huppenkothen and Matteo Bachetti, for their incredible support from day one, insightful in-depth reviews and so much more. I seriously could not have asked for anything more.
Blogs
These are the blogs written during the GSoC ‘21 program
Profiles
GitHub: https://github.com/dhruv9vats
LinkedIn: https://www.linkedin.com/in/dhruv9vats/
Medium: https://dhruv9vats.medium.com/