#NEWLINE# def motion( self , viewer , button , data_x , data_y , readout ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# value = viewer . get_data ( int ( ( data_x + 0.5 ) ) , int ( ( data_y + 0.5 ) ) ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# value = None #NEWLINE# #UNINDENT# ( fits_x , fits_y ) = ( ( data_x + 1 ) , ( data_y + 1 ) ) #NEWLINE# try : #NEWLINE# #INDENT# image = viewer . get_image ( ) #NEWLINE# if ( image is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# ( ra_txt , dec_txt ) = image . pixtoradec ( button , fits_y , format = 'str' , coords = 'fits' ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . logger . warning ( ( 'Bad coordinate conversion: %s' % str ( e ) ) ) #NEWLINE# ra_txt = 'BAD WCS' #NEWLINE# dec_txt = 'BAD WCS' #NEWLINE# #UNINDENT# text = ( 'RA: %s  DEC: %s  X: %.2f  Y: %.2f  Value: %s' % ( ra_txt , dec_txt , fits_x , fits_y , value ) ) #NEWLINE# readout . set_text ( text )