SterlingYM / astroPIPS

A set of tools for photometric analysis. Determines the period of short-period variable stars.
https://pips.readthedocs.io/en/latest/
MIT License
7 stars 0 forks source link

Large datasets break get_period() #39

Closed MrBudgens closed 3 years ago

MrBudgens commented 3 years ago

get_period() fails when used with too much data, because the likelihood overflows. Using log-likelihood would solve that problem, but that isn't an option provided by get_period() at present.

Simple code to reproduce the problem, which works with Npoints = 100 but fails with Npoints = 1000:

import PIPS import numpy as np Npoints = 100 noise = 0.1 time = np.sort(np.random.random(Npoints) 10) + 58000 mag = np.sin(time2np.pi) + 15 + np.random.normal(0, noise, size=Npoints) mag_err = np.ones(Npoints) noise data = [time, mag, mag_err] star = PIPS.photdata(data) period, period_err, Z = star.get_period(multiprocessing=False, Nterms=2, return_Z=True, debug=True)

SterlingYM commented 3 years ago

Thanks for reporting the issue. We had implemented log-likelihood method for the periodogram module but not to photdata.get_period() as you pointed out. Now it's fixed, and your MWE works with Npoints=10000.