Skip to main content

Useful tools for analysis of periodicities in time series data

Project description


Useful tools for analysis of periodicities in time series data.


  • Auto-Correlation Function
  • Fourier methods:
    • Lomb-Scargle periodogram
    • Wavelet Transform (in progress)
  • Phase-folding methods:
    • String Length
    • Analysis of Variance (in progress)
  • Gaussian Processes:
    • george implementation
    • celerite implementation
    • pymc3 implementation (in progress)

Quick start

Installing current release from pypi (v0.1.0-alpha)

$ pip install periodicity

Installing current development version

$ git clone
$ cd periodicity
$ python install

Example using GP with astronomical data

from import *
from lightkurve import search_lightcurvefile

lcs = search_lightcurvefile(target=9895037, quarter=[4,5]).download_all()
lc = lcs[0].PDCSAP_FLUX.normalize().append(lcs[1].PDCSAP_FLUX.normalize())
lc = lc.remove_nans().remove_outliers().bin(binsize=4)

t, x = lc.time, lc.flux
x = x - x.mean()

model = FastGPModeler(t, x)
model.prior = make_gaussian_prior(t, x, pmin=2)
samples = model.mcmc(nwalkers=32, nsteps=5000, burn=500)

print('Median period: {:.2f}'.format(np.exp(np.median(samples[:, 4]))))

Visualization of this example:



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
periodicity-0.1.0b1-py3-none-any.whl (11.3 kB) Copy SHA256 hash SHA256 Wheel py3
periodicity-0.1.0b1.tar.gz (8.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page