def test_gcrs_altaz():
 from .. import EarthLocation
 (ra, dec, _) = randomly_sample_sphere(1)
 gcrs = GCRS(ra=ra[0], dec=dec[0], obstime=u'J2000')
 times = Time((np.linspace(2456293.25, 2456657.25, 51) * u.day), format=u'jd', scale=u'utc')
 loc = EarthLocation(lon=(10 * u.deg), lat=(80.0 * u.deg))
 aaframe = AltAz(obstime=times, location=loc)
 aa1 = gcrs.transform_to(aaframe)
 aa2 = gcrs.transform_to(ICRS).transform_to(CIRS).transform_to(aaframe)
 aa3 = gcrs.transform_to(ITRS).transform_to(CIRS).transform_to(aaframe)
 assert_allclose(aa1.alt, aa2.alt)
 assert_allclose(aa1.az, aa2.az)
 assert_allclose(aa1.alt, aa3.alt)
 assert_allclose(aa1.az, aa3.az)

def test_gcrs_altaz ( ) : from . . import EarthLocation ( ra , dec , _ ) = randomly_sample_sphere ( 1 ) gcrs = GCRS ( ra = ra [ 0 ] , dec = dec [ 0 ] , obstime = u'J2000' ) times = Time ( ( np . linspace ( 2456293.25 , 2456657.25 , 51 ) * u . day ) , format = u'jd' , scale = u'utc' ) loc = EarthLocation ( lon = ( 10 * u . deg ) , lat = ( 80.0 * u . deg ) ) aaframe = AltAz ( obstime = times , location = loc ) aa1 = gcrs . transform_to ( aaframe ) aa2 = gcrs . transform_to ( ICRS ) . transform_to ( CIRS ) . transform_to ( aaframe ) aa3 = gcrs . transform_to ( ITRS ) . transform_to ( CIRS ) . transform_to ( aaframe ) assert_allclose ( aa1 . alt , aa2 . alt ) assert_allclose ( aa1 . az , aa2 . az ) assert_allclose ( aa1 . alt , aa3 . alt ) assert_allclose ( aa1 . az , aa3 . az )
check gcrs<->altaz transforms for round-tripping .