def test_cirs_to_altaz():
 from .. import EarthLocation
 (ra, dec, dist) = randomly_sample_sphere(200)
 cirs = CIRS(ra=ra, dec=dec, obstime=u'J2000')
 crepr = SphericalRepresentation(lon=ra, lat=dec, distance=dist)
 cirscart = CIRS(crepr, obstime=cirs.obstime, representation=CartesianRepresentation)
 loc = EarthLocation(lat=(0 * u.deg), lon=(0 * u.deg), height=(0 * u.m))
 altazframe = AltAz(location=loc, obstime=Time(u'J2005'))
 cirs2 = cirs.transform_to(altazframe).transform_to(cirs)
 cirs3 = cirscart.transform_to(altazframe).transform_to(cirs)
 assert_allclose(cirs.ra, cirs2.ra)
 assert_allclose(cirs.dec, cirs2.dec)
 assert_allclose(cirs.ra, cirs3.ra)
 assert_allclose(cirs.dec, cirs3.dec)

def test_cirs_to_altaz ( ) : from . . import EarthLocation ( ra , dec , dist ) = randomly_sample_sphere ( 200 ) cirs = CIRS ( ra = ra , dec = dec , obstime = u'J2000' ) crepr = SphericalRepresentation ( lon = ra , lat = dec , distance = dist ) cirscart = CIRS ( crepr , obstime = cirs . obstime , representation = CartesianRepresentation ) loc = EarthLocation ( lat = ( 0 * u . deg ) , lon = ( 0 * u . deg ) , height = ( 0 * u . m ) ) altazframe = AltAz ( location = loc , obstime = Time ( u'J2005' ) ) cirs2 = cirs . transform_to ( altazframe ) . transform_to ( cirs ) cirs3 = cirscart . transform_to ( altazframe ) . transform_to ( cirs ) assert_allclose ( cirs . ra , cirs2 . ra ) assert_allclose ( cirs . dec , cirs2 . dec ) assert_allclose ( cirs . ra , cirs3 . ra ) assert_allclose ( cirs . dec , cirs3 . dec )
check the basic cirs<->altaz transforms .