@pytest.mark.parametrize((u'fromsys', u'tosys', u'fromcoo', u'tocoo'), m31_params)
def test_m31_coord_transforms(fromsys, tosys, fromcoo, tocoo):
 from_origin = fromsys((fromcoo[0] * u.deg), (fromcoo[1] * u.deg), distance=m31_dist)
 from_pos = SkyOffsetFrame((1 * u.deg), (1 * u.deg), origin=from_origin)
 to_origin = tosys((tocoo[0] * u.deg), (tocoo[1] * u.deg), distance=m31_dist)
 to_astroframe = SkyOffsetFrame(origin=to_origin)
 target_pos = from_pos.transform_to(to_astroframe)
 assert_allclose(to_origin.separation(target_pos), np.hypot(from_pos.lon, from_pos.lat), atol=convert_precision)
 roundtrip_pos = target_pos.transform_to(from_pos)
 assert_allclose([roundtrip_pos.lon.wrap_at((180 * u.deg)), roundtrip_pos.lat], [(1.0 * u.deg), (1.0 * u.deg)], atol=convert_precision)

@ pytest . mark . parametrize ( ( u'fromsys' , u'tosys' , u'fromcoo' , u'tocoo' ) , m31_params ) def test_m31_coord_transforms ( fromsys , tosys , fromcoo , tocoo ) : from_origin = fromsys ( ( fromcoo [ 0 ] * u . deg ) , ( fromcoo [ 1 ] * u . deg ) , distance = m31_dist ) from_pos = SkyOffsetFrame ( ( 1 * u . deg ) , ( 1 * u . deg ) , origin = from_origin ) to_origin = tosys ( ( tocoo [ 0 ] * u . deg ) , ( tocoo [ 1 ] * u . deg ) , distance = m31_dist ) to_astroframe = SkyOffsetFrame ( origin = to_origin ) target_pos = from_pos . transform_to ( to_astroframe ) assert_allclose ( to_origin . separation ( target_pos ) , np . hypot ( from_pos . lon , from_pos . lat ) , atol = convert_precision ) roundtrip_pos = target_pos . transform_to ( from_pos ) assert_allclose ( [ roundtrip_pos . lon . wrap_at ( ( 180 * u . deg ) ) , roundtrip_pos . lat ] , [ ( 1.0 * u . deg ) , ( 1.0 * u . deg ) ] , atol = convert_precision )
this tests a variety of coordinate conversions for the chandra point-source catalog location of m31 from ned .