def test_gcrs_cirs():
 (ra, dec, _) = randomly_sample_sphere(200)
 gcrs = GCRS(ra=ra, dec=dec, obstime=u'J2000')
 gcrs6 = GCRS(ra=ra, dec=dec, obstime=u'J2006')
 gcrs2 = gcrs.transform_to(CIRS).transform_to(gcrs)
 gcrs6_2 = gcrs6.transform_to(CIRS).transform_to(gcrs)
 assert_allclose(gcrs.ra, gcrs2.ra)
 assert_allclose(gcrs.dec, gcrs2.dec)
 assert (not allclose(gcrs.ra, gcrs6_2.ra))
 assert (not allclose(gcrs.dec, gcrs6_2.dec))
 gcrs3 = gcrs.transform_to(ITRS).transform_to(CIRS).transform_to(ITRS).transform_to(gcrs)
 assert_allclose(gcrs.ra, gcrs3.ra)
 assert_allclose(gcrs.dec, gcrs3.dec)
 gcrs4 = gcrs.transform_to(ICRS).transform_to(CIRS).transform_to(ICRS).transform_to(gcrs)
 assert_allclose(gcrs.ra, gcrs4.ra)
 assert_allclose(gcrs.dec, gcrs4.dec)

def test_gcrs_cirs ( ) : ( ra , dec , _ ) = randomly_sample_sphere ( 200 ) gcrs = GCRS ( ra = ra , dec = dec , obstime = u'J2000' ) gcrs6 = GCRS ( ra = ra , dec = dec , obstime = u'J2006' ) gcrs2 = gcrs . transform_to ( CIRS ) . transform_to ( gcrs ) gcrs6_2 = gcrs6 . transform_to ( CIRS ) . transform_to ( gcrs ) assert_allclose ( gcrs . ra , gcrs2 . ra ) assert_allclose ( gcrs . dec , gcrs2 . dec ) assert ( not allclose ( gcrs . ra , gcrs6_2 . ra ) ) assert ( not allclose ( gcrs . dec , gcrs6_2 . dec ) ) gcrs3 = gcrs . transform_to ( ITRS ) . transform_to ( CIRS ) . transform_to ( ITRS ) . transform_to ( gcrs ) assert_allclose ( gcrs . ra , gcrs3 . ra ) assert_allclose ( gcrs . dec , gcrs3 . dec ) gcrs4 = gcrs . transform_to ( ICRS ) . transform_to ( CIRS ) . transform_to ( ICRS ) . transform_to ( gcrs ) assert_allclose ( gcrs . ra , gcrs4 . ra ) assert_allclose ( gcrs . dec , gcrs4 . dec )
check gcrs<->cirs transforms for round-tripping .