lombscargle_fast¶
-
lombscargle.implementations.
lombscargle_fast
(t, y, dy, f0, df, Nf, center_data=True, fit_bias=True, normalization='normalized', use_fft=True, trig_sum_kwds=None) [edit on github][source]¶ Fast Lomb-Scargle Periodogram
This implements the Press & Rybicki method [R4] for fast O[N log(N)] Lomb-Scargle periodograms.
Parameters: t, y, dy : array_like
times, values, and errors of the data points. These should be broadcastable to the same shape.
f0, df, Nf : (float, float, int)
parameters describing the frequency grid, f = f0 + df * arange(Nf).
center_data : bool (default=True)
Specify whether to subtract the mean of the data before the fit
fit_bias : bool (default=True)
If True, then compute the floating-mean periodogram; i.e. let the mean vary with the fit.
normalization : string (optional, default=’normalized’)
Normalization to use for the periodogram TODO: figure out what options to use
use_fft : bool (default=True)
If True, then use the Press & Rybicki O[NlogN] algorithm to compute the result. Otherwise, use a slower O[N^2] algorithm
trig_sum_kwds : dict or None (optional)
extra keyword arguments to pass to the
trig_sum
utility. Options areoversampling
andMfft
. See documentation oftrig_sum
for details.Returns: power : ndarray
Lomb-Scargle power associated with each frequency. Units of the result depend on the normalization.
Notes
Note that the
use_fft=True
algorithm is an approximation to the true Lomb-Scargle periodogram, and as the number of points grows this approximation improves. On the other hand, for very small datasets (<~50 points or so) this approximation may not be useful.References
[R4] (1, 2) Press W.H. and Rybicki, G.B, “Fast algorithm for spectral analysis of unevenly sampled data”. ApJ 1:338, p277, 1989 [R5] - Zechmeister and M. Kurster, A&A 496, 577-584 (2009)
[R6] - Press et al, Numerical Recipies in C (2002)