Ignore:
Timestamp:
Jun 3, 2010 11:36:56 AM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
d7a39e5
Parents:
83f4445
Message:

working on documentation

Location:
guiframe/local_perspectives/plotting
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/Edge.py

    r0d9dae8 rd955bf19  
    1212class RadiusInteractor(_BaseInteractor): 
    1313    """ 
    14          Select an annulus through a 2D plot 
     14    Select an annulus through a 2D plot 
    1515    """ 
    1616    def __init__(self,base,axes,color='black', zorder=5, arc1=None,arc2=None, 
     
    4949         
    5050    def set_layer(self, n): 
     51        """ 
     52        """ 
    5153        self.layernum = n 
    5254        self.update() 
    5355         
    5456    def clear(self): 
     57        """ 
     58        """ 
    5559        self.clear_markers() 
    5660        try: 
     
    6165            for item in range(len(self.axes.lines)): 
    6266                del self.axes.lines[0] 
    63          
    64          
    65          
     67     
    6668    def get_angle(self): 
     69        """ 
     70        """ 
    6771        return self.theta 
    6872         
     
    7175        Draw the new roughness on the graph. 
    7276        """ 
    73         if r1 !=None: 
    74             self.r1=r1 
    75         if r2!=None: 
    76             self.r2=r2 
     77        if r1 != None: 
     78            self.r1 = r1 
     79        if r2 != None: 
     80            self.r2 = r2 
    7781        if theta !=None: 
    7882            self.theta= theta 
    7983        
    80         print "in the edge r1, r2",self.r1,self.r2,math.degrees(self.theta) 
     84        #print "in the edge r1, r2",self.r1,self.r2,math.degrees(self.theta) 
    8185        x1= self.r1*math.cos(self.theta) 
    8286        y1= self.r1*math.sin(self.theta) 
     
    97101    
    98102    def moveend(self, ev): 
     103        """ 
     104        """ 
    99105        self.has_move= False 
    100106        self.base.moveend(ev) 
     
    110116        Process move to a new position, making sure that the move is allowed. 
    111117        """ 
    112          
    113118        self.theta= math.atan2(y,x) 
    114119        self.has_move= True 
    115              
    116120        self.base.base.update() 
    117121         
    118122    def set_cursor(self,r_min, r_max, theta): 
     123        """ 
     124        """ 
    119125        self.theta= theta 
    120126        self.r1= r_min 
     
    122128        self.update() 
    123129         
    124          
    125130    def get_params(self): 
     131        """ 
     132        """ 
    126133        params = {} 
    127134        params["radius1"] = self.r1 
     
    131138     
    132139    def set_params(self, params): 
    133         print "when here set curcor arc" 
    134  
     140        """ 
     141        """ 
     142        #print "when here set curcor arc" 
    135143        x1 = params["radius1"]  
    136144        x2 = params["radius2"]  
  • guiframe/local_perspectives/plotting/Plotter1D.py

    r0b57a57 rd955bf19  
    1 """ 
    2 This software was developed by the University of Tennessee as part of the 
    3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    4 project funded by the US National Science Foundation.  
    5  
    6 See the license text in license.txt 
    7  
    8 copyright 2008, University of Tennessee 
    9 """ 
     1 
     2################################################################################ 
     3#This software was developed by the University of Tennessee as part of the 
     4#Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5#project funded by the US National Science Foundation.  
     6# 
     7#See the license text in license.txt 
     8# 
     9#copyright 2008, University of Tennessee 
     10################################################################################ 
    1011 
    1112 
     
    3940class ModelPanel1D(PlotPanel): 
    4041    """ 
    41         Plot panel for use with the GUI manager 
     42    Plot panel for use with the GUI manager 
    4243    """ 
    4344     
     
    5556        dpi = None, style = wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs): 
    5657        """ 
    57             Initialize the panel 
     58        Initialize the panel 
    5859        """ 
    5960        PlotPanel.__init__(self, parent, id = id, style = style, **kwargs) 
     
    8283    def _reset(self): 
    8384        """ 
    84             Resets internal data and graph 
     85        Resets internal data and graph 
    8586        """     
    8687        self.graph.reset() 
     
    9091    def _onEVT_1DREPLOT(self, event): 
    9192        """ 
    92             Data is ready to be displayed 
    93             @param event: data event 
    94         """ 
    95         
     93        Data is ready to be displayed 
     94         
     95        :param event: data event 
     96         
     97        """ 
    9698        #TODO: Check for existence of plot attribute 
    9799        # Check whether this is a replot. If we ask for a replot 
     
    159161    def onLeftDown(self,event):  
    160162        """  
    161             left button down and ready to drag 
    162             Display the position of the mouse on the statusbar 
     163        left button down and ready to drag 
     164        Display the position of the mouse on the statusbar 
    163165        """ 
    164166        PlotPanel.onLeftDown(self, event) 
     
    173175    def _onRemove(self, event): 
    174176        """ 
    175             Remove a plottable from the graph and render the graph  
    176             @param event: Menu event 
     177        Remove a plottable from the graph and render the graph  
     178         
     179        :param event: Menu event 
     180         
    177181        """ 
    178182        ## Check if there is a selected graph to remove 
     
    190194            self.subplot.figure.canvas.draw_idle()     
    191195            
    192              
    193  
    194196    def onContextMenu(self, event): 
    195197        """ 
    196             1D plot context menu 
    197             @param event: wx context event 
     198        1D plot context menu 
     199         
     200        :param event: wx context event 
     201         
    198202        """ 
    199203        slicerpop = PanelMenu() 
     
    248252        if self.graph.selected_plottable in self.plots: 
    249253            selected_plot= self.plots[self.graph.selected_plottable] 
    250             #if self.plots[self.graph.selected_plottable].name in self.err_dy.iterkeys()\ 
    251             #    and self.errors_hide: 
    252             """ 
    253             if selected_plot.__class__.__name__=="Data1D": 
    254                 if numpy.all(selected_plot.dy==0): 
    255                     id = wx.NewId() 
    256                     slicerpop.Append(id, '&Show errors') 
    257                     wx.EVT_MENU(self, id, self._on_add_errors) 
    258                 elif selected_plot.dy !=None and selected_plot.dy != []: 
    259                     id = wx.NewId() 
    260                     slicerpop.Append(id, '&Hide Error bars') 
    261                     wx.EVT_MENU(self, id, self._on_remove_errors) 
    262             """ 
     254            
    263255            id = wx.NewId() 
    264256            slicerpop.Append(id, '&Linear fit') 
     
    282274    def _on_remove_errors(self, evt): 
    283275        """ 
    284             Save name and dy of data in dictionary self.err_dy 
    285             Create a new data1D with the same x, y 
    286             vector and dy with zeros. 
    287             post self.err_dy as event (ErrorDataEvent) for any object 
    288             which wants to reconstruct the initial data. 
    289             @param evt: Menu event 
     276        Save name and dy of data in dictionary self.err_dy 
     277        Create a new data1D with the same x, y 
     278        vector and dy with zeros. 
     279        post self.err_dy as event (ErrorDataEvent) for any object 
     280        which wants to reconstruct the initial data. 
     281         
     282        :param evt: Menu event 
     283         
    290284        """ 
    291285        if not self.graph.selected_plottable == None: 
     
    296290            ## Create a new dy for a new plottable 
    297291            import numpy 
    298             dy= numpy.zeros(len(self.plots[self.graph.selected_plottable].y)) 
    299             selected_plot= self.plots[self.graph.selected_plottable] 
     292            dy = numpy.zeros(len(self.plots[self.graph.selected_plottable].y)) 
     293            selected_plot = self.plots[self.graph.selected_plottable] 
    300294             
    301295            if selected_plot.__class__.__name__=="Data1D": 
     
    348342            event = ErrorDataEvent(err_dy=self.err_dy) 
    349343            wx.PostEvent(self.parent, event) 
    350      
    351      
     344 
    352345    def _on_add_errors(self, evt): 
    353346        """ 
    354             create a new data1D witht the errors saved in self.err_dy 
    355             to show errors of the plot. 
    356             Compute reasonable errors for a data set without  
    357             errors and transorm the plottable to a Data1D 
    358             @param evt: Menu event 
    359         """ 
    360         
    361          
     347        create a new data1D witht the errors saved in self.err_dy 
     348        to show errors of the plot. 
     349        Compute reasonable errors for a data set without  
     350        errors and transorm the plottable to a Data1D 
     351         
     352        :param evt: Menu event 
     353         
     354        """ 
    362355        if not self.graph.selected_plottable == None \ 
    363356            and self.graph.selected_plottable in self.plots.keys(): 
     
    434427    def _onsaveTXT(self, path): 
    435428        """ 
    436             Save file as txt 
    437              
    438             TODO: Refactor and remove this method. See TODO in _onSave. 
     429        Save file as txt 
     430             
     431        :TODO: Refactor and remove this method. See TODO in _onSave. 
     432         
    439433        """ 
    440434        data = self.plots[self.graph.selected_plottable] 
     
    477471    def _onSave(self, evt): 
    478472        """ 
    479             Save a data set to a text file 
    480             @param evt: Menu event 
    481         """ 
    482         
     473        Save a data set to a text file 
     474         
     475        :param evt: Menu event 
     476         
     477        """ 
    483478        id = str(evt.GetId()) 
    484479        if id in self.action_ids:          
     
    513508                    pass     
    514509            dlg.Destroy() 
    515              
    516              
    517      
    518              
    519             
    520      
    521      
    522      
    523         
  • guiframe/local_perspectives/plotting/Plotter2D.py

    r88ca6db rd955bf19  
    1 """ 
    2 This software was developed by the University of Tennessee as part of the 
    3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    4 project funded by the US National Science Foundation.  
    5  
    6 See the license text in license.txt 
    7  
    8 copyright 2008, University of Tennessee 
    9 """ 
     1 
     2################################################################################ 
     3#This software was developed by the University of Tennessee as part of the 
     4#Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5#project funded by the US National Science Foundation.  
     6# 
     7#See the license text in license.txt 
     8# 
     9#copyright 2008, University of Tennessee 
     10################################################################################ 
    1011 
    1112 
     
    3435BIN_WIDTH = 1.0 
    3536from danse.common.plottools.toolbar import NavigationToolBar 
     37 
    3638class NavigationToolBar2D(NavigationToolBar): 
     39    """ 
     40    """ 
    3741    def __init__(self, canvas, parent=None): 
    3842        NavigationToolBar.__init__(self, canvas=canvas, parent=parent) 
     
    4044    def delete_option(self): 
    4145        """ 
    42             remove default toolbar item 
     46        remove default toolbar item 
    4347        """ 
    4448        #delete reset button 
     
    5155    def add_option(self): 
    5256        """ 
    53             add item to the toolbar 
     57        add item to the toolbar 
    5458        """ 
    5559        #add print button 
     
    6165         
    6266         
    63  
    6467class ModelPanel2D(ModelPanel1D): 
    6568    """ 
    66         Plot panel for use with the GUI manager 
     69    Plot panel for use with the GUI manager 
    6770    """ 
    6871     
     
    8184        dpi = None, style = wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs): 
    8285        """ 
    83             Initialize the panel 
     86        Initialize the panel 
    8487        """ 
    8588        ModelPanel1D.__init__(self, parent, id = id, style = style, **kwargs) 
     
    121124    def add_toolbar(self): 
    122125        """ 
    123             add toolbar 
     126        add toolbar 
    124127        """ 
    125128        self.enable_toolbar = True 
     
    141144    def _onEVT_1DREPLOT(self, event): 
    142145        """ 
    143             Data is ready to be displayed 
    144              
    145             #TODO: this name should be changed to something more appropriate 
    146             # Don't forget that changing this name will mean changing code 
    147             # in plotting.py 
    148               
    149             @param event: data event 
     146        Data is ready to be displayed 
     147         
     148        :TODO: this name should be changed to something more appropriate 
     149            Don't forget that changing this name will mean changing code 
     150            in plotting.py 
     151          
     152        :param event: data event 
    150153        """ 
    151154        ## Update self.data2d with the current plot 
     
    224227    def onContextMenu(self, event): 
    225228        """ 
    226             2D plot context menu 
    227             @param event: wx context event 
    228         """ 
    229          
     229        2D plot context menu 
     230         
     231        :param event: wx context event 
     232         
     233        """ 
    230234        slicerpop = PanelMenu() 
    231235        slicerpop.set_plots(self.plots) 
     
    313317    def _onEditDetector(self, event): 
    314318        """ 
    315             Allow to view and edits  detector parameters 
    316             @param event: wx.menu event 
     319        Allow to view and edits  detector parameters 
     320         
     321        :param event: wx.menu event 
     322         
    317323        """ 
    318324         
     
    359365   
    360366    def freeze_axes(self): 
     367        """ 
     368        """ 
    361369        self.axes_frozen = True 
    362370         
    363371    def thaw_axes(self): 
     372        """ 
     373        """ 
    364374        self.axes_frozen = False 
    365375         
    366376    def onMouseMotion(self,event): 
     377        """ 
     378        """ 
    367379        pass 
     380     
    368381    def onWheel(self, event): 
     382        """ 
     383        """ 
    369384        pass   
    370385       
    371386    def update(self, draw=True): 
    372387        """ 
    373             Respond to changes in the model by recalculating the  
    374             profiles and resetting the widgets. 
     388        Respond to changes in the model by recalculating the  
     389        profiles and resetting the widgets. 
    375390        """ 
    376391        self.draw() 
    377392         
    378          
    379393    def _getEmptySlicerEvent(self): 
    380394        """ 
    381             create an empty slicervent  
     395        create an empty slicervent  
    382396        """ 
    383397        return SlicerEvent(type=None, 
    384398                           params=None, 
    385399                           obj_class=None) 
     400         
    386401    def _onEVT_INTERNAL(self, event): 
    387402        """ 
    388             Draw the slicer 
    389             @param event: wx.lib.newevent (SlicerEvent) containing slicer 
     403        Draw the slicer 
     404         
     405        :param event: wx.lib.newevent (SlicerEvent) containing slicer 
    390406            parameter 
     407             
    391408        """ 
    392409        self._setSlicer(event.slicer) 
     
    394411    def _setSlicer(self, slicer): 
    395412        """ 
    396             Clear the previous slicer and create a new one.Post an internal 
    397             event. 
    398             @param slicer: slicer class to create 
     413        Clear the previous slicer and create a new one.Post an internal 
     414        event. 
     415         
     416        :param slicer: slicer class to create 
     417         
    399418        """ 
    400419         
     
    423442    def onCircular(self, event): 
    424443        """ 
    425             perform circular averaging on Data2D 
    426             @param event: wx.menu event 
     444        perform circular averaging on Data2D 
     445         
     446        :param event: wx.menu event 
     447         
    427448        """ 
    428449         
     
    462483        new_plot.id = "Circ avg "+ self.data2D.name 
    463484        new_plot.is_data= True 
    464          
    465485        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=new_plot.name)) 
    466486        
    467         
    468487    def _onEditSlicer(self, event): 
    469488        """ 
    470             Is available only when a slicer is drawn.Create a dialog  
    471             window where the user can enter value to reset slicer 
    472             parameters. 
    473             @param event: wx.menu event 
     489        Is available only when a slicer is drawn.Create a dialog  
     490        window where the user can enter value to reset slicer 
     491        parameters. 
     492         
     493        :param event: wx.menu event 
     494         
    474495        """ 
    475496        if self.slicer !=None: 
     
    481502                dialog.Destroy()  
    482503         
    483          
    484504    def onSectorQ(self, event): 
    485505        """ 
    486             Perform sector averaging on Q and draw sector slicer 
     506        Perform sector averaging on Q and draw sector slicer 
    487507        """ 
    488508        from SectorSlicer import SectorInteractor 
     
    492512    def onSectorPhi(self, event): 
    493513        """ 
    494             Perform sector averaging on Phi and draw annulus slicer 
     514        Perform sector averaging on Phi and draw annulus slicer 
    495515        """ 
    496516        from AnnulusSlicer import AnnulusInteractor 
     
    498518        wx.PostEvent(self, InternalEvent(slicer= AnnulusInteractor)) 
    499519         
    500     def onBoxSum(self,event): 
     520    def onBoxSum(self, event): 
     521        """ 
     522        """ 
    501523        from boxSum import BoxSum 
    502524        self.onClearSlicer(event) 
     
    530552                                                    main_panel =self)) 
    531553 
    532          
    533554    def onBoxavgX(self,event): 
    534555        """ 
    535             Perform 2D data averaging on Qx 
    536             Create a new slicer . 
    537             @param event: wx.menu event 
     556        Perform 2D data averaging on Qx 
     557        Create a new slicer . 
     558         
     559        :param event: wx.menu event 
    538560        """ 
    539561        from boxSlicer import BoxInteractorX 
     
    541563        wx.PostEvent(self, InternalEvent(slicer= BoxInteractorX)) 
    542564        
    543         
    544565    def onBoxavgY(self,event): 
    545566        """ 
    546             Perform 2D data averaging on Qy 
    547             Create a new slicer . 
    548             @param event: wx.menu event 
     567        Perform 2D data averaging on Qy 
     568        Create a new slicer . 
     569         
     570        :param event: wx.menu event 
     571         
    549572        """ 
    550573        from boxSlicer import BoxInteractorY 
     
    552575        wx.PostEvent(self, InternalEvent(slicer= BoxInteractorY)) 
    553576         
    554          
    555577    def onClearSlicer(self, event): 
    556578        """ 
    557             Clear the slicer on the plot 
     579        Clear the slicer on the plot 
    558580        """ 
    559581        if not self.slicer==None: 
  • guiframe/local_perspectives/plotting/SectorSlicer.py

    r08ece0b rd955bf19  
    1 #TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it 
    2 #      before pushing a new 1D data update. 
    3  
    4 # 
    5 #TODO: NEED MAJOR REFACTOR 
    6 # 
    7  
    8  
    9 # Debug printout 
     1 
    102import math 
    113import wx 
     
    2012class SectorInteractor(_BaseInteractor): 
    2113    """ 
    22          Draw a sector slicer.Allow to performQ averaging on data 2D 
     14    Draw a sector slicer.Allow to performQ averaging on data 2D 
    2315    """ 
    2416    def __init__(self,base,axes,color='black', zorder=3): 
     
    6860    def _onEVT_SLICER_PARS(self, event): 
    6961        """ 
    70             receive an event containing parameters values to reset the slicer 
    71             @param event: event of type SlicerParameterEvent with params as  
    72             attribute 
     62        receive an event containing parameters values to reset the slicer 
     63         
     64        :param event: event of type SlicerParameterEvent with params as  
     65        attribute 
     66         
    7367        """ 
    7468        wx.PostEvent(self.base.parent, StatusEvent(status="SectorSlicer._onEVT_SLICER_PARS")) 
     
    7771            self.set_params(event.params) 
    7872            self.base.update() 
    79  
    80  
     73             
    8174    def set_layer(self, n): 
    8275        """ 
    83              Allow adding plot to the same panel 
    84              @param n: the number of layer 
     76         Allow adding plot to the same panel 
     77          
     78        :param n: the number of layer 
     79         
    8580        """ 
    8681        self.layernum = n 
    8782        self.update() 
    8883         
    89          
    9084    def clear(self): 
    9185        """ 
    92             Clear the slicer and all connected events related to this slicer 
     86        Clear the slicer and all connected events related to this slicer 
    9387        """ 
    9488        self.clear_markers() 
     
    9993        self.base.Unbind(EVT_SLICER_PARS) 
    10094         
    101          
    10295    def update(self): 
    10396        """ 
    104             Respond to changes in the model by recalculating the profiles and 
    105             resetting the widgets. 
     97        Respond to changes in the model by recalculating the profiles and 
     98        resetting the widgets. 
    10699        """ 
    107100        # Update locations   
     
    128121            self.left_line.update( phi=self.right_line.phi, delta=None, 
    129122                                    mline=self.main_line, side=True, left=False ) 
    130  
    131  
     123             
    132124    def save(self, ev): 
    133125        """ 
     
    142134    def _post_data(self, nbins=None): 
    143135        """ 
    144             compute sector averaging of data2D into data1D 
    145             @param nbins: the number of point to plot for the average 1D data 
     136        compute sector averaging of data2D into data1D 
     137         
     138        :param nbins: the number of point to plot for the average 1D data 
    146139        """ 
    147140        ## get the data2D to average 
     
    190183        new_plot.is_data= True 
    191184        wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, 
    192                                                  title="SectorQ"+self.base.data2D.name )) 
    193          
    194           
     185                                    title="SectorQ"+self.base.data2D.name )) 
    195186         
    196187    def moveend(self, ev): 
    197188        """ 
    198             Called a dragging motion ends.Get slicer event  
     189        Called a dragging motion ends.Get slicer event  
    199190        """ 
    200191        self.base.thaw_axes() 
     
    205196        ## Send slicer paramers to plotter2D 
    206197        wx.PostEvent(self.base, event) 
    207         #self._post_data() 
    208              
    209              
     198         
    210199    def restore(self): 
    211200        """ 
     
    222211        pass 
    223212         
    224          
    225213    def set_cursor(self, x, y): 
     214        """ 
     215        """ 
    226216        pass 
    227217         
    228          
    229218    def get_params(self): 
    230219        """ 
    231             Store a copy of values of parameters of the slicer into a dictionary. 
    232             @return params: the dictionary created 
     220        Store a copy of values of parameters of the slicer into a dictionary. 
     221         
     222        :return params: the dictionary created 
     223         
    233224        """ 
    234225        params = {} 
     
    243234        return params 
    244235     
    245      
    246236    def set_params(self, params): 
    247237        """ 
    248             Receive a dictionary and reset the slicer with values contained  
    249             in the values of the dictionary. 
    250             @param params: a dictionary containing name of slicer parameters and  
     238        Receive a dictionary and reset the slicer with values contained  
     239        in the values of the dictionary. 
     240         
     241        :param params: a dictionary containing name of slicer parameters and  
    251242            values the user assigned to the slicer. 
    252243        """ 
     
    263254        self._post_data(nbins=self.nbins) 
    264255         
    265          
    266256    def freeze_axes(self): 
     257        """ 
     258        """ 
    267259        self.base.freeze_axes() 
    268          
    269          
     260     
    270261    def thaw_axes(self): 
     262        """ 
     263        """ 
    271264        self.base.thaw_axes() 
    272265 
    273  
    274266    def draw(self): 
     267        """ 
     268        """ 
    275269        self.base.draw() 
    276270 
     
    278272class SideInteractor(_BaseInteractor): 
    279273    """ 
    280         Draw an oblique line 
    281         @param phi: the phase between the middle line and one side line 
    282         @param theta2: the angle between the middle line and x- axis 
     274    Draw an oblique line 
     275     
     276    :param phi: the phase between the middle line and one side line 
     277    :param theta2: the angle between the middle line and x- axis 
     278     
    283279    """ 
    284280    def __init__(self,base,axes,color='black', zorder=5, r=1.0,phi=math.pi/4, theta2= math.pi/3): 
     
    335331        self.connect_markers([self.inner_marker, self.line]) 
    336332        
    337  
    338333    def set_layer(self, n): 
    339334        """ 
    340              Allow adding plot to the same panel 
    341              @param n: the number of layer 
     335        Allow adding plot to the same panel 
     336          
     337        :param n: the number of layer 
     338         
    342339        """ 
    343340        self.layernum = n 
     
    346343    def clear(self): 
    347344        """ 
    348             Clear the slicer and all connected events related to this slicer 
     345        Clear the slicer and all connected events related to this slicer 
    349346        """ 
    350347        self.clear_markers() 
     
    356353            for item in range(len(self.axes.lines)): 
    357354                del self.axes.lines[0] 
    358          
    359          
     355     
    360356    def update(self, phi=None, delta=None, mline=None, 
    361357               side=False, left= False, right=False): 
    362358        """ 
    363             Draw oblique line 
    364             @param phi: the phase between the middle line and the current line 
    365             @param delta: phi/2 applied only when the mline was moved 
     359        Draw oblique line 
     360         
     361        :param phi: the phase between the middle line and the current line 
     362        :param delta: phi/2 applied only when the mline was moved 
     363         
    366364        """ 
    367365        #print "update left or right ", self.has_move 
     
    372370        if delta==None: 
    373371            delta = 0 
    374  
    375372        if  right: 
    376373            self.phi = -1*math.fabs(self.phi) 
     
    391388            theta3=self.theta2+delta 
    392389         
    393        
    394390        x1= self.radius*math.cos(theta3) 
    395391        y1= self.radius*math.sin(theta3) 
     
    400396        self.line.set(xdata=[x1,x2], ydata=[y1,y2])   
    401397         
    402         
    403          
    404          
    405398    def save(self, ev): 
    406399        """ 
     
    412405 
    413406    def moveend(self, ev): 
    414          
     407        """ 
     408        """ 
    415409        self.has_move=False 
    416410        self.base.moveend(ev) 
     
    426420        Process move to a new position, making sure that the move is allowed. 
    427421        """ 
    428          
    429422        self.theta= math.atan2(y,x) 
    430423        self.has_move=True 
     
    470463        if self.phi>math.pi: 
    471464            self.phi= 2*math.pi-math.fabs(self.theta2 - self.theta) 
    472          
    473         #print "move , self.phi, self.theta,", self.theta*180/math.pi,self.theta2*180/math.pi,self.phi*180/math.pi 
    474         
    475              
    476          
     465 
    477466        self.base.base.update() 
    478467         
    479468    def set_cursor(self, x, y): 
     469        """ 
     470        """ 
    480471        self.move(x, y, None) 
    481472        self.update() 
    482          
    483          
     473     
    484474    def get_params(self): 
     475        """ 
     476        """ 
    485477        params = {} 
    486478        params["radius"] = self.radius 
     
    489481     
    490482    def set_params(self, params): 
    491  
     483        """ 
     484        """ 
    492485        x = params["radius"]  
    493486        self.set_cursor(x, self._inner_mouse_y) 
    494487         
    495   
    496          
     488 
    497489class LineInteractor(_BaseInteractor): 
    498490    """ 
    499          Select an annulus through a 2D plot 
     491    Select an annulus through a 2D plot 
    500492    """ 
    501493    def __init__(self,base,axes,color='black', zorder=5, r=1.0,theta=math.pi/4): 
    502          
     494        """ 
     495        """ 
    503496        _BaseInteractor.__init__(self, base, axes, color=color) 
     497         
    504498        self.markers = [] 
    505499        self.axes = axes 
    506          
    507500        self.save_theta = theta  
    508501        self.theta= theta 
    509          
    510502        self.radius = r 
    511        
    512503        self.scale = 10.0 
    513        
    514         #raise "Version error", message 
    515              
    516504        # Inner circle 
    517505        x1= self.radius*math.cos(self.theta) 
     
    536524            message += "Get the SVN version that is at least as recent as June 1, 2007" 
    537525             
    538         
    539526        self.line = self.axes.plot([x1,x2],[y1,y2], 
    540527                                      linestyle='-', marker='', 
    541528                                      color=self.color, 
    542529                                      visible=True)[0] 
    543        
    544530        self.npts = 20 
    545531        self.has_move=False 
     
    548534 
    549535    def set_layer(self, n): 
     536        """ 
     537        """ 
    550538        self.layernum = n 
    551539        self.update() 
    552540         
    553541    def clear(self): 
     542        """ 
     543        """ 
    554544        self.clear_markers() 
    555545        try: 
     
    561551                del self.axes.lines[0] 
    562552   
    563    
    564553    def update(self, theta=None): 
    565554        """ 
     
    576565        self.inner_marker.set(xdata=[x1/2.5],ydata=[y1/2.5]) 
    577566        self.line.set(xdata=[x1,x2], ydata=[y1,y2])   
    578       
    579          
    580          
     567     
    581568    def save(self, ev): 
    582569        """ 
     
    588575 
    589576    def moveend(self, ev): 
    590          
     577        """ 
     578        """ 
    591579        self.has_move=False 
    592580        self.base.moveend(ev) 
     
    602590        Process move to a new position, making sure that the move is allowed. 
    603591        """ 
    604          
    605592        self.theta= math.atan2(y,x) 
    606         #print "main_line previous theta --- next theta ",math.degrees(self.save_theta),math.degrees(self.theta) 
    607          
    608593        self.has_move=True 
    609          
    610594        self.base.base.update() 
    611595         
    612596    def set_cursor(self, x, y): 
     597        """ 
     598        """ 
    613599        self.move(x, y, None) 
    614600        self.update() 
    615601         
    616          
    617602    def get_params(self): 
     603        """ 
     604        """ 
    618605        params = {} 
    619606        params["radius"] = self.radius 
     
    622609     
    623610    def set_params(self, params): 
    624  
     611        """ 
     612        """ 
    625613        x = params["radius"]  
    626614        self.set_cursor(x, self._inner_mouse_y) 
    627  
    628  
    629          
     615         
  • guiframe/local_perspectives/plotting/SlicerParameters.py

    r12aa9b5 rd955bf19  
    1 """ 
    2     Panel class to show the slicer parameters  
    3 """ 
     1 
    42 
    53import wx 
     
    108from sans.guicomm.events import EVT_SLICER,EVT_SLICER_PARS,SlicerParameterEvent 
    119 
    12  
    13  
    14  
    1510class SlicerParameterPanel(wx.Dialog): 
     11    """ 
     12    Panel class to show the slicer parameters  
     13    """ 
    1614    #TODO: show units 
    1715    #TODO: order parameters properly 
     
    2018        wx.Dialog.__init__(self, parent, *args, **kwargs) 
    2119        """ 
    22             Dialog window that allow to edit parameters slicer  
    23             by entering new values 
     20        Dialog window that allow to edit parameters slicer  
     21        by entering new values 
    2422        """ 
    2523        self.params = {} 
     
    4038    def onEVT_SLICER(self, event): 
    4139        """ 
    42             Process EVT_SLICER events 
    43             When the slicer changes, update the panel 
    44              
    45             @param event: EVT_SLICER event 
     40        Process EVT_SLICER events 
     41        When the slicer changes, update the panel 
     42         
     43        :param event: EVT_SLICER event 
    4644        """ 
    4745        event.Skip() 
     
    5351    def set_slicer(self, type, params): 
    5452        """ 
    55             Rebuild the panel 
     53        Rebuild the panel 
    5654        """ 
    5755        self.bck.Clear(True)   
     
    106104    def onParamChange(self, evt): 
    107105        """ 
    108             receive an event end reset value text fields 
    109             inside self.parameters 
     106        receive an event end reset value text fields 
     107        inside self.parameters 
    110108        """ 
    111109        evt.Skip() 
     
    118116    def onTextEnter(self, evt):  
    119117        """ 
    120             Parameters have changed 
     118        Parameters have changed 
    121119        """  
    122120        params = {} 
  • guiframe/local_perspectives/plotting/boxSlicer.py

    r83f4445 rd955bf19  
    269269class HorizontalLines(_BaseInteractor): 
    270270    """ 
    271      Draw 2 Horizontal lines centered on (0,0) that can move  
    272      on the x- direction and in opposite direction 
     271    Draw 2 Horizontal lines centered on (0,0) that can move  
     272    on the x- direction and in opposite direction 
    273273    """ 
    274274    def __init__(self,base,axes,color='black', zorder=5,x=0.5, y=0.5): 
     
    332332        self.update() 
    333333         
    334          
    335334    def clear(self): 
    336335        """ 
     
    346345            for item in range(len(self.axes.lines)): 
    347346                del self.axes.lines[0] 
    348     
    349347    
    350348    def update(self,x=None,y=None): 
  • guiframe/local_perspectives/plotting/detector_dialog.py

    r80a7f77 rd955bf19  
    2020     
    2121DEFAULT_CMAP= pylab.cm.jet 
     22 
    2223class DetectorDialog(wx.Dialog): 
    2324    """ 
    24         Dialog box to let the user edit detector settings 
     25    Dialog box to let the user edit detector settings 
    2526    """ 
    2627     
    2728    def __init__(self,parent,id=1,base=None,dpi = None,cmap=DEFAULT_CMAP, 
    2829                 reset_zmin_ctl = None,reset_zmax_ctl = None, *args, **kwds): 
    29  
     30        """ 
     31        """ 
    3032        kwds["style"] = wx.DEFAULT_DIALOG_STYLE 
    3133        wx.Dialog.__init__(self,parent,id=1, *args, **kwds) 
     
    7072         
    7173    class Event: 
     74        """ 
     75        """ 
    7276        xnpts = 0 
    7377        ynpts = 0 
     
    7983        sym4 = False 
    8084     
    81      
    82    
    8385    def onSetFocus(self, event): 
    8486        """ 
    85             Highlight the txtcrtl 
     87        Highlight the txtcrtl 
    8688        """ 
    8789        # Get a handle to the TextCtrl 
     
    9395    def resetValues(self, event): 
    9496        """ 
    95             reset detector info 
     97        reset detector info 
    9698        """ 
    9799        try: 
     
    114116    def checkValues(self, event): 
    115117        """ 
    116             Check the valitidity of zmin and zmax value 
    117             zmax should be a float and zmin less than zmax 
     118        Check the valitidity of zmin and zmax value 
     119        zmax should be a float and zmin less than zmax 
    118120        """ 
    119121        flag = True 
     
    154156    def setContent(self, xnpts,ynpts, qmax, beam,zmin=None,zmax=None, sym=False): 
    155157        """ 
    156             received value and displayed them 
    157             @param xnpts: the number of point of the x_bins of data 
    158             @param ynpts: the number of point of the y_bins of data 
    159             @param qmax: the maxmimum value of data pixel 
    160             @param beam : the radius of the beam 
    161             @param zmin:  the value to get the minimum color 
    162             @param zmax:  the value to get the maximum color 
    163             @param sym: 
     158        received value and displayed them 
     159         
     160        :param xnpts: the number of point of the x_bins of data 
     161        :param ynpts: the number of point of the y_bins of data 
     162        :param qmax: the maxmimum value of data pixel 
     163        :param beam: the radius of the beam 
     164        :param zmin:  the value to get the minimum color 
     165        :param zmax:  the value to get the maximum color 
     166        :param sym: 
     167         
    164168        """ 
    165169        self.xnpts_ctl.SetLabel(str(format_number(xnpts))) 
     
    167171        self.qmax_ctl.SetLabel(str(format_number(qmax))) 
    168172        self.beam_ctl.SetLabel(str(format_number(beam))) 
    169          
    170      
    171         
     173     
    172174        if zmin !=None: 
    173175            self.zmin_ctl.SetValue(str(format_number(zmin))) 
     
    177179    def getContent(self): 
    178180        """ 
    179             @return event containing value to reset the detector of a given data 
     181        return event containing value to reset the detector of a given data 
    180182        """ 
    181183        event = self.Event() 
     
    206208    def __set_properties(self): 
    207209        """ 
    208             set proprieties of the dialog window 
     210        set proprieties of the dialog window 
    209211        """ 
    210212        self.SetTitle("Detector parameters") 
     
    214216    def __do_layout(self): 
    215217        """ 
    216             fill the dialog window . 
     218        fill the dialog window . 
    217219        """ 
    218220        sizer_main = wx.BoxSizer(wx.VERTICAL) 
     
    222224        sizer_selection= wx.BoxSizer(wx.HORIZONTAL) 
    223225        
    224  
    225226        iy = 0 
    226227        sizer_params.Add(self.label_xnpts, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     
    243244        iy += 1 
    244245         
    245          
    246         
    247246        self.fig = mpl.figure.Figure(dpi=self.dpi, figsize=(4,1)) 
    248247        
    249248        self.ax1 = self.fig.add_axes([0.05, 0.65, 0.9, 0.15]) 
    250          
    251          
     249     
    252250        self.norm = mpl.colors.Normalize(vmin=0, vmax=100) 
    253251        self.cb1 = mpl.colorbar.ColorbarBase(self.ax1, cmap=self.cmap, 
     
    276274        sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0) 
    277275         
    278          
    279276        sizer_button.Add(self.button_reset,0, wx.LEFT|wx.ADJUST_MINSIZE, 100) 
    280277        sizer_button.Add(self.button_OK, 0, wx.LEFT|wx.ADJUST_MINSIZE, 10) 
    281278        sizer_button.Add(self.button_Cancel, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) 
    282          
    283          
     279     
    284280        sizer_main.Add(sizer_button, 0, wx.EXPAND|wx.BOTTOM|wx.TOP, 10) 
    285281        self.SetAutoLayout(True) 
     
    291287    def _on_select_cmap(self, event): 
    292288        """ 
    293              display a new cmap  
     289        display a new cmap  
    294290        """ 
    295291        cmap_name= self.cmap_selector.GetCurrentSelection() 
  • guiframe/local_perspectives/plotting/masking.py

    r54180f9 rd955bf19  
    1 """ 
    2 This software was developed by the University of Tennessee as part of the 
    3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    4 project funded by the US National Science Foundation.  
    5  
    6 If you use DANSE applications to do scientific research that leads to  
    7 publication, we ask that you acknowledge the use of the software with the  
    8 following sentence: 
    9  
    10 "This work benefited from DANSE software developed under NSF award DMR-0520547."  
    11  
    12 copyright 2008, University of Tennessee 
    13 """ 
     1 
     2################################################################################ 
     3#This software was developed by the University of Tennessee as part of the 
     4#Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     5#project funded by the US National Science Foundation.  
     6# 
     7#If you use DANSE applications to do scientific research that leads to  
     8#publication, we ask that you acknowledge the use of the software with the  
     9#following sentence: 
     10# 
     11#"This work benefited from DANSE software developed under NSF award DMR-0520547."  
     12# 
     13#copyright 2008, University of Tennessee 
     14################################################################################ 
     15 
     16 
    1417##Todo: cleaning up, improving the maskplotpanel initialization, and testing. 
    1518import wx 
     
    4750class MaskPanel(wx.Dialog): 
    4851    """ 
    49         Provides the Mask Editor GUI. 
     52    Provides the Mask Editor GUI. 
    5053    """ 
    5154    ## Internal nickname for the window, used by the AUI manager 
     
    5760    def __init__(self, parent=None,base=None,data =None, id = -1, *args, **kwds): 
    5861        kwds["style"] = wx.DEFAULT_DIALOG_STYLE 
    59         wx.Dialog.__init__(self, parent, id = id,  size=wx.Size(_STATICBOX_WIDTH*2,PANEL_SIZE), *args, **kwds) 
     62        kwds["size"] = wx.Size(_STATICBOX_WIDTH*2,PANEL_SIZE)  
     63        wx.Dialog.__init__(self, parent, id = id,  *args, **kwds) 
    6064        if data != None: 
    6165             
     
    99103    def ShowMessage(self, msg=''): 
    100104        """ 
    101             Show error message when mask covers whole data area 
     105        Show error message when mask covers whole data area 
    102106        """ 
    103107        mssg = 'Erase, redraw or clear the mask. \n\r' 
     
    109113    def _setup_layout(self): 
    110114        """ 
    111             Set up the layout 
     115        Set up the layout 
    112116        """ 
    113117        shape = "Select a Shape for Masking:" 
     
    195199    def onInnerBoxMask(self,event=None): 
    196200        """ 
    197             Call Draw Box Slicer and get mask inside of the box 
     201        Call Draw Box Slicer and get mask inside of the box 
    198202        """ 
    199203        #get ready for next evt 
     
    214218    def onOuterBoxMask(self,event=None): 
    215219        """ 
    216             Call Draw Box Slicer and get mask outside of the box 
     220        Call Draw Box Slicer and get mask outside of the box 
    217221        """ 
    218222        event.Skip()         
     
    232236    def onInnerSectorMask(self,event=None): 
    233237        """ 
    234             Call Draw Sector Slicer and get mask inside of the sector 
     238        Call Draw Sector Slicer and get mask inside of the sector 
    235239        """ 
    236240        event.Skip() 
     
    250254    def onOuterSectorMask(self,event=None): 
    251255        """ 
    252             Call Draw Sector Slicer and get mask outside of the sector 
     256        Call Draw Sector Slicer and get mask outside of the sector 
    253257        """ 
    254258        event.Skip() 
     
    268272    def onInnerRingMask(self, event=None): 
    269273        """ 
    270             Perform inner circular cut on Phi and draw circular slicer 
     274        Perform inner circular cut on Phi and draw circular slicer 
    271275        """ 
    272276        event.Skip() 
     
    286290    def onOuterRingMask(self, event=None): 
    287291        """ 
    288             Perform outer circular cut on Phi and draw circular slicer 
     292        Perform outer circular cut on Phi and draw circular slicer 
    289293        """ 
    290294        event.Skip() 
     
    302306    def onAddMask(self, event): 
    303307        """ 
    304             Add new mask to old mask  
     308        Add new mask to old mask  
    305309        """ 
    306310        if not self.slicer==None: 
     
    314318    def _check_display_mask(self, mask, event): 
    315319        """ 
    316             check if the mask valid and update the plot 
    317             @param mask: mask data 
     320        check if the mask valid and update the plot 
     321         
     322        :param mask: mask data 
     323         
    318324        """ 
    319325        ## Redraw the current image 
     
    322328    def onEraseMask(self, event): 
    323329        """ 
    324             Erase new mask from old mask 
     330        Erase new mask from old mask 
    325331        """ 
    326332        if not self.slicer==None: 
     
    333339    def onResetMask(self, event): 
    334340        """ 
    335             Reset mask to the original mask  
    336         """ 
    337                      
     341        Reset mask to the original mask  
     342        """         
    338343        self.slicer_z += 1 
    339344        self.slicer =  BoxMask(self, self.subplot, zorder=self.slicer_z, side=True) 
     
    349354    def onClearMask(self, event): 
    350355        """ 
    351             Clear mask 
     356        Clear mask 
    352357        """             
    353358        self.slicer_z += 1 
     
    365370    def onClearSlicer(self, event): 
    366371        """ 
    367             Clear the slicer on the plot 
     372        Clear the slicer on the plot 
    368373        """ 
    369374        if not self.slicer==None: 
     
    372377            self.slicer = None 
    373378 
    374              
    375379    def _setSlicer(self): 
    376380        """ 
    377             Clear the previous slicer and create a new one.Post an internal 
    378             event. 
    379             @param slicer: slicer class to create 
    380         """ 
    381          
     381        Clear the previous slicer and create a new one.Post an internal 
     382        event. 
     383         
     384        :param slicer: slicer class to create 
     385         
     386        """ 
    382387        ## Clear current slicer 
    383388        if not self.slicer == None:   
     
    403408    def update(self, draw=True): 
    404409        """ 
    405             Respond to changes in the model by recalculating the  
    406             profiles and resetting the widgets. 
     410        Respond to changes in the model by recalculating the  
     411        profiles and resetting the widgets. 
    407412        """ 
    408413        self.plotpanel.draw() 
     
    410415    def _set_mask(self, mask): 
    411416        """ 
    412             Set mask" 
     417        Set mask 
    413418        """ 
    414419        self.data.mask = mask 
     
    416421    def _update_mask(self,mask): 
    417422        """ 
    418             Respond to changes in masking 
     423        Respond to changes in masking 
    419424        """  
    420425        # the case of liitle numbers of True points 
     
    482487    def _getEmptySlicerEvent(self): 
    483488        """ 
    484             create an empty slicervent  
     489        create an empty slicervent  
    485490        """ 
    486491        self.innerbox_rb.SetValue(False) 
     
    497502    def _draw_model(self,event): 
    498503        """ 
    499             on_close, update the model2d plot 
     504         on_close, update the model2d plot 
    500505        """ 
    501506        pass 
    502507         
    503508    def freeze_axes(self): 
     509        """ 
     510        """ 
    504511        self.plotpanel.axes_frozen = True 
     512         
    505513    def thaw_axes(self): 
    506         self.plotpanel.axes_frozen = False         
     514        """ 
     515        """ 
     516        self.plotpanel.axes_frozen = False        
     517          
    507518    def onMouseMotion(self,event): 
     519        """ 
     520        """ 
    508521        pass 
     522     
    509523    def onWheel(self, event): 
     524        """ 
     525        """ 
    510526        pass   
    511527            
    512528class Maskplotpanel(PlotPanel): 
    513      
    514     def __init__(self, parent, id = -1, color = None,\ 
    515         dpi = None, **kwargs): 
     529    """ 
     530    """ 
     531    def __init__(self, parent, id = -1, color = None, dpi = None, **kwargs): 
     532        """ 
     533        """ 
    516534        PlotPanel.__init__(self, parent, id=id, color=color, dpi=dpi, **kwargs) 
    517535         
     
    525543    def add_toolbar(self): 
    526544        """  
    527             Add toolbar 
     545        Add toolbar 
    528546        """ 
    529547        # Not implemented 
     
    531549    def on_set_focus(self, event): 
    532550        """ 
    533             send to the parenet the current panel on focus 
     551        send to the parenet the current panel on focus 
    534552        """ 
    535553        #change the panel background 
     
    538556          
    539557    def add_image(self, plot): 
     558        """ 
     559        """ 
    540560        self.plots[plot.name] = plot 
    541561        #init graph 
     
    552572    def onMouseMotion(self, event): 
    553573        """ 
    554             Disable dragging 2D image 
     574        Disable dragging 2D image 
    555575        """ 
    556576        pass 
     
    558578    def onContextMenu(self, event): 
    559579        """ 
    560             Default context menu for a plot panel 
     580        Default context menu for a plot panel 
    561581        """ 
    562582        # Slicer plot popup menu 
     
    576596class ViewerFrame(wx.Frame): 
    577597    """ 
    578         Add comment 
     598    Add comment 
    579599    """ 
    580600    def __init__(self, parent, id, title): 
    581601        """ 
    582             comment 
    583             @param parent: parent panel/container 
     602        comment 
     603        :param parent: parent panel/container 
    584604        """ 
    585605        # Initialize the Frame object 
  • guiframe/local_perspectives/plotting/plotting.py

    r2fc9243 rd955bf19  
    1 """ 
    2 This software was developed by the University of Tennessee as part of the 
    3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    4 project funded by the US National Science Foundation.  
    51 
    6 See the license text in license.txt 
    72 
    8 copyright 2008, University of Tennessee 
    9 """ 
    103 
     4################################################################################ 
     5#This software was developed by the University of Tennessee as part of the 
     6#Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     7#project funded by the US National Science Foundation.  
     8# 
     9#See the license text in license.txt 
     10# 
     11#copyright 2008, University of Tennessee 
     12################################################################################ 
    1113 
    1214import wx 
     
    1820class Plugin: 
    1921    """ 
    20         Plug-in class to be instantiated by the GUI manager 
     22    Plug-in class to be instantiated by the GUI manager 
    2123    """ 
    2224     
    2325    def __init__(self): 
    2426        """ 
    25             Initialize the plug-in 
     27        Initialize the plug-in 
    2628        """ 
    2729        ## Plug-in name 
     
    3941    def populate_menu(self, id, parent): 
    4042        """ 
    41             Create a 'Plot' menu to list the panels 
    42             available for displaying 
    43             @param id: next available unique ID for wx events 
    44             @param parent: parent window 
     43        Create a 'Plot' menu to list the panels 
     44        available for displaying 
     45         
     46        :param id: next available unique ID for wx events 
     47        :param parent: parent window 
     48         
    4549        """ 
    4650        self.menu = wx.Menu() 
     
    5155        return [(id, self.menu, "Plot")] 
    5256     
    53          
    5457    def get_panels(self, parent): 
    5558        """ 
    56             Create and return a list of panel objects 
     59        Create and return a list of panel objects 
    5760        """ 
    5861        ## Save a reference to the parent 
     
    6164        self.parent.Bind(EVT_NEW_PLOT, self._on_plot_event) 
    6265        # We have no initial panels for this plug-in 
    63          
    6466        return [] 
    6567    
    66      
    6768    def get_perspective(self): 
    6869        """ 
    69             Get the list of panel names for this perspective 
     70        Get the list of panel names for this perspective 
    7071        """ 
    7172        return self.perspective 
     
    8283    def post_init(self): 
    8384        """ 
    84             Post initialization call back to close the loose ends 
    85             [Somehow openGL needs this call] 
     85        Post initialization call back to close the loose ends 
     86        [Somehow openGL needs this call] 
    8687        """ 
    8788        pass 
    88      
    8989     
    9090    def _on_show_panel(self, event): 
     
    9595    def _on_plot_event(self, event): 
    9696        """ 
    97             A new plottable is being shipped to the plotting plug-in. 
    98             Check whether we have a panel to put in on, or create 
    99             a new one 
    100             @param event: EVT_NEW_PLOT event 
     97        A new plottable is being shipped to the plotting plug-in. 
     98        Check whether we have a panel to put in on, or create 
     99        a new one 
     100         
     101        :param event: EVT_NEW_PLOT event 
     102         
    101103        """ 
    102104        # Check whether we already have a graph with the same units 
  • guiframe/local_perspectives/plotting/sectorMask.py

    raef2cf2 rd955bf19  
    1010class SectorMask(_BaseInteractor): 
    1111    """ 
    12          Draw a sector slicer.Allow to find the data 2D inside of the sector lines 
     12    Draw a sector slicer.Allow to find the data 2D inside of the sector lines 
    1313    """ 
    1414    def __init__(self,base,axes,color='gray', zorder=3, side = False): 
     
    5656    def clear(self): 
    5757        """ 
    58             Clear the slicer and all connected events related to this slicer 
     58        Clear the slicer and all connected events related to this slicer 
    5959        """ 
    6060        self.clear_markers() 
     
    6868    def update(self): 
    6969        """ 
    70             Respond to changes in the model by recalculating the profiles and 
    71             resetting the widgets. 
     70        Respond to changes in the model by recalculating the profiles and 
     71        resetting the widgets. 
    7272        """ 
    7373        # Update locations   
     
    110110    def _post_data(self): 
    111111        """ 
    112             compute sector averaging of data into data1D 
     112        compute sector averaging of data into data1D 
    113113        """ 
    114114        ## get the data to average 
     
    136136    def moveend(self, ev): 
    137137        """ 
    138             Called a dragging motion ends.Get slicer event  
     138        Called a dragging motion ends.Get slicer event  
    139139        """ 
    140140        self.base.thaw_axes() 
     
    169169    def get_params(self): 
    170170        """ 
    171             Store a copy of values of parameters of the slicer into a dictionary. 
    172             @return params: the dictionary created 
     171        Store a copy of values of parameters of the slicer into a dictionary. 
     172         
     173        :return params: the dictionary created 
     174         
    173175        """ 
    174176        params = {} 
     
    182184        return params 
    183185     
    184      
    185186    def set_params(self, params): 
    186187        """ 
    187             Receive a dictionary and reset the slicer with values contained  
    188             in the values of the dictionary. 
    189             @param params: a dictionary containing name of slicer parameters and  
     188        Receive a dictionary and reset the slicer with values contained  
     189        in the values of the dictionary. 
     190         
     191        :param params: a dictionary containing name of slicer parameters and  
    190192            values the user assigned to the slicer. 
    191193        """ 
     
    202204        self._post_data() 
    203205         
    204          
    205206    def freeze_axes(self): 
     207        """ 
     208        """ 
    206209        self.base.freeze_axes() 
    207210         
    208          
    209211    def thaw_axes(self): 
     212        """ 
     213        """ 
    210214        self.base.thaw_axes() 
    211215 
    212  
    213216    def draw(self): 
     217        """ 
     218        """ 
    214219        self.base.update() 
    215220         
  • guiframe/local_perspectives/plotting/slicerpanel.py

    rddd864e rd955bf19  
    1 """ 
    2     Panel class to show the slicer parameters  
    3 """ 
     1 
    42 
    53import wx 
     
    1311 
    1412class SlicerPanel(wx.Panel): 
     13    """ 
     14    Panel class to show the slicer parameters  
     15    """ 
    1516    #TODO: show units 
    1617    #TODO: order parameters properly 
     
    4647    def onEVT_SLICER(self, event): 
    4748        """ 
    48             Process EVT_SLICER events 
    49             When the slicer changes, update the panel 
    50             @param event: EVT_SLICER event 
     49        Process EVT_SLICER events 
     50        When the slicer changes, update the panel 
     51         
     52        :param event: EVT_SLICER event 
     53         
    5154        """ 
    5255        event.Skip() 
     
    5659            self.set_slicer(event.type, event.params) 
    5760         
    58          
    5961    def set_slicer(self, type, params): 
    6062        """ 
    61             Rebuild the panel 
     63        Rebuild the panel 
    6264        """ 
    6365        self.bck.Clear(True)   
     
    106108    def onSetFocus(self, evt): 
    107109        """ 
    108             Hightlight the textcrtl 
     110        Hightlight the textcrtl 
    109111        """ 
    110112        # Get a handle to the TextCtrl 
     
    117119    def onParamChange(self, evt): 
    118120        """ 
    119             Receive and event and reset the text field contained in self.parameters 
     121        Receive and event and reset the text field contained in self.parameters 
    120122             
    121123        """ 
     
    126128                item[1].Refresh() 
    127129    
    128          
    129130    def onTextEnter(self, evt):  
    130131        """ 
    131             Parameters have changed 
     132        Parameters have changed 
    132133        """  
    133134        params = {} 
Note: See TracChangeset for help on using the changeset viewer.