[ANN] LombScargle.jl: compute periodogram for unevenly sampled data

35 views
Skip to first unread message

Mosè Giordano

unread,
Jul 18, 2016, 4:16:24 AM7/18/16
to julia...@googlegroups.com, julia...@googlegroups.com
Dear all,

I'm pleased to announce the first release of LombScargle.jl, a package to compute the Lomb-Scargle periodogram.  Differently from standard FFT, this can be used to find periodicities in unevenly sampled data, which is a fairly common case in astronomy, a field where this periodogram is widely used.

The README.md has some examples of use, in addition a manual is available at http://lombscarglejl.readthedocs.io/

The package implements the standard Lomb-Scargle periodogram that doesn't take into account a non-null mean of the signal (but it is possible to automatically subtract the average of the signal from the signal itself, and this is the default), and the generalised Lomb-Scargle algorithm which instead can deal with a non-null mean.

Relevant papers on this topic are:
In the future I may implement another much-faster Lomb-Scargle algorithm by Press & Rybicki (1989, ApJ, 338, 277), which however requires the data to be equally sampled (but in this case also the FFT can be used).

In order to test and benchmark the results of LombScargle.jl I compared the result with those of equivalent methods provided by Astropy package.  Running Julia 0.5 I found that the standard Lomb-Scargle periodogram as implemented in LombScargle.jl is ~40% and ~65 faster than the "scipy" and "cython" methods of Astropy, respectively (they're both in Cython, not pure Python).  Instead, the generalised Lomb-Scargle periodogram in LombScargle.jl is ~25% faster than the "cython" method in Astropy.

The LombScargle.jl package is licensed under the MIT “Expat” License.

Bye,
Mosè

Mosè Giordano

unread,
Aug 19, 2016, 9:13:48 PM8/19/16
to julia...@googlegroups.com, julia...@googlegroups.com
Hi all,

an update about the situation of LombScargle.jl

2016-07-18 10:15 GMT+02:00 Mosè Giordano:
In the future I may implement another much-faster Lomb-Scargle algorithm by Press & Rybicki (1989, ApJ, 338, 277), which however requires the data to be equally sampled (but in this case also the FFT can be used).

I managed to implement this method, so now users can choose between three different implementations of the Lomb-Scargle periodogram:
  • the original algorithm, that doesn't deal with uncertainties in the data nor for a non-null mean of the signal (based on Townsend, 2010, ApJS, 191, 247)
  • the so called generalised Lomb-Scargle algorithm, that takes into account uncertainties and a non-zero mean of the signal (based on Zechmeister, Kürster, 2009, A&A, 496, 577)
  • an approximation of the generalised Lomb-Scargle algorithm, made very fast (and with lower computational complexity than the true Lomb-Scargle algorithm) by some tricks suggested by Press & Rybicki, 1989, ApJ, 338, 277.  The only downside is that this method requires the data to be equally sampled.  In the package, this is controlled by the type of the time vector: if it's a Range, this fast method is used (but can be opted-out with a keyword)

Other notable features introduced since the first release:

  • you can choose between 7 different normalizations
  • functions to compute the false-alarm probability
  • a function, findmaxpower, to quickly find the maximum power value of the periodogram
  • in findmaxfreq it is now possible to restrict the search for the frequency with the highest power to a specific range, instead of using the whole periodogram
  • a new function, LombScargle.model, to get the Lomb-Scargle model that best fits your data at a given frequency (without performing an actual periodogram, because this is done just for one frequency)
The complete manual, with some examples complemented with pictures, is available at http://lombscarglejl.readthedocs.io/ (here the PDF version).

The latest version of LombScargle.jl is v0.1.1, be sure to update your package list with Pkg.update() before installing it, if you want to try it out.

Cheers,
Mosè

Mosè Giordano

unread,
May 2, 2017, 4:46:23 AM5/2/17
to Julia Astro, julia...@googlegroups.com
Hi all,

I'm happy to announce the release of LombScargle.jl v0.3.0.  The list of changes is pretty long, the summary is:
  • there were several performance improvements
  • you can now pre-plan a periodogram (much like a Fourier transform with FFTW), which is very useful to speed-up the "fast" method in particular
  • now the package fully supports multi-threading in all methods, both "fast" and "non-fast" (the speed-up is practically linear with the number of cores in the "non-fast" methods, it's less efficient with the "fast" method)

If you want to see the number of how fast it is, here they are.  The Lomb-Scargle periodogram in Astropy is said to be fast, LombScargle.jl does better.  This is a comparison between pre-planned periodograms computed with LombScargle.jl with 1 and 4 threads, and the same periodogram computed with a single thread with Astropy (no pre-planning available here, though):



LombScargle.jl performs much better than Astropy with few datapoints (something similar is seen also in SkyCoords.jl), with many datapoints it's 2-3 times faster than Astropy with a single thread, more than 4 times faster with 4 threads.


Enjoy,

Mosè

Reply all
Reply to author
Forward
0 new messages