#NEWLINE# def display( self , frame , width , height , reverse = False ) : #NEWLINE# #INDENT# '\n        NOTE: this is called from the IISRequestHandler\n        ' #NEWLINE# fb = self . get_frame ( frame ) #NEWLINE# self . current_frame = frame #NEWLINE# if reverse : #NEWLINE# #INDENT# fb . buffer . reverse ( ) #NEWLINE# #UNINDENT# chname = fb . chname #NEWLINE# if ( chname is None ) : #NEWLINE# #INDENT# chname = ( 'Frame%d' % ( frame + 1 ) ) #NEWLINE# fb . chname = chname #NEWLINE# #UNINDENT# self . logger . debug ( ( 'display to %s' % chname ) ) #NEWLINE# try : #NEWLINE# #INDENT# data = fb . buffer #NEWLINE# byteswap = False #NEWLINE# dims = ( fb . height , fb . width ) #NEWLINE# dtype = numpy . uint8 #NEWLINE# metadata = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# image = IRAF_AstroImage ( logger = self . logger ) #NEWLINE# data = numpy . fromstring ( fb . buffer , dtype = dtype ) #NEWLINE# data = data . reshape ( dims ) #NEWLINE# data = numpy . flipud ( data ) #NEWLINE# image . set_data ( data , metadata = metadata ) #NEWLINE# image . set ( ct = fb . ct ) #NEWLINE# fitsname = str ( time . time ( ) ) #NEWLINE# oldref = fb . ct . ref #NEWLINE# items = oldref . split ( '!' ) #NEWLINE# host = items [ 0 ] #NEWLINE# path = '!' . join ( items [ 1 : ] ) #NEWLINE# image . set ( name = fitsname , path = path , host = host ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# errmsg = ( "Error creating image data for '%s': %s" % ( chname , str ( e ) ) ) #NEWLINE# self . logger . error ( errmsg ) #NEWLINE# raise GingaPlugin . PluginError ( errmsg ) #NEWLINE# #UNINDENT# self . fv . gui_do ( self . _gui_display_image , fitsname , image , chname )