Ejemplo n.º 1
0
def test_longDurations():
    """Test that bls is not computed if transit duration is too long"""
    time,flux = loadData()

    periodList = [10.]
    duration_daysList = [11]

    blsArray = fbls.computeBlsForManyPeriods(time, flux, duration_daysList, periodList)


    assert(blsArray.shape[:2] == (1,1))
    assert(np.all(blsArray==0))
Ejemplo n.º 2
0
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