lomb_scargle

gammapy.time.lomb_scargle(time, flux, flux_err, dt, max_period=None, criteria='all', n_bootstraps=100)[source]

Compute period and its false alarm probability of a light curve using Lomb-Scargle PSD.

To compute the Lomb-Scargle power spectral density, astropy.stats.LombScargle is called. For eyesight inspection, the spectral window function is also returned to evaluate the impact of sampling on the periodogram. The criteria for the false alarm probability are both parametric and non-parametric.

For an introduction to the Lomb-Scargle periodogram, see Lomb (1976) and Scargle (1982). For an introduction to the false alarm probability of thr Lomb-Scargle periodogram, see the astropy docs.

The function returns a results dictionary with the following content:

  • pgrid (ndarray) – Period grid in units of t
  • psd (ndarray) – PSD of Lomb-Scargle at frequencies of fgrid
  • period (float) – Location of the highest periodogram peak
  • fap (float) or (ndarray) – False alarm probability of period under the null hypothesis of only-noise data for the specified criteria. If criteria is not defined, the false alarm probability of all criteria is returned.
  • swf (ndarray) – Spectral window function
Parameters:

time : ndarray

Time array of the light curve

flux : ndarray

Flux array of the light curve

flux_err : ndarray

Flux error array of the light curve

dt : float

Desired resolution of the periodogram and the window function

max_period : float

Maximum period to analyse

criteria : list of str

Select which significance methods you’d like to run (by default all are running) Available: {'pre', 'cvm', 'nll', 'boot'}

  • pre for pre-defined beta distribution (see Schwarzenberg-Czerny (1998))
  • cvm for Cramer-von-Mises distance minimisation (see Thieler et at. (2016))
  • nll for negative logarithmic likelihood minimisation
  • boot for bootstrap-resampling (see Sueveges (2012)
    and astroML.time_series.lomb_scargle_bootstrap.

n_bootstraps : int

Number of bootstraps resampling

Returns:

results : OrderedDict

Results dictionary (see description above).

References

[R3136]Lomb (1976), “Least-squares frequency analysis of unequally spaced data”, Link
[R3236]Scargle (1982), “Studies in astronomical time series analysis. II - Statistical aspects of spectral analysis of unevenly spaced data”, Link
[R3336]Schwarzenberg-Czerny (1998), “The distribution of empirical periodograms: Lomb-Scargle and PDM spectra”, Link
[R3436]Thieler et at. (2016), “RobPer: An R Package to Calculate Periodograms for Light Curves Based on Robust Regression”, Link
[R3536]Sueveges (2012), “False Alarm Probability based on bootstrap and extreme-value methods for periodogram peaks”, Link
[R3636]Astropy docs, Lomb-Scargle Periodograms, Link