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

get_period() fails with Nterms=1 #40

Closed MrBudgens closed 3 years ago

MrBudgens commented 3 years ago

Simple example to demonstrate the issue:

import PIPS import numpy as np Npoints = 100 noise = 0.1 time = np.sort(np.random.random(Npoints) 10) + 58000 mag = np.sin(timenp.pi) + 15 + np.random.normal(0, noise, size=Npoints) mag_err = np.ones(Npoints) * noise data = [time, mag, mag_err] star = PIPS.photdata(data)

periods, power = star.periodogram(multiprocessing=False, Nterms=1) #This works period, period_err, Z = star.get_period(multiprocessing=False, Nterms=1, return_Z=True, debug=True) #This fails

SterlingYM commented 3 years ago

It was a bug due to accidentally performing alias testing in get_period() when Nterms is set to 1. Now this issue is corrected and I can run get_period(Nterms=1) without reproducing the error.