#NEWLINE# def prof_leftup( self , event = None ) : #NEWLINE# #INDENT# if ( len ( self . map . shape ) != 2 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( self . rbbox is not None ) : #NEWLINE# #INDENT# zdc = wx . ClientDC ( self . panel . canvas ) #NEWLINE# zdc . SetLogicalFunction ( wx . XOR ) #NEWLINE# zdc . SetBrush ( wx . TRANSPARENT_BRUSH ) #NEWLINE# zdc . SetPen ( wx . Pen ( 'White' , 2 , wx . SOLID ) ) #NEWLINE# zdc . ResetBoundingBox ( ) #NEWLINE# if ( not is_wxPhoenix ) : #NEWLINE# #INDENT# zdc . BeginDrawing ( ) #NEWLINE# #UNINDENT# zdc . DrawLine ( * self . rbbox ) #NEWLINE# if ( not is_wxPhoenix ) : #NEWLINE# #INDENT# zdc . EndDrawing ( ) #NEWLINE# #UNINDENT# self . rbbox = None #NEWLINE# #UNINDENT# if ( ( self . zoom_ini is None ) or ( self . lastpoint [ 0 ] is None ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# x0 = int ( self . zoom_ini [ 2 ] ) #NEWLINE# x1 = int ( self . lastpoint [ 0 ] ) #NEWLINE# y0 = int ( self . zoom_ini [ 3 ] ) #NEWLINE# y1 = int ( self . lastpoint [ 1 ] ) #NEWLINE# ( dx , dy ) = ( abs ( ( x1 - x0 ) ) , abs ( ( y1 - y0 ) ) ) #NEWLINE# ( self . lastpoint , self . zoom_ini ) = ( [ None , None ] , None ) #NEWLINE# if ( ( dx < 2 ) and ( dy < 2 ) ) : #NEWLINE# #INDENT# self . zoom_ini = None #NEWLINE# return #NEWLINE# #UNINDENT# outdat = [ ] #NEWLINE# if ( dy > dx ) : #NEWLINE# #INDENT# _y0 = min ( int ( y0 ) , int ( ( y1 + 0.5 ) ) ) #NEWLINE# _y1 = max ( int ( y0 ) , int ( ( y1 + 0.5 ) ) ) #NEWLINE# for iy in range ( _y0 , _y1 ) : #NEWLINE# #INDENT# ix = int ( ( x0 + ( ( ( iy - int ( y0 ) ) * ( x1 - x0 ) ) / ( y1 - y0 ) ) ) ) #NEWLINE# outdat . append ( ( ix , iy ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# _x0 = min ( int ( x0 ) , int ( ( x1 + 0.5 ) ) ) #NEWLINE# _x1 = max ( int ( x0 ) , int ( ( x1 + 0.5 ) ) ) #NEWLINE# for ix in range ( _x0 , _x1 ) : #NEWLINE# #INDENT# iy = int ( ( y0 + ( ( ( ix - int ( x0 ) ) * ( y1 - y0 ) ) / ( x1 - x0 ) ) ) ) #NEWLINE# outdat . append ( ( ix , iy ) ) #NEWLINE# #UNINDENT# #UNINDENT# ( x , y , z ) = ( [ ] , [ ] , [ ] ) #NEWLINE# for ( ix , iy ) in outdat : #NEWLINE# #INDENT# x . append ( ix ) #NEWLINE# y . append ( iy ) #NEWLINE# z . append ( self . panel . conf . data [ ( iy , ix ) ] ) #NEWLINE# #UNINDENT# self . prof_dat = ( ( dy > dx ) , outdat ) #NEWLINE# if ( self . prof_plotter is not None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . prof_plotter . Raise ( ) #NEWLINE# self . prof_plotter . clear ( ) #NEWLINE# #UNINDENT# except ( AttributeError , PyDeadObjectError ) : #NEWLINE# #INDENT# self . prof_plotter = None #NEWLINE# #UNINDENT# #UNINDENT# if ( self . prof_plotter is None ) : #NEWLINE# #INDENT# self . prof_plotter = PlotFrame ( self , title = 'Profile' ) #NEWLINE# self . prof_plotter . panel . report_leftdown = self . prof_report_coords #NEWLINE# #UNINDENT# ( xlabel , y2label ) = ( 'Pixel (x)' , 'Pixel (y)' ) #NEWLINE# if ( dy > dx ) : #NEWLINE# #INDENT# ( x , y ) = ( y , x ) #NEWLINE# ( xlabel , y2label ) = ( y2label , xlabel ) #NEWLINE# #UNINDENT# self . prof_plotter . panel . clear ( ) #NEWLINE# if ( len ( self . title ) < 1 ) : #NEWLINE# #INDENT# self . title = os . path . split ( self . xrmfile . filename ) [ 1 ] #NEWLINE# #UNINDENT# opts = dict ( linewidth = 2 , marker = '+' , markersize = 3 , show_legend = True , xlabel = xlabel ) #NEWLINE# self . prof_plotter . plot ( x , z , title = self . title , color = 'blue' , zorder = 20 , xmin = ( min ( x ) - 3 ) , xmax = ( max ( x ) + 3 ) , ylabel = 'counts' , label = 'counts' , ** opts ) #NEWLINE# self . prof_plotter . oplot ( x , y , y2label = y2label , label = y2label , zorder = 3 , side = 'right' , color = '#771111' , ** opts ) #NEWLINE# self . prof_plotter . panel . unzoom_all ( ) #NEWLINE# self . prof_plotter . Show ( ) #NEWLINE# self . zoom_ini = None #NEWLINE# self . zoom_mode . SetSelection ( 0 ) #NEWLINE# self . panel . cursor_mode = 'zoom'