#NEWLINE# def pixtocoords( 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 ( not self . new_coords ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# fromclass = self . coord_table [ self . coordsys ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise WCSError ( ( "No such coordinate system available: '%s'" % self . coordsys ) ) #NEWLINE# #UNINDENT# coord = fromclass ( ra_deg , dec_deg , unit = ( units . degree , units . degree ) ) #NEWLINE# if ( ( system is None ) or ( system == self . coordsys ) ) : #NEWLINE# #INDENT# return coord #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# toclass = self . coord_table [ system ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise WCSError ( ( "No such coordinate system available: '%s'" % system ) ) #NEWLINE# #UNINDENT# coord = coord . transform_to ( toclass ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# frameClass = coordinates . frame_transform_graph . lookup_name ( self . coordsys ) #NEWLINE# coord = frameClass ( ( ra_deg * units . degree ) , ( dec_deg * units . degree ) ) #NEWLINE# toClass = coordinates . frame_transform_graph . lookup_name ( system ) #NEWLINE# if ( toClass != frameClass ) : #NEWLINE# #INDENT# coord = coord . transform_to ( toClass ) #NEWLINE# #UNINDENT# #UNINDENT# return coord