def test_atciqz_aticq(t, pos): """Check replacements against erfa versions for consistency.""" jd1, jd2 = get_jd12(t, 'tdb') astrom, _ = erfa.apci13(jd1, jd2) ra = pos.lon.to_value(u.rad) dec = pos.lat.to_value(u.rad) assert_allclose(erfa.atciqz(ra, dec, astrom), atciqz(pos, astrom)) assert_allclose(erfa.aticq(ra, dec, astrom), aticq(pos, astrom))
def test_atciqz_aticq(st): """Check replacements against erfa versions for consistency.""" t, pos = st jd1, jd2 = get_jd12(t, 'tdb') astrom, _ = erfa.apci13(jd1, jd2) ra, dec = pos ra = ra.value dec = dec.value assert_allclose(erfa.atciqz(ra, dec, astrom), atciqz(ra, dec, astrom)) assert_allclose(erfa.aticq(ra, dec, astrom), aticq(ra, dec, astrom))
def test_structs(): """ Checks producing and consuming of ERFA c structs """ am, eo = erfa.apci13(2456165.5, [0.401182685, 1]) assert am.shape == (2, ) assert am.dtype == erfa.dt_eraASTROM assert eo.shape == (2, ) # a few spotchecks from test_erfa.c np.testing.assert_allclose(am[0]['pmt'], 12.65133794027378508) np.testing.assert_allclose(am[0]['v'], [0.4289638897157027528e-4, 0.8115034002544663526e-4, 0.3517555122593144633e-4]) ri, di = erfa.atciqz(2.71, 0.174, am[0]) np.testing.assert_allclose(ri, 2.709994899247599271) np.testing.assert_allclose(di, 0.1728740720983623469)