def test_table_to_coord():
 from ...table import Table, Column
 t = Table()
 t.add_column(Column(data=[1, 2, 3], name=u'ra', unit=u.deg))
 t.add_column(Column(data=[4, 5, 6], name=u'dec', unit=u.deg))
 c = SkyCoord(t[u'ra'], t[u'dec'])
 assert allclose(c.ra.to(u.deg), ([1, 2, 3] * u.deg))
 assert allclose(c.dec.to(u.deg), ([4, 5, 6] * u.deg))

def test_table_to_coord ( ) : from ... table import Table , Column t = Table ( ) t . add_column ( Column ( data = [ 1 , 2 , 3 ] , name = u'ra' , unit = u . deg ) ) t . add_column ( Column ( data = [ 4 , 5 , 6 ] , name = u'dec' , unit = u . deg ) ) c = SkyCoord ( t [ u'ra' ] , t [ u'dec' ] ) assert allclose ( c . ra . to ( u . deg ) , ( [ 1 , 2 , 3 ] * u . deg ) ) assert allclose ( c . dec . to ( u . deg ) , ( [ 4 , 5 , 6 ] * u . deg ) )
checks "end-to-end" use of table with skycoord - the quantity initializer is the intermediary that translate the table columns into something coordinates understands .