#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 = 'j2000' #NEWLINE# #UNINDENT# ( ra_deg , dec_deg ) = self . pixtoradec ( idxs , coords = coords ) #NEWLINE# self . logger . debug ( ( 'ra, dec = %f, %f' % ( ra_deg , dec_deg ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# fromsys = self . coordsys . upper ( ) #NEWLINE# if ( fromsys == 'PIXEL' ) : #NEWLINE# #INDENT# return ( ra_deg , dec_deg ) #NEWLINE# #UNINDENT# tosys = system . upper ( ) #NEWLINE# if ( fromsys == 'B1950' ) : #NEWLINE# #INDENT# equinox = 1950.0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# equinox = 2000.0 #NEWLINE# #UNINDENT# ( lon_deg , lat_deg ) = astCoords . convertCoords ( fromsys , tosys , ra_deg , dec_deg , equinox ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# raise WCSError ( ( "Error converting between coordinate systems '%s' and '%s': %s" % ( fromsys , tosys , str ( e ) ) ) ) #NEWLINE# #UNINDENT# return ( lon_deg , lat_deg )