def test_fbls1(plot=False): time, flux = makeTestData() duration_daysList = np.array([2,4,6,8]).astype(float) / 24. periodList = [2., 2.3, 2.4, 2.41, 2.42, 2.5, 3.0] blsArray = fbls.computeBlsForManyPeriods(time, flux, duration_daysList, periodList) index = np.argmax(blsArray) per, epc, dur= fbls.getParamsOfIndex(blsArray, index,\ duration_daysList, periodList) if plot: print per, epc+time[0], dur*24 makePlots(time, flux, periodList, blsArray, per, epc) assert(per> 2.3 and per < 2.42) assert(int(dur*24) == 6) assert(epc >1.09 and epc < 1.11) return blsArray
def test_fbls2(plot=False): time,flux = loadData() duration_daysList = np.array([2,4,6,8]).astype(float) / 24. blsArray, periods = fbls.fBls(time, flux, [1,5], duration_daysList) # print periods[0], periods[-1] index = list(fbls.findBestPeak(blsArray)) per, epc, dur= fbls.getParamsOfIndex(blsArray, index,\ duration_daysList, periods) if plot: print index print per, epc+time[0], dur*24 makePlots(time, flux, periods, blsArray, per, epc) assert(per> 4.1 and per < 4.2) assert(int(dur*24) == 4) # print epc assert(epc >1.6 and epc < 1.7) return blsArray, periods, duration_daysList