11.5.1.1. astroML.time_series.lomb_scargle¶
- astroML.time_series.lomb_scargle()¶
(Generalized) Lomb-Scargle Periodogram with Floating Mean
Parameters : t : array_like
sequence of times
y : array_like
sequence of observations
dy : array_like
sequence of observational errors
omega : array_like
frequencies at which to evaluate p(omega)
generalized : bool
if True (default) use generalized lomb-scargle method otherwise, use classic lomb-scargle.
subtract_mean : bool
if True (default) subtract the sample mean from the data before computing the periodogram. Only referenced if generalized is False.
significance : None or float or ndarray
if specified, then this is a list of significances to compute for the results.
Returns : p : array_like
Lomb-Scargle power associated with each frequency omega
z : array_like
if significance is specified, this gives the levels corresponding to the desired significance (using the Scargle 1982 formalism)
Notes
The algorithm is based on reference [R21]. The result for generalized=False is given by equation 4 of this work, while the result for generalized=True is given by equation 20.
Note that the normalization used in this reference is different from that used in other places in the literature (e.g. [R22]). For a discussion of normalization and false-alarm probability, see [R21].
To recover the normalization used in Scargle [R23], the results should be multiplied by (N - 1) / 2 where N is the number of data points.
References
[R21] (1, 2, 3) - Zechmeister and M. Kurster, A&A 496, 577-584 (2009)
[R22] (1, 2) - Press et al, Numerical Recipies in C (2002)
[R23] (1, 2) Scargle, J.D. 1982, ApJ 263:835-853