def test_against_pyephem():
 obstime = Time(u'2011-09-18 08:50:00')
 location = EarthLocation(lon=Angle(u'-109d24m53.1s'), lat=Angle(u'33d41m46.0s'), height=(30000.0 * u.m))
 altaz_frame = AltAz(obstime=obstime, location=location, temperature=(15 * u.deg_C), pressure=(1.01 * u.bar))
 altaz = SkyCoord(u'6.8927d -60.7665d', frame=altaz_frame)
 radec_actual = altaz.transform_to(u'icrs')
 radec_expected = SkyCoord(u'196.497518d -4.569323d', frame=u'icrs')
 distance = radec_actual.separation(radec_expected).to(u'arcsec')
 assert (distance < (1000.0 * u.arcsec))
 radec_expected = SkyCoord(u'196.495372d -4.560694d', frame=u'icrs')
 distance = radec_actual.separation(radec_expected).to(u'arcsec')
 assert (distance < (1 * u.arcsec))

def test_against_pyephem ( ) : obstime = Time ( u'2011-09-18 08:50:00' ) location = EarthLocation ( lon = Angle ( u'-109d24m53.1s' ) , lat = Angle ( u'33d41m46.0s' ) , height = ( 30000.0 * u . m ) ) altaz_frame = AltAz ( obstime = obstime , location = location , temperature = ( 15 * u . deg_C ) , pressure = ( 1.01 * u . bar ) ) altaz = SkyCoord ( u'6.8927d -60.7665d' , frame = altaz_frame ) radec_actual = altaz . transform_to ( u'icrs' ) radec_expected = SkyCoord ( u'196.497518d -4.569323d' , frame = u'icrs' ) distance = radec_actual . separation ( radec_expected ) . to ( u'arcsec' ) assert ( distance < ( 1000.0 * u . arcsec ) ) radec_expected = SkyCoord ( u'196.495372d -4.560694d' , frame = u'icrs' ) distance = radec_actual . separation ( radec_expected ) . to ( u'arcsec' ) assert ( distance < ( 1 * u . arcsec ) )
check that astropy gives consistent results with one pyephem example .