Useful tools for analysis of periodicities in time series data
Project description
Periodicity
Useful tools for analysis of periodicities in time series data.
Includes:
- 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
implementationcelerite
implementationpymc3
implementation (in progress)
Quick start
Installing current release from pypi (v0.1.0-alpha)
$ pip install periodicity
Installing current development version
$ git clone https://github.com/dioph/periodicity.git
$ cd periodicity
$ python setup.py install
Example using GP with astronomical data
from periodicity.gp 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)
model.minimize()
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
periodicity-0.1.0b0.tar.gz
(8.7 kB
view hashes)
Built Distribution
Close
Hashes for periodicity-0.1.0b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4949a1d9a1544720be3a9175e06b78531b1c25f605a5f42debdd98734737eb79 |
|
MD5 | fd86cb94ea12936387491d60159d1865 |
|
BLAKE2b-256 | 09902af009e67be9520aafee955188fb89bb4791be8529f0285208e44d662e4f |