#NEWLINE# def spectral_coord( self , idxs , coords = 'data' ) : #NEWLINE# #INDENT# if ( coords == 'data' ) : #NEWLINE# #INDENT# idxs = numpy . array ( map ( ( lambda x : ( x + 1 ) ) , idxs ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# idxs = numpy . array ( idxs ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# arrs = [ [ idxs [ i ] ] for i in range ( len ( idxs ) ) ] #NEWLINE# res = self . wcs . tran ( arrs , 1 ) #NEWLINE# return arrs [ 2 ] [ 0 ] #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . logger . error ( ( 'Error calculating spectral coordinate: %s' % str ( e ) ) ) #NEWLINE# raise WCSError ( e )