Пример #1
0
def test_coord_trans2():
    """ Test finding ci,eta and cos 45, ra 45 """
    crval1 = 45.0
    crval2 = 45.0
    diff_ra = 5.0  # in arc seconds
    diff_dec = 5.0  # in arc seconds
    ra = crval1 + diff_ra / 3600.0
    dec = crval2 + diff_dec / 3600.0

    # both crval1 and crval2 = 45, gives h in equation = 1
    # and an eta close to diff_dec

    xi, eta = coord.radec2std(crval1, crval2, ra, dec)
    assert math.isclose(xi, -3.535, abs_tol=0.001)
    assert math.isclose(eta, diff_ra, abs_tol=0.001)
Пример #2
0
def test_coord_trans1():
    """ Test finding xi,eta and cos 90, ra 45 """

    crval1 = 45.0
    crval2 = 90.0
    diff_ra = 3.0  # in arc seconds
    diff_dec = 3.0  # in arc seconds
    ra = crval1 + diff_ra / 3600.0
    dec = crval2 + diff_dec / 3600.0

    # declination near 90 yields xi values close to 0
    # and an eta close to diff_dec

    xi, eta = coord.radec2std(crval1, crval2, ra, dec)
    assert math.isclose(xi, 0.0, abs_tol=0.001)
    assert math.isclose(eta, diff_ra, abs_tol=0.001)
Пример #3
0
def test_coord_trans3():
    """ Test going from ra,dec -> xi,eta -> ra,dec """

    crval1 = 27.89
    crval2 = 56.08
    diff_ra = 5.0  # in arc seconds
    diff_dec = 5.0  # in arc seconds
    ra = crval1 + diff_ra / 3600.0
    dec = crval2 + diff_dec / 3600.0

    # both crval1 and crval2 = 45, gives h in equation = 1
    # and an eta close to diff_dec

    xi, eta = coord.radec2std(crval1, crval2, ra, dec)
    ra_test, dec_test = coord.std2radec(crval1, crval2, xi, eta)
    assert math.isclose(ra, ra_test, abs_tol=0.00001)
    assert math.isclose(dec, dec_test, abs_tol=0.00001)