♪ My period don't jiggle jiggle, it folds... ♪
A python script to find the time period of a given time series data
Photon arrival times
To compare the
where
If
Below you can see an example of folding with correct and wrong period.
pip install git+https://github.com/maksatsat/efsearch.git
from efsearch.ef_search import search, periodic_generator
Generating periodic data with period=30:
times = periodic_generator(period= 42, obs_length = 1000, mean_countrate = 50, pulsed_fraction = 1.0)
Calculating chi2 statistics for periods from 10 to 50 seconds and plotting the results:
periods, chi2 = search(times, 30, 70)
with plt.xkcd():
plt.plot(periods, chi2)