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.

Files for periodicity, version 0.1.0b2
Filename, size File type Python version Upload date Hashes
Filename, size periodicity-0.1.0b2-py3-none-any.whl (11.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size periodicity-0.1.0b2.tar.gz (8.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page