def test_arraytransforms():
 ra = (np.ones((4,), dtype=float) * u.deg)
 dec = ((2 * np.ones((4,), dtype=float)) * u.deg)
 distance = (np.ones((4,), dtype=float) * u.au)
 test_icrs = ICRS(ra=ra, dec=dec, distance=distance)
 test_gcrs = GCRS(test_icrs.data)
 bary_arr = test_icrs.transform_to(BarycentricTrueEcliptic)
 assert (bary_arr.shape == ra.shape)
 helio_arr = test_icrs.transform_to(HeliocentricTrueEcliptic)
 assert (helio_arr.shape == ra.shape)
 geo_arr = test_gcrs.transform_to(GeocentricTrueEcliptic)
 assert (geo_arr.shape == ra.shape)
 bary_icrs = bary_arr.transform_to(ICRS)
 assert (bary_icrs.shape == test_icrs.shape)
 helio_icrs = helio_arr.transform_to(ICRS)
 assert (helio_icrs.shape == test_icrs.shape)
 geo_gcrs = geo_arr.transform_to(GCRS)
 assert (geo_gcrs.shape == test_gcrs.shape)

def test_arraytransforms ( ) : ra = ( np . ones ( ( 4 , ) , dtype = float ) * u . deg ) dec = ( ( 2 * np . ones ( ( 4 , ) , dtype = float ) ) * u . deg ) distance = ( np . ones ( ( 4 , ) , dtype = float ) * u . au ) test_icrs = ICRS ( ra = ra , dec = dec , distance = distance ) test_gcrs = GCRS ( test_icrs . data ) bary_arr = test_icrs . transform_to ( BarycentricTrueEcliptic ) assert ( bary_arr . shape == ra . shape ) helio_arr = test_icrs . transform_to ( HeliocentricTrueEcliptic ) assert ( helio_arr . shape == ra . shape ) geo_arr = test_gcrs . transform_to ( GeocentricTrueEcliptic ) assert ( geo_arr . shape == ra . shape ) bary_icrs = bary_arr . transform_to ( ICRS ) assert ( bary_icrs . shape == test_icrs . shape ) helio_icrs = helio_arr . transform_to ( ICRS ) assert ( helio_icrs . shape == test_icrs . shape ) geo_gcrs = geo_arr . transform_to ( GCRS ) assert ( geo_gcrs . shape == test_gcrs . shape )
test that transforms to/from ecliptic coordinates work on array coordinates .