#NEWLINE# def pixtosystem( self , idxs , system = None , coords = 'data' ) : #NEWLINE# #INDENT# if ( self . coordsys == 'raw' ) : #NEWLINE# #INDENT# raise WCSError ( 'No usable WCS' ) #NEWLINE# #UNINDENT# if ( system is None ) : #NEWLINE# #INDENT# system = 'icrs' #NEWLINE# #UNINDENT# ( ra_deg , dec_deg ) = self . pixtoradec ( idxs , coords = coords ) #NEWLINE# self . logger . debug ( ( 'ra, dec = %f, %f' % ( ra_deg , dec_deg ) ) ) #NEWLINE# if ( self . coordsys == 'pixel' ) : #NEWLINE# #INDENT# return ( ra_deg , toframe ) #NEWLINE# #UNINDENT# refframe = self . icrs_trans . getframe ( 2 ) #NEWLINE# toframe = Ast . SkyFrame ( ( 'System=%s, Epoch=2000.0' % system . upper ( ) ) ) #NEWLINE# end_trans = refframe . convert ( toframe ) #NEWLINE# ( ra_rad , dec_rad ) = ( math . radians ( ra_deg ) , math . radians ( dec_deg ) ) #NEWLINE# res = end_trans . tran ( [ [ ra_rad ] , [ dec_rad ] ] , 1 ) #NEWLINE# ( lon_rad , lat_rad ) = ( res [ 0 ] [ 0 ] , res [ 1 ] [ 0 ] ) #NEWLINE# ( lon_deg , lat_deg ) = ( math . degrees ( lon_rad ) , math . degrees ( lat_rad ) ) #NEWLINE# return ( lon_deg , lat_deg )