Exemple #1
0
def test_t_ccd_warm_limit():
    out = t_ccd_warm_limit([10.4] * 6, date='2015:001', min_n_acq=(2, 8e-3))
    assert np.allclose(out[0], -15.2449, atol=0.01)
    assert np.allclose(out[1], 0.008, atol=0.0001)

    out = t_ccd_warm_limit([10.4] * 6, date='2015:001', min_n_acq=5.0)
    assert np.allclose(out[0], -15.143, atol=0.01)
    assert np.allclose(out[1], 5.0, atol=0.01)
def max_temp(time, stars):
    id_hash = hashlib.md5(np.sort(stars['AGASC_ID'])).hexdigest()
    if id_hash not in T_CCD_CACHE:
        # Get tuple of (t_ccd, n_acq) for this star field and cache
        T_CCD_CACHE[id_hash] = t_ccd_warm_limit(
            date=time,
            mags=stars['MAG_ACA'],
            colors=stars['COLOR1'],
            min_n_acq=(2, 8e-3),
            cold_t_ccd=COLD_T_CCD,
            warm_t_ccd=WARM_T_CCD)
#        print "calc temp for ", id_hash
#    else:
#        print "cached temp for ", id_hash
    return T_CCD_CACHE[id_hash]
Exemple #3
0
def test_t_ccd_warm_limit_3_spline():
    halfwidth = [40, 80, 120, 160, 180, 240]
    box = t_ccd_warm_limit([10.0] * 6, date='2018:180', halfwidths=halfwidth, min_n_acq=(2, 8e-3), model='spline')
    assert np.allclose(box[0], -11.0192, atol=0.01, rtol=0)
    assert np.allclose(box[1], 0.008, atol=0.0001, rtol=0)
Exemple #4
0
def test_t_ccd_warm_limit_3():
    halfwidth = [40, 80, 120, 160, 180, 240]
    box = t_ccd_warm_limit([10.4] * 6, date='2015:001', halfwidths=halfwidth, min_n_acq=(2, 8e-3), model='sota')
    assert np.allclose(box[0], -15.6325, atol=0.01, rtol=0)
    assert np.allclose(box[1], 0.008, atol=0.0001, rtol=0)
Exemple #5
0
def test_t_ccd_warm_limit_2_spline():
    out = t_ccd_warm_limit([10.0] * 6, date='2018:180', min_n_acq=5.0, model='spline')
    assert np.allclose(out[0], -10.491, atol=0.01, rtol=0)
    assert np.allclose(out[1], 5.0, atol=0.01, rtol=0)
Exemple #6
0
def test_t_ccd_warm_limit_2():
    out = t_ccd_warm_limit([10.4] * 6, date='2015:001', min_n_acq=5.0, model='sota')
    assert np.allclose(out[0], -14.851, atol=0.01, rtol=0)
    assert np.allclose(out[1], 5.0, atol=0.01, rtol=0)
Exemple #7
0
def test_t_ccd_warm_limit_1_spline():
    out = t_ccd_warm_limit([10.0] * 6, date='2018:180', min_n_acq=(2, 8e-3), model='spline')
    assert np.allclose(out[0], -10.582, atol=0.01, rtol=0)
    assert np.allclose(out[1], 0.008, atol=0.0001, rtol=0)
Exemple #8
0
def test_t_ccd_warm_limit_1():
    out = t_ccd_warm_limit([10.4] * 6, date='2015:001', min_n_acq=(2, 8e-3), model='sota')
    assert np.allclose(out[0], -14.9924, atol=0.01, rtol=0)
    assert np.allclose(out[1], 0.008, atol=0.0001, rtol=0)