Algorithm Improvements for Fast Lomb Scargle
See original GitHub issueThe fast Lomb-Scargle method implemented in astropy.stats.LombScargle
is based on a what is effectively fast nonuniform Fourier transform approximation proposed by Press & Rybicki (1989); the utility code is here. The result is an approximation good to roughly one part in 10^4-10^5 or so.
Since 1989, there has been a lot of work on more efficient and effective versions of this flavor of operation; for example the NFFT, with the basic algorithm outlined here. The NFFT package is GPL-licensed, and so can’t be used with astropy, but it would be fairly straightforward to replace astropy’s current trig_sum
utility with a Python version of the basic algorithm outlined there. The result would be a much faster and more robust periodogram.
This could be a really fun contribution for someone who wants to dig into fast numerical algorithms…
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (18 by maintainers)
I just released a related package: http://github.com/jakevdp/nfft
I think the best thing would be to basically replace the
trig_sum
utility with thenfft_adjoint
code in that package (and update references in docs to reflect the algorithm change). I haven’t benchmarked it, but I believe it should be several times faster, and it will definitely lead to more accurate results – we can also tighten the tolerance in unit tests ofmethod='fast'
.Yes, please remove milestones from non critical issues.