lombscargle¶
-
lombscargle.implementations.
lombscargle
(t, y, dy=None, frequency=None, method='auto', assume_regular_frequency=False, normalization='normalized', fit_bias=True, center_data=True, method_kwds=None, nterms=1) [edit on github][source]¶ Compute the Lomb-scargle Periodogram with a given method.
Parameters: t : array_like
sequence of observation times
y : array_like
sequence of observations associated with times t
dy : float or array_like (optional)
error or sequence of observational errors associated with times t
frequency : array_like
frequencies (not angular frequencies) at which to evaluate the periodogram. If not specified, optimal frequencies will be chosen using a heuristic which will attempt to provide sufficient frequency range and sampling so that peaks will not be missed. Note that in order to use method=’fast’, frequencies must be regularly spaced.
method : string (optional)
specify the lomb scargle implementation to use. Options are:
- ‘auto’: choose the best method based on the input
- ‘fast’: use the O[N log N] fast method. Note that this requires
evenly-spaced frequencies: by default this will be checked unless
assume_regular_frequency
is set to True. slow
: use the O[N^2] pure-python implementationchi2
: use the O[N^2] chi2/linear-fitting implementationfastchi2
: use the O[N log N] chi2 implementation. Note that this requires evenly-spaced frequencies: by default this will be checked unlessassume_regular_frequency
is set to True.scipy
: usescipy.signal.lombscargle
, which is an O[N^2] implementation written in C. Note that this does not support heteroskedastic errors.
assume_regular_frequency : bool (optional)
if True, assume that the input frequency is of the form freq = f0 + df * np.arange(N). Only referenced if method is ‘auto’ or ‘fast’.
normalization : string (optional, default=’normalized’)
Normalization to use for the periodogram. Options are ‘normalized’ or ‘unnormalized’.
fit_bias : bool (optional, default=True)
if True, include a constant offet as part of the model at each frequency. This can lead to more accurate results, especially in then case of incomplete phase coverage.
center_data : bool (optional, default=True)
if True, pre-center the data by subtracting the weighted mean of the input data. This is especially important if
fit_bias = False
method_kwds : dict (optional)
additional keywords to pass to the lomb-scargle method
nterms : int (default=1)
number of Fourier terms to use in the periodogram. Not supported with every method.
Returns: PLS : array_like
Lomb-Scargle power associated with each frequency omega