Index: guiframe/local_perspectives/plotting/AnnulusSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/AnnulusSlicer.py	(revision 6d920cd2a2b96abc4845a5766911d8ef7fe5adc5)
+++ guiframe/local_perspectives/plotting/AnnulusSlicer.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
@@ -16,5 +16,8 @@
 class AnnulusInteractor(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+         Select an annulus through a 2D plot.
+         This interactor is used to average 2D data  with the region 
+         defined by 2 radius.
+         this class is defined by 2 Ringinterators.
     """
     def __init__(self,base,axes,color='black', zorder=3):
@@ -26,6 +29,5 @@
         self.qmax = min(math.fabs(self.base.data2D.xmax),math.fabs(self.base.data2D.xmin))  #must be positive
         self.connect = self.base.connect
-        
-
+    
         ## Number of points on the plot
         self.nbins = 20
@@ -35,6 +37,4 @@
         self.xmind=self.base.data2D.xmin
 
-        #self.sign=1
-        
         if (self.xmaxd+self.xmind)>0:
             self.sign=1
@@ -57,4 +57,9 @@
 
     def _onEVT_SLICER_PARS(self, event):
+        """
+            receive an event containing parameters values to reset the slicer
+            @param event: event of type SlicerParameterEvent with params as 
+            attribute
+        """
         wx.PostEvent(self.base, StatusEvent(status="AnnulusSlicer._onEVT_SLICER_PARS"))
         event.Skip()
@@ -63,34 +68,27 @@
             self.base.update()
 
-    def update_and_post(self):
-        self.update()
-        self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
-
     def set_layer(self, n):
+        """
+             Allow adding plot to the same panel
+             @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
     def clear(self):
+        """
+            Clear the slicer and all connected events related to this slicer
+        """
         self.clear_markers()
         self.outer_circle.clear()
         self.inner_circle.clear()
         self.base.connect.clearall()
-      
         self.base.Unbind(EVT_SLICER_PARS)
         
+        
     def update(self):
         """
-        Respond to changes in the model by recalculating the profiles and
-        resetting the widgets.
+            Respond to changes in the model by recalculating the profiles and
+            resetting the widgets.
         """
         # Update locations        
@@ -98,10 +96,9 @@
         self.outer_circle.update()
         
-  
 
     def save(self, ev):
         """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
+            Remember the roughness for this layer and the next so that we
+            can restore on Esc.
         """
         self.base.freeze_axes()
@@ -110,5 +107,9 @@
 
     def _post_data(self,nbins=None):
-         # Compute data
+        """
+            Uses annulus parameters to plot averaged data into 1D data.
+            @param nbins: the number of points to plot 
+        """
+        #Data to average
         data = self.base.data2D
         # If we have no data, just return
@@ -117,16 +118,18 @@
         
         from DataLoader.manipulations import SectorPhi
-        #radius = self.qmax#math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))
+    
         rmin= min(math.fabs(self.inner_circle.get_radius()),
                   math.fabs(self.outer_circle.get_radius()))
         rmax = max(math.fabs(self.inner_circle.get_radius()),
                    math.fabs(self.outer_circle.get_radius()))
-        #print "rmin, rmax", rmin, rmax
+        #if the user does not specify the numbers of points to plot 
+        # the default number will be nbins= 20
         if nbins==None:
-            nbins = 20
+            self.nbins= 20
+        else:
+            self.nbins = nbins
+        ## create the data1D Q average of data2D    
         sect = SectorPhi(r_min=rmin , r_max= rmax,
-                          phi_min=0, phi_max=2*math.pi , nbins=nbins)
-        
-        
+                          phi_min=0, phi_max=2*math.pi , nbins=self.nbins)
         sector = sect(self.base.data2D)
         
@@ -144,10 +147,8 @@
         new_plot.name = "SectorPhi" +"("+ self.base.data2D.name+")"
         
-       
-        
         new_plot.source=self.base.data2D.source
         #new_plot.info=self.base.data2D.info
+        
         new_plot.interactive = True
-        #print "loader output.detector",output.source
         new_plot.detector =self.base.data2D.detector
         # If the data file does not tell us what the axes are, just assume...
@@ -162,15 +163,18 @@
         
          
-        
-        
     def moveend(self, ev):
+        """
+            Called when any dragging motion ends.
+            Post an event (type =SlicerParameterEvent)
+            to plotter 2D with a copy  slicer parameters
+            Call  _post_data method
+        """
         self.base.thaw_axes()
-        
-        # Post paramters
+        # Post parameters to plotter 2D
         event = SlicerParameterEvent()
         event.type = self.__class__.__name__
         event.params = self.get_params()
-        #wx.PostEvent(self.base.parent, event)
         wx.PostEvent(self.base, event)
+        # create a 1D data plot
         self._post_data()
             
@@ -192,4 +196,8 @@
         
     def get_params(self):
+        """
+            Store a copy of values of parameters of the slicer into a dictionary.
+            @return params: the dictionary created
+        """
         params = {}
         params["inner_radius"] = math.fabs(self.inner_circle._inner_mouse_x)
@@ -199,10 +207,17 @@
     
     def set_params(self, params):
-        
+        """
+            Receive a dictionary and reset the slicer with values contained 
+            in the values of the dictionary.
+            @param params: a dictionary containing name of slicer parameters and 
+            values the user assigned to the slicer.
+        """
         inner = math.fabs(params["inner_radius"] )
         outer = math.fabs(params["outer_radius"] )
         self.nbins = int(params["nbins"])
+        ## Update the picture
         self.inner_circle.set_cursor(inner, self.inner_circle._inner_mouse_y)
         self.outer_circle.set_cursor(outer, self.outer_circle._inner_mouse_y)
+        ## Post the data given the nbins entered by the user 
         self._post_data(self.nbins)
         
@@ -219,5 +234,8 @@
 class RingInteractor(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+         Draw a ring Given a radius 
+         @param: the color of the line that defined the ring
+         @param r: the radius of the ring
+         @param sign: the direction of motion the the marker 
     """
     def __init__(self,base,axes,color='black', zorder=5, r=1.0,sign=1):
@@ -226,15 +244,17 @@
         self.markers = []
         self.axes = axes
+        # Current radius of the ring
         self._inner_mouse_x = r
+        #Value of the center of the ring
         self._inner_mouse_y = 0
+        # previous value of that radius
         self._inner_save_x  = r
+        #Save value of the center of the ring
         self._inner_save_y  = 0
-        self.scale = 10.0
+        #Class instantiating RingIterator class
         self.base= base
+        #the direction of the motion of the marker
         self.sign=sign
-         
-        
-        #print "sign",self.sign,self.sign*math.fabs(self._inner_mouse_x)
-                                                    
+        ## Create a marker 
         try:
             # Inner circle marker
@@ -254,12 +274,12 @@
             message += "Get the SVN version that is at least as recent as June 1, 2007"
             
-            #raise "Version error", message
-            
-        # Inner circle
-
-           
+            owner=self.base.base.parent
+            wx.PostEvent(owner, StatusEvent(status="AnnulusSlicer: %s"%message))
+            
+        # Draw a circle 
         [self.inner_circle] = self.axes.plot([],[],
                                       linestyle='-', marker='',
                                       color=self.color)
+        # the number of points that make the ring line
         self.npts = 40
             
@@ -268,8 +288,15 @@
 
     def set_layer(self, n):
+        """
+             Allow adding plot to the same panel
+             @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
     def clear(self):
+        """
+            Clear the slicer and all connected events related to this slicer
+        """
         self.clear_markers()
         try:
@@ -284,9 +311,12 @@
         
     def get_radius(self):
+        """
+            @return self._inner_mouse_x: the current radius of the ring
+        """
         return self._inner_mouse_x
         
     def update(self):
         """
-        Draw the new roughness on the graph.
+            Draw the new roughness on the graph.
         """
         # Plot inner circle
@@ -315,4 +345,7 @@
 
     def moveend(self, ev):
+        """
+            Called after a dragging motion
+        """
         self.base.moveend(ev)
             
@@ -333,4 +366,7 @@
         
     def set_cursor(self, x, y):
+        """
+            draw the ring given x, y value 
+        """
         self.move(x, y, None)
         self.update()
@@ -338,4 +374,8 @@
         
     def get_params(self):
+        """
+            Store a copy of values of parameters of the slicer into a dictionary.
+            @return params: the dictionary created
+        """
         params = {}
         params["radius"] = math.fabs(self._inner_mouse_x)
@@ -343,5 +383,10 @@
     
     def set_params(self, params):
-
+        """
+            Receive a dictionary and reset the slicer with values contained 
+            in the values of the dictionary.
+            @param params: a dictionary containing name of slicer parameters and 
+            values the user assigned to the slicer.
+        """
         x = params["radius"] 
         self.set_cursor(x, self._inner_mouse_y)
Index: guiframe/local_perspectives/plotting/LineSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/LineSlicer.py	(revision 0d9dae840601f23ae4dd0b9e0317056593727f90)
+++ 	(revision )
@@ -1,286 +1,0 @@
-#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
-#      before pushing a new 1D data update.
-
-
-#
-#TODO: NEED MAJOR REFACTOR
-#
-
-# Debug printout
-import math
-import wx
-from copy import deepcopy
-
-from sans.guicomm.events import NewPlotEvent, StatusEvent,SlicerParameterEvent,EVT_SLICER_PARS
-from BaseInteractor import _BaseInteractor
-
-
-
-class LineInteractor(_BaseInteractor):
-    """
-        Select a slice through a 2D plot
-    """
-    #TODO: get rid of data that is not related to the image
-    # For instance, get rid of access to qmax
-    
-    def __init__(self,base,axes,color='black', zorder=3):
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self._mouse_x = 0
-        self._mouse_y = self.base.data2D.xmax/2
-        self._save_x  = 0
-        self._save_y  = self.base.data2D.xmax/2
-        self.scale = 10.0
-        
-        self.npts = 150
-        ## Number of bins on the line
-        self.nbins = 50
-        ## Width of the line
-        self.tolerance = None
-        
-        try:
-            self.marker = self.axes.plot([0],[self.base.qmax/2], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          label="pick", 
-                                          zorder=zorder, # Prefer this to other lines
-                                          visible=True)[0]
-        except:
-            self.marker = self.axes.plot([0],[self.base.qmax/2], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          pickradius=5, label="pick", 
-                                          visible=True)[0]
-            
-            message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
-            message += "Get the SVN version that is at least as recent as June 1, 2007"
-                          
-        self.line = self.axes.plot([0,0],[0.0,self.base.qmax/2*self.scale],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
-        
-            
-        self.connect_markers([self.marker])
-        self.update()
-        self._post_data()
-        
-        # Bind to slice parameter events
-        self.base.parent.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
-        
-    def _onEVT_SLICER_PARS(self, event):
-        event.Skip()
-        wx.PostEvent(self.base.parent, StatusEvent(status="LineSlicer._onEVT_SLICER_PARS"))
-        if event.type == self.__class__.__name__:
-            self.set_params(event.params)
-            self.base.update()
-        
-    def update_and_post(self):
-        self.update()
-        self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<q>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
-
-
-    def get_event(self, image=None, x=None, y=None):
-        evt = SliceEvent(self._mouse_x, self._mouse_y)
-        evt.type = SliceInteractor
-        if not image==None and not x==None and not y==None:
-            data_x, data_y = self.get_data(image, x, y)
-            evt.data_x = data_x
-            evt.data_y = data_y
-        evt.min_xlim = 0
-        evt.max_xlim = self.base.qmax
-        evt.params = self.get_params()
-        evt.ylabel = r'$\rm{Intensity}\ (cm^{-1})$'
-        evt.xlabel = r'$\rm{q}\ (A^{-1})$'
-
-        return evt
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            self.marker.remove()
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-        
-        # Unbind panel
-        #self.base.connect.disconnect()
-        self.base.parent.Unbind(EVT_SLICER_PARS)
-
-        
-    def update(self):
-        """
-        Draw the new roughness on the graph.
-        """
-        self.marker.set(xdata=[self._mouse_x],ydata=[self._mouse_y])
-        self.line.set(xdata=[0,self._mouse_x*self.scale], ydata=[0,self._mouse_y*self.scale])
-
-    def get_data(self, image=None, x=None, y=None):
-        """
-            Return the slice data
-        """
-        #TODO: Computer variance 
-        
-        # If we have no data, just return
-        if image == None:
-            return
-        
-        # Now the slice
-        nbins = self.nbins
-        data_x = nbins*[0]
-        data_y = nbins*[0]
-        counts = nbins*[0]
-        
-        length = len(image)
-        qmax = x[length-1]
-        
-        #TODO: only good for square detector!
-        #data_step = (x[length-1]-x[length-2])/2.0
-        data_step = (x[length-1]-x[length-2])
-        if self.tolerance==None:
-            self.tolerance = data_step
-        else:
-            data_step = self.tolerance
-        
-        #TODO: calculate the slice from the actual matrix 
-        # this must be done for real data
-        print "STEP", data_step
-        for i_x in range(length):
-            for i_y in range(length):
-                    
-                # Check whether that cell touches the line
-                # Careful with the sign of the slope
-                xval = x[i_x]
-                yval = y[i_y]
-                
-                if (self._mouse_x==0 and math.fabs(xval)<data_step) \
-                    or (self._mouse_x>0 and \
-                        math.fabs(yval-xval*self._mouse_y/self._mouse_x)<data_step) \
-                    or (self._mouse_x<0 and \
-                        math.fabs(yval+xval*self._mouse_y/self._mouse_x)<data_step) \
-                    or (self._mouse_y>0 and \
-                        math.fabs(xval-yval*self._mouse_x/self._mouse_y)<data_step) \
-                    or (self._mouse_y<0 and \
-                        math.fabs(xval+yval*self._mouse_x/self._mouse_y)<data_step):
-                    
-                    q = math.sqrt(x[i_x]*x[i_x] + y[i_y]*y[i_y])
-                       
-                    i_bin = int(math.floor(q/(qmax/nbins)))
-                    
-                    # Check for out-of-range q bins (possible in the corners)
-                    if i_bin<nbins:
-                        #data_y[i_bin] += math.exp(image[i_x][i_y])
-                        data_y[i_bin] += image[i_y][i_x]
-                        counts[i_bin] += 1
-                    
-        data_pos_x = []
-        data_pos_y = []
-        for i in range(nbins):
-            data_x[i] = (i+0.5)*qmax/nbins
-            if counts[i]>0:
-                data_y[i] = data_y[i]/counts[i]
-                data_pos_x.append(data_x[i])
-                data_pos_y.append(data_y[i])
-        
-        return data_x, data_y
-
-
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self._save_x = self._mouse_x
-        self._save_y = self._mouse_y
-        self.base.freeze_axes()
-
-    def _post_data(self):
-        # Compute data
-        data = self.base.get_corrected_data()
-        # If we have no data, just return
-        if data == None:
-            return
-
-        data_x, data_y = self.get_data(data, self.base.x, self.base.y)
-        
-        name = "Line"
-        if hasattr(self.base, "name"):
-            name += " %s" % self.base.name
-        print "data_x", data_x
-        """    
-        wx.PostEvent(self.base.parent, AddPlotEvent(name=name,
-                                               x = data_x,
-                                               y = data_y,
-                                               yscale = 'log',
-                                               variable = 'Q',
-                                               ylabel = "\\rm{Intensity} ",
-                                               yunits = "cm^{-1}",
-                                               xlabel = '\\rm{q} ',
-                                               xunits = 'A^{-1}',
-                                               parent = self.base.__class__.__name__))
-        """
-    def moveend(self, ev):
-        self.base.thaw_axes()
-        
-        # Post paramters
-        event = SlicerParameterEvent()
-        event.type = self.__class__.__name__
-        event.params = self.get_params()
-        wx.PostEvent(self.base.parent, event)
-
-        self._post_data()
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self._mouse_x = self._save_x
-        self._mouse_y = self._save_y
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        self._mouse_x = x
-        self._mouse_y = y
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        self._post_data()
-        
-    def get_params(self):
-        params = {}
-        params["x"] = self._mouse_x
-        params["y"] = self._mouse_y
-        params["nbins"] = self.nbins
-        params["line_width"] = self.tolerance
-        return params
-    
-    def set_params(self, params):
-
-        x = params["x"] 
-        y = params["y"] 
-        if "nbins" in params:
-            self.nbins = int(params["nbins"])
-        if "line_width" in params:
-            self.tolerance = params["line_width"]
-        self.set_cursor(x, y)
-        
Index: guiframe/local_perspectives/plotting/Plotter2D.py
===================================================================
--- guiframe/local_perspectives/plotting/Plotter2D.py	(revision 6d920cd2a2b96abc4845a5766911d8ef7fe5adc5)
+++ guiframe/local_perspectives/plotting/Plotter2D.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
@@ -237,20 +237,18 @@
         slicerpop.Append(id, '&Box averaging in Qy')
         wx.EVT_MENU(self, id, self.onBoxavgY) 
-        if self.slicer !=None:
+        if self.slicer !=None :
             id = wx.NewId()
             slicerpop.Append(id, '&Clear slicer')
             wx.EVT_MENU(self, id,  self.onClearSlicer) 
-        
-            id = wx.NewId()
-            slicerpop.Append(id, '&Edit Slicer Parameters')
-            wx.EVT_MENU(self, id, self._onEditSlicer) 
+            if self.slicer.__class__.__name__ !="BoxSum":
+                id = wx.NewId()
+                slicerpop.Append(id, '&Edit Slicer Parameters')
+                wx.EVT_MENU(self, id, self._onEditSlicer) 
         slicerpop.AppendSeparator() 
        
-     
         id = wx.NewId()
         slicerpop.Append(id, '&Toggle Linear/Log scale')
         wx.EVT_MENU(self, id, self._onToggleScale) 
                  
-      
         pos = event.GetPosition()
         pos = self.ScreenToClient(pos)
Index: guiframe/local_perspectives/plotting/boxSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/boxSlicer.py	(revision 18eba35c7477f0694169ce9f4575ba08f17c4cc0)
+++ guiframe/local_perspectives/plotting/boxSlicer.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
@@ -20,5 +20,6 @@
 class BoxInteractor(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+         BoxInteractor define a rectangle that return data1D average of Data2D
+         in a rectangle area defined by -x, x ,y, -y
     """
     def __init__(self,base,axes,color='black', zorder=3):
@@ -38,6 +39,5 @@
         ## Number of points on the plot
         self.nbins = 30
-        self.count=0
-        self.error=0
+       
         self.averager=None
         
@@ -53,6 +53,4 @@
                                       y= self.y)
         self.horizontal_lines.qmax= self.qmax
-        
-      
         
         self.update()
@@ -459,4 +457,7 @@
 
 class BoxInteractorX(BoxInteractor):
+    """
+        Average in Qx direction
+    """
     def __init__(self,base,axes,color='black', zorder=3):
         BoxInteractor.__init__(self, base, axes, color=color)
@@ -469,4 +470,7 @@
 
 class BoxInteractorY(BoxInteractor):
+    """
+         Average in Qy direction
+    """
     def __init__(self,base,axes,color='black', zorder=3):
         BoxInteractor.__init__(self, base, axes, color=color)
Index: guiframe/local_perspectives/plotting/boxSum.py
===================================================================
--- guiframe/local_perspectives/plotting/boxSum.py	(revision 6d920cd2a2b96abc4845a5766911d8ef7fe5adc5)
+++ guiframe/local_perspectives/plotting/boxSum.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
@@ -1,49 +1,55 @@
-#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
-#      before pushing a new 1D data update.
-
-#
-#TODO: NEED MAJOR REFACTOR
-#
-
-
-# Debug printout
-#from config import printEVT
+
+
+
+import math
+import wx
+from copy import deepcopy
 from BaseInteractor import _BaseInteractor
-from copy import deepcopy
-import math
-
-#from Plotter1D import AddPlotEvent
-import SlicerParameters
-import wx
-
 from sans.guicomm.events import SlicerParamUpdateEvent,EVT_SLICER_PARS,StatusEvent
+
+
 class BoxSum(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+        Boxsum Class: determine 2 rectangular area to compute the sum of pixel of
+        a Data. 
+        Uses PointerInteractor , VerticalDoubleLine,HorizontalDoubleLine.
+        @param zorder:  Artists with lower zorder values are drawn first.
+        @param x_min: the minimum value of the x coordinate
+        @param x_max: the maximum value of the x coordinate
+        @param y_min: the minimum value of the y coordinate
+        @param y_max: the maximum value of the y coordinate
+
     """
-    def __init__(self,base,axes,color='black', zorder=3, x_min=0.008, x_max=0.008, y_min=0.0025, y_max=0.0025):
+    def __init__(self,base,axes,color='black', zorder=3, x_min=0.008,
+                  x_max=0.008, y_min=0.0025, y_max=0.0025):
         
         _BaseInteractor.__init__(self, base, axes, color=color)
+        ## class initialization
+        ## list of Boxsmun markers
         self.markers = []
         self.axes = axes
+        ## connect the artist for the motion
+        self.connect = self.base.connect
+        ## when qmax is reached the selected line is reset the its previous value
         self.qmax = min(self.base.data2D.xmax, self.base.data2D.xmin)
-        self.connect = self.base.connect
+        ## Define the boxsum limits
         self.xmin= -1* 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))
         self.ymin= -1* 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))
-        #self.xmax= x_max
-        #self.ymax=  y_max
+       
         self.xmax= 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))
         self.ymax=  0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))
-        # center of the figure
+        ## center of the boxSum
         self.center_x= 0.0002
         self.center_y= 0.0003
-       
         ## Number of points on the plot
         self.nbins = 20
+        ## Define initial result the summation 
         self.count=0
         self.error=0
+        ## Flag to determine if the current figure has moved
+        ## set to False == no motion , set to True== motion
         self.has_move= False
-    
-        self.horizontal_lines= Horizontal_DoubleLine(self, self.base.subplot,color='blue',
+        ## Create Boxsum edges 
+        self.horizontal_lines= HorizontalDoubleLine(self, self.base.subplot,color='blue',
                                                       zorder=zorder,
                                     y= self.ymax,
@@ -53,5 +59,5 @@
         self.horizontal_lines.qmax = self.qmax
         
-        self.vertical_lines= Vertical_DoubleLine(self, self.base.subplot,color='black',
+        self.vertical_lines= VerticalDoubleLine(self, self.base.subplot,color='black',
                                                       zorder=zorder,
                                     y= self.ymax,
@@ -60,50 +66,54 @@
                                     center_y= self.center_y)
         self.vertical_lines.qmax = self.qmax
+        
         self.center= PointInteractor(self, self.base.subplot,color='grey',
                                                       zorder=zorder,
                                     center_x= self.center_x,
                                     center_y= self.center_y)
-      
-            
-        #self.connect_markers([])
-        self.panel_name=""      
+        ## Save the name of the slicer panel associate with this slicer 
+        self.panel_name=""    
+        ## Update and post slicer parameters  
         self.update()
         self._post_data()
-        
-        # Bind to slice parameter events
-        #print "box sum  self.base.parent",self.base.parent
+        ## Bind to slice parameter events
         self.base.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
         
+        
     def set_panel_name(self, name):
+        """
+            Store the name of the panel associated to this slicer
+            @param name: the name of this panel
+        """
         self.panel_name= name
         
         
     def _onEVT_SLICER_PARS(self, event):
+        """
+            receive an event containing parameters values to reset the slicer
+            @param event: event of type SlicerParameterEvent with params as 
+            attribute
+        """
+        ## Post e message to declare what kind of event has being received
         wx.PostEvent(self.base.parent, StatusEvent(status="Boxsum._onEVT_SLICER_PARS"))
-        #print "receiving value ",event.params
         event.Skip()
+        ## reset the slicer with the values contains the event.params dictionary
         if event.type == self.__class__.__name__:
             self.set_params(event.params)
             self.base.update()
 
-    def update_and_post(self):
-        self.update()
-        self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
 
     def set_layer(self, n):
+        """
+             Allow adding plot to the same panel
+             @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear the slicer and all connected events related to this slicer
+        """
         self.clear_markers()
         self.horizontal_lines.clear()
@@ -111,26 +121,25 @@
         self.center.clear()
         self.base.connect.clearall()
-        #self.base.connect.disconnect()
         self.base.Unbind(EVT_SLICER_PARS)
         
+        
     def update(self):
         """
-        Respond to changes in the model by recalculating the profiles and
-        resetting the widgets.
-        """
+            Respond to changes in the model by recalculating the profiles and
+            resetting the widgets.
+        """
+        ## check if the center point has moved and update the figure accordingly 
         if self.center.has_move:
-            #print "center has move"
             self.center.update()
             self.horizontal_lines.update( center= self.center)
             self.vertical_lines.update( center= self.center)
-            
+        ## check if the horizontal lines have moved and update the figure accordingly    
         if self.horizontal_lines.has_move:
-            #print "top has moved"
             self.horizontal_lines.update()
             self.vertical_lines.update(y1=self.horizontal_lines.y1,
                                        y2=self.horizontal_lines.y2,
                                        height= self.horizontal_lines.half_height )
+        ## check if the vertical lines have moved and update the figure accordingly    
         if self.vertical_lines.has_move:
-            #print "right has moved"
             self.vertical_lines.update()
             self.horizontal_lines.update(x1=self.vertical_lines.x1,
@@ -150,24 +159,31 @@
         
     def _post_data(self):
-        # Compute data
-        print 
-        
+        """
+            Get the limits of the boxsum and compute the sum of the pixel
+            contained in that region and the error on that sum
+        """
+        ## Data 2D for which the pixel will be summed
         data = self.base.data2D
-        from DataLoader.manipulations import  Boxavg
-        #radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))
+        ## the region of the summation
         x_min= self.horizontal_lines.x2 
         x_max= self.horizontal_lines.x1 
         y_min= self.vertical_lines.y2
         y_max= self.vertical_lines.y1
-        #print "xmin, xmax, ymin , ymax", x_min, x_max, y_min, y_max
+        ##computation of the sum and its error
+        from DataLoader.manipulations import  Boxavg
         box =  Boxavg (x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max)
         self.count, self.error = box(self.base.data2D)
-        #print "box_sum output",box(self.base.data2D)
+
                           
     def moveend(self, ev):
+        """
+            After a dragging motion this function is called to compute
+            the error and the sum of pixel of a given data 2D 
+        """
         self.base.thaw_axes()
-        # Post paramters
+        ## compute error an d sum of data's pixel
         self._post_data()
-       
+        ## Create and event ( posted to guiframe)that  set the 
+        ##current slicer parameter to a panel of name self.panel_name
         self.type= self.__class__.__name__
         params= self.get_params()
@@ -184,4 +200,6 @@
         self.vertical_lines.restore()
         self.center.restore()
+        
+        
     def move(self, x, y, ev):
         """
@@ -189,19 +207,22 @@
         """
         pass
+    
     
     def set_cursor(self, x, y):
         pass
         
+        
     def get_params(self):
+        """
+            Store a copy of values of parameters of the slicer into a dictionary.
+            @return params: the dictionary created
+        """
         params = {}
-       
         params["Width"] = math.fabs(self.vertical_lines.half_width)*2
         params["Height"] = math.fabs(self.horizontal_lines.half_height)*2 
-        
         params["center_x"] = self.center.x
         params["center_y"] =self.center.y
         params["count"] = self.count
         params["errors"]= self.error
-        
         return params
     
@@ -218,5 +239,10 @@
         
     def set_params(self, params):
-        
+        """
+            Receive a dictionary and reset the slicer with values contained 
+            in the values of the dictionary.
+            @param params: a dictionary containing name of slicer parameters and 
+            values the user assigned to the slicer.
+        """
         x_max = math.fabs(params["Width"] )/2
         y_max = math.fabs(params["Height"] )/2
@@ -224,7 +250,6 @@
         self.center_x=params["center_x"] 
         self.center_y=params["center_y"]
-       
+        #update the slicer given values of params
         self.center.update(center_x=self.center_x,center_y=self.center_y)
-       
         self.horizontal_lines.update(center= self.center,
                                      width=x_max,
@@ -233,5 +258,5 @@
                                     width=x_max,
                                     height=y_max)
-        
+        #compute the new error and sum given values of params
         self._post_data()
         
@@ -241,12 +266,18 @@
         self.base.freeze_axes()
         
+        
     def thaw_axes(self):
         self.base.thaw_axes()
 
+
     def draw(self):
         self.base.draw()
+        
+        
+        
 class PointInteractor(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+         Draw a point that can be dragged with the marker.
+         this class controls the motion the center of the BoxSum 
     """
     def __init__(self,base,axes,color='black', zorder=5,
@@ -255,14 +286,14 @@
         
         _BaseInteractor.__init__(self, base, axes, color=color)
+        ## Initialization the class 
         self.markers = []
         self.axes = axes
-        # center
+        # center coordinates
         self.x = center_x
         self.y = center_y
-        
+        ## saved value of the center coordinates
         self.save_x = center_x
         self.save_y = center_y
-         
-        
+        ## Create a marker 
         try:
             self.center_marker = self.axes.plot([self.x],[self.y], linestyle='',
@@ -280,23 +311,33 @@
             message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
             message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
-            #raise "Version error", message
-            
-        # line
+            owner=self.base.base.parent
+            wx.PostEvent(owner, StatusEvent(status="AnnulusSlicer: %s"%message))
+            
+        ## Draw a point
         self.center = self.axes.plot([self.x],[self.y],
                                       linestyle='-', marker='',
                                       color=self.color,
                                       visible=True)[0]
-    
-        self.npts = 30
-        self.has_move=False    
+        ## Flag to determine the motion this point 
+        self.has_move=False   
+        ## connecting the marker to allow them to move 
         self.connect_markers([self.center_marker])
-        self.update()
+        ## Update the figure
+        self.update()
+    
     
     def set_layer(self, n):
+        """
+            Allow adding plot to the same panel
+            @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear this figure and its markers
+        """
         self.clear_markers()
         try:
@@ -307,12 +348,9 @@
             for item in range(len(self.axes.lines)):
                 del self.axes.lines[0]
-        
-    def get_radius(self):
-        
-        return 0
+  
    
     def update(self, center_x=None,center_y=None):
         """
-        Draw the new roughness on the graph.
+            Draw the new roughness on the graph.
         """
         if center_x !=None: self.x= center_x
@@ -323,6 +361,4 @@
         
         
-        
-        
     def save(self, ev):
         """
@@ -332,6 +368,6 @@
         self.save_x= self.x
         self.save_y= self.y
-        
         self.base.freeze_axes()
+
 
     def moveend(self, ev):
@@ -346,4 +382,5 @@
         self.y= self.save_y
         self.x= self.save_x
+        
         
     def move(self, x, y, ev):
@@ -357,4 +394,5 @@
         self.base.base.update()
         
+        
     def set_cursor(self, x, y):
         self.move(x, y, None)
@@ -366,6 +404,6 @@
         params["x"] = self.x
         params["y"] = self.y
-        
         return params
+    
     
     def set_params(self, params):
@@ -375,7 +413,8 @@
        
         
-class Vertical_DoubleLine(_BaseInteractor):
+class VerticalDoubleLine(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+         Draw 2 vertical lines moving in opposite direction and centered on 
+         a point (PointInteractor)
     """
     def __init__(self,base,axes,color='black', zorder=5, x=0.5,y=0.5,
@@ -384,12 +423,11 @@
         
         _BaseInteractor.__init__(self, base, axes, color=color)
+        ## Initialization the class 
         self.markers = []
         self.axes = axes
-        # center
+        ## Center coordinates
         self.center_x = center_x
         self.center_y = center_y
-        
-       
-        
+        ## defined end points vertical lignes and their saved values
         self.y1     = y + self.center_y
         self.save_y1= self.y1
@@ -405,13 +443,13 @@
         self.x2= self.center_x - delta
         self.save_x2 = self.x2
-        
-        self.color=color
-        
+        ## save the color of the line
+        self.color = color
+        ## the height of the rectangle
         self.half_height= math.fabs(y)
         self.save_half_height= math.fabs(y)
-        
+        ## the with of the rectangle
         self.half_width= math.fabs(self.x1- self.x2)/2
         self.save_half_width=math.fabs(self.x1- self.x2)/2
-        
+        ## Create marker 
         try:
             self.right_marker = self.axes.plot([self.x1],[0], linestyle='',
@@ -429,8 +467,8 @@
             message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
             message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
-            #raise "Version error", message
-            
-        # line
+            owner=self.base.base.parent
+            wx.PostEvent(owner, StatusEvent(status="AnnulusSlicer: %s"%message))
+            
+        ## define the left and right lines of the rectangle
         self.right_line = self.axes.plot([self.x1,self.x1],[self.y1,self.y2],
                                       linestyle='-', marker='',
@@ -441,7 +479,7 @@
                                       color=self.color,
                                       visible=True)[0]
-    
-        self.npts = 30
-        self.has_move=False    
+        ## Flag to determine if the lines have moved
+        self.has_move=False  
+        ## connection the marker and draw the pictures  
         self.connect_markers([self.right_marker])
         self.update()
@@ -449,8 +487,16 @@
 
     def set_layer(self, n):
+        """
+            Allow adding plot to the same panel
+            @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear this figure and its markers
+        """
         self.clear_markers()
         try:
@@ -462,22 +508,28 @@
             for item in range(len(self.axes.lines)):
                 del self.axes.lines[0]
-        
-    def get_radius(self):
-        
-        return 0
+   
    
     def update(self,x1=None,x2=None, y1=None,y2=None,width=None, height=None, center=None):
         """
-        Draw the new roughness on the graph.
-        """
-        #print "self.half_height",self.half_height,self.half_width
+            Draw the new roughness on the graph.
+            @param x1: new maximum value of x coordinates
+            @param x2: new minimum value of x coordinates
+            @param y1: new maximum value of y coordinates
+            @param y2: new minimum value of y coordinates
+            @param width: is the width of the new rectangle
+            @param height: is the height of the new rectangle
+            @param center: provided x, y  coordinates of the center point
+        """
+        ## save the new height, witdh of the rectangle if given as a param
         if width!=None:
             self.half_width= width
         if height!=None:
             self.half_height= height
+        ## If new  center coordinates are given draw the rectangle 
+        ##given these value 
         if center!=None:
             self.center_x= center.x
             self.center_y= center.y
-            #print "vertical width",self.half_width ,self.center_x
+            
             self.x1 = self.half_width + self.center_x
             self.x2= -self.half_width + self.center_x
@@ -490,4 +542,5 @@
             self.left_line.set(xdata=[self.x2,self.x2], ydata=[self.y1,self.y2])
             return 
+        ## if x1, y1, y2, y3 are given draw the rectangle with this value
         if x1 !=None: 
             self.x1= x1
@@ -498,7 +551,5 @@
         if y2 !=None: 
             self.y2= y2
-        
-       
-       
+        ## Draw 2 vertical lines and a marker 
         self.right_marker.set(xdata=[self.x1],ydata=[self.center_y])
         self.right_line.set(xdata=[self.x1,self.x1], ydata=[self.y1,self.y2])
@@ -518,13 +569,17 @@
         
         self.save_half_height= self.half_height
-        #self.save_half_width = math.fabs(self.x1-self.x2)/2
         self.save_half_width = self.half_width
+        
         self.base.freeze_axes()
 
+
     def moveend(self, ev):
-        
+        """
+            After a dragging motion reset the flag self.has_move to False
+        """
         self.has_move=False
         self.base.moveend(ev)
             
+            
     def restore(self):
         """
@@ -538,6 +593,6 @@
         
         self.half_height= self.save_half_height
-        #self.half_width= math.fabs(self.x1-self.x2)/2
         self.half_width= self.save_half_width
+       
        
     def move(self, x, y, ev):
@@ -550,9 +605,13 @@
         
         self.half_width= math.fabs(self.x1-self.x2)/2
-        #print "Move vert: vertical width",self.half_width ,self.center_x
+        
         self.has_move=True
         self.base.base.update()
         
+        
     def set_cursor(self, x, y):
+        """
+            Update the figure given x and y 
+        """
         self.move(x, y, None)
         self.update()
@@ -560,4 +619,8 @@
         
     def get_params(self):
+        """
+            Store a copy of values of parameters of the slicer into a dictionary.
+            @return params: the dictionary created
+        """
         params = {}
         params["x"] = self.x1
@@ -567,9 +630,16 @@
     
     def set_params(self, params):
+        """
+            Receive a dictionary and reset the slicer with values contained 
+            in the values of the dictionary.
+            @param params: a dictionary containing name of slicer parameters and 
+            values the user assigned to the slicer.
+        """
         x = params["x"] 
         y = params["y"] 
         self.update(x=x, y=y, center_x=None,center_y=None)
 
-class Horizontal_DoubleLine(_BaseInteractor):
+
+class HorizontalDoubleLine(_BaseInteractor):
     """
          Select an annulus through a 2D plot
@@ -580,7 +650,8 @@
         
         _BaseInteractor.__init__(self, base, axes, color=color)
+        ## Initialization the class 
         self.markers = []
         self.axes = axes
-        # center
+        ## Center coordinates
         self.center_x = center_x
         self.center_y = center_y
@@ -623,8 +694,8 @@
             message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
             message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
-            #raise "Version error", message
-            
-        # line
+            owner=self.base.base.parent
+            wx.PostEvent(owner, StatusEvent(status="AnnulusSlicer: %s"%message))
+            
+        # Define 2 horizotnal lines
         self.top_line = self.axes.plot([self.x1,-self.x1],[self.y1,self.y1],
                                       linestyle='-', marker='',
@@ -635,7 +706,7 @@
                                       color=self.color,
                                       visible=True)[0]
-    
-        self.npts = 30
+        ## Flag to determine if the lines have moved
         self.has_move=False    
+        ## connection the marker and draw the pictures 
         self.connect_markers([self.top_marker])
         self.update()
@@ -643,8 +714,16 @@
 
     def set_layer(self, n):
+        """
+            Allow adding plot to the same panel
+            @param n: the number of layer
+        """
         self.layernum = n
         self.update()
         
+        
     def clear(self):
+        """
+            Clear this figure and its markers
+        """
         self.clear_markers()
         try:
@@ -656,18 +735,24 @@
             for item in range(len(self.axes.lines)):
                 del self.axes.lines[0]
-        
-    def get_radius(self):
-        
-        return 0
+    
    
     def update(self,x1=None,x2=None, y1=None,y2=None,width=None,height=None, center=None):
         """
-        Draw the new roughness on the graph.
-        """
-        #print "self.half_width",self.half_width
-        if width!=None:
-            self.half_width= width
-        if height!=None:
+            Draw the new roughness on the graph.
+            @param x1: new maximum value of x coordinates
+            @param x2: new minimum value of x coordinates
+            @param y1: new maximum value of y coordinates
+            @param y2: new minimum value of y coordinates
+            @param width: is the width of the new rectangle
+            @param height: is the height of the new rectangle
+            @param center: provided x, y  coordinates of the center point
+        """
+        ## save the new height, witdh of the rectangle if given as a param
+        if width != None:
+            self.half_width = width
+        if height!= None:
             self.half_height= height
+        ## If new  center coordinates are given draw the rectangle 
+        ##given these value 
         if center!=None:
             self.center_x= center.x
@@ -684,4 +769,5 @@
             self.bottom_line.set(xdata=[self.x1,self.x2], ydata=[self.y2,self.y2])
             return 
+        ## if x1, y1, y2, y3 are given draw the rectangle with this value
         if x1 !=None: 
             self.x1= x1
@@ -692,6 +778,5 @@
         if y2 !=None: 
             self.y2= y2
-       
-             
+        ## Draw 2 vertical lines and a marker 
         self.top_marker.set(xdata=[self.center_x],ydata=[self.y1])
         self.top_line.set(xdata=[self.x1,self.x2], ydata=[self.y1,self.y1])
@@ -699,5 +784,4 @@
        
         
-        
     def save(self, ev):
         """
@@ -717,7 +801,10 @@
 
     def moveend(self, ev):
-        
+        """
+            After a dragging motion reset the flag self.has_move to False
+        """
         self.has_move=False
         self.base.moveend(ev)
+           
             
     def restore(self):
@@ -732,4 +819,5 @@
         self.half_height= self.save_half_height
         self.half_width= self.save_half_width
+        
         
     def move(self, x, y, ev):
@@ -744,5 +832,9 @@
         self.base.base.update()
         
+        
     def set_cursor(self, x, y):
+        """
+            Update the figure given x and y 
+        """
         self.move(x, y, None)
         self.update()
@@ -750,13 +842,25 @@
         
     def get_params(self):
+        """
+            Store a copy of values of parameters of the slicer into a dictionary.
+            @return params: the dictionary created
+        """
         params = {}
         params["x"] = self.x
         params["y"] = self.y
-        
         return params
     
+    
     def set_params(self, params):
+        """
+            Receive a dictionary and reset the slicer with values contained 
+            in the values of the dictionary.
+            @param params: a dictionary containing name of slicer parameters and 
+            values the user assigned to the slicer.
+        """
         x = params["x"] 
         y = params["y"] 
         self.update(x=x, y=y, center_x=None,center_y=None)
          
+         
+         
Index: guiframe/local_perspectives/plotting/detector_dialog.py
===================================================================
--- guiframe/local_perspectives/plotting/detector_dialog.py	(revision 9a585d01f17990dcd3d4cedb59a1a9708cbe22fd)
+++ guiframe/local_perspectives/plotting/detector_dialog.py	(revision eba08f1a43992e4ce1b52d3a3dd206926fdeb56a)
@@ -8,4 +8,6 @@
 from sans.guiframe.utils import format_number
 from sans.guicomm.events import StatusEvent ,NewPlotEvent,SlicerEvent
+
+
 class DetectorDialog(wx.Dialog):
     """
@@ -17,4 +19,5 @@
         kwds["style"] = wx.DEFAULT_DIALOG_STYLE
         wx.Dialog.__init__(self,parent,id=1, *args, **kwds)
+    
         self.parent=base
         self.label_xnpts = wx.StaticText(self, -1, "Detector width in pixels")
@@ -24,10 +27,5 @@
         self.label_zmax = wx.StaticText(self, -1, "Max amplitude for color map (optional)")
         self.label_beam = wx.StaticText(self, -1, "Beam stop radius in units of q")
-        #self.label_sym  = wx.StaticText(self, -1, 'Use 4-fold symmetry')
-        
-        # Npts, q max
-        #self.npts_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        #self.qmax_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        #self.beam_ctl = wx.TextCtrl(self, -1, size=(60,20))
+        
         self.xnpts_ctl = wx.StaticText(self, -1, "")
         self.ynpts_ctl = wx.StaticText(self, -1, "")
@@ -37,6 +35,5 @@
         self.zmin_ctl = wx.TextCtrl(self, -1, size=(60,20))
         self.zmax_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        #self.chk_sym  = wx.CheckBox(self, -1, '')
-
+    
         self.static_line_3 = wx.StaticLine(self, -1)
         
@@ -61,4 +58,8 @@
         
     def checkValues(self, event):
+        """
+            Check the valitidity of zmin and zmax value
+            zmax should be a float and zmin less than zmax
+        """
         flag = True
         try:
@@ -97,9 +98,19 @@
     
     def setContent(self, xnpts,ynpts, qmax, beam,zmin=None,zmax=None, sym=False):
+        """
+            received value and displayed them
+            @param xnpts: the number of point of the x_bins of data
+            @param ynpts: the number of point of the y_bins of data
+            @param qmax: the maxmimum value of data pixel
+            @param beam : the radius of the beam
+            @param zmin:  the value to get the minimum color
+            @param zmax:  the value to get the maximum color
+            @param sym:
+        """
         self.xnpts_ctl.SetLabel(str(format_number(xnpts)))
         self.ynpts_ctl.SetLabel(str(format_number(ynpts)))
         self.qmax_ctl.SetLabel(str(format_number(qmax)))
         self.beam_ctl.SetLabel(str(format_number(beam)))
-        #self.chk_sym.SetValue(sym)
+       
         if zmin !=None:
             self.zmin_ctl.SetValue(str(format_number(zmin)))
@@ -108,10 +119,9 @@
 
     def getContent(self):
+        """
+            @return event containing value to reset the detector of a given data
+        """
         event = self.Event()
-        #event.npts = int(self.npts_ctl.GetValue())
-        #event.qmax = float(self.qmax_ctl.GetValue())
-        #event.beam = float(self.beam_ctl.GetValue())
-        #event.sym4 = self.chk_sym.GetValue()
-        
+       
         t_min = self.zmin_ctl.GetValue()
         t_max = self.zmax_ctl.GetValue()
@@ -137,8 +147,15 @@
 
     def __set_properties(self):
+        """
+            set proprieties of the dialog window
+        """
         self.SetTitle("Detector parameters")
         self.SetSize((600, 595))
 
+
     def __do_layout(self):
+        """
+            fill the dialog window .
+        """
         sizer_main = wx.BoxSizer(wx.VERTICAL)
         sizer_button = wx.BoxSizer(wx.HORIZONTAL)
@@ -164,7 +181,5 @@
         sizer_params.Add(self.zmax_ctl,   (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         iy += 1
-        #sizer_params.Add(self.label_sym,  (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        #sizer_params.Add(self.chk_sym,    (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-
+       
         sizer_main.Add(sizer_params, 0, wx.EXPAND|wx.ALL, 10)
         sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0)
Index: guiframe/local_perspectives/plotting/last_boxSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/last_boxSlicer.py	(revision 6d920cd2a2b96abc4845a5766911d8ef7fe5adc5)
+++ 	(revision )
@@ -1,613 +1,0 @@
-#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
-#      before pushing a new 1D data update.
-
-#
-#TODO: NEED MAJOR REFACTOR
-#
-
-
-# Debug printout
-#from config import printEVT
-from BaseInteractor import _BaseInteractor
-from copy import deepcopy
-import math
-
-from sans.guicomm.events import NewPlotEvent, StatusEvent,SlicerParameterEvent,EVT_SLICER_PARS
-import SlicerParameters
-import wx
-
-
-class BoxInteractor(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=3,
-                  x_min=0.0025, x_max=0.0025, y_min=0.0025, y_max=0.0025):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self.qmax = self.base.data2D.xmax
-        self.connect = self.base.connect
-        self.x= 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))
-        self.y= 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin))        
-         
-        self.theta2= math.pi/3
-        ## Number of points on the plot
-        self.nbins = 30
-        self.count=0
-        self.error=0
-        self.averager=None
-        self.left_line = VerticalLine(self, self.base.subplot,color='blue', 
-                                      zorder=zorder,
-                                        ymin= -self.y , 
-                                        ymax= self.y ,
-                                        xmin= -self.x,
-                                        xmax= -self.x)
-        self.left_line.qmax = self.qmax
-        
-        self.right_line= VerticalLine(self, self.base.subplot,color='black', 
-                                      zorder=zorder,
-                                     ymin= -self.y , 
-                                     ymax= self.y,
-                                     xmin= self.x,
-                                     xmax= self.x)
-        self.right_line.qmax = self.qmax
-        
-        self.top_line= HorizontalLine(self, self.base.subplot,color='green', 
-                                      zorder=zorder,
-                                      xmin= -self.x,
-                                      xmax= self.x,
-                                      ymin= self.y,
-                                      ymax= self.y)
-        self.top_line.qmax= self.qmax
-        
-        self.bottom_line= HorizontalLine(self, self.base.subplot,color='gray', 
-                                      zorder=zorder,
-                                      xmin= -self.x,
-                                      xmax= self.x,
-                                      ymin= -self.y,
-                                      ymax= -self.y)
-        self.bottom_line.qmax= self.qmax
-        
-        self.update()
-        self._post_data()
-        
-        # Bind to slice parameter events
-        self.base.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
-
-
-    def _onEVT_SLICER_PARS(self, event):
-        wx.PostEvent(self.base, StatusEvent(status="BoxSlicer._onEVT_SLICER_PARS"))
-        event.Skip()
-        if event.type == self.__class__.__name__:
-            self.set_params(event.params)
-            self.base.update()
-
-    def update_and_post(self):
-        self.update()
-        self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.averager=None
-        self.clear_markers()
-        self.left_line.clear()
-        self.right_line.clear()
-        self.top_line.clear()
-        self.bottom_line.clear()
-        #self.base.connect.disconnect()
-        self.base.Unbind(EVT_SLICER_PARS)
-        
-    def update(self):
-        """
-        Respond to changes in the model by recalculating the profiles and
-        resetting the widgets.
-        """
-        
-        if self.top_line.has_move:
-            #print"top has moved"
-            self.top_line.update()
-            self.bottom_line.update(ymin= -self.top_line.y1,
-                                    ymax= -self.top_line.y2)
-            self.left_line.update(ymin= -self.top_line.y1,
-                                    ymax= -self.top_line.y2)
-            self.right_line.update(ymin= -self.top_line.y1,
-                                    ymax= -self.top_line.y2)
-           
-        if self.bottom_line.has_move:
-            #print "bottom has move"
-            self.bottom_line.update()
-            self.top_line.update(ymin= -self.bottom_line.y1,
-                                    ymax= -self.bottom_line.y2)
-            self.left_line.update(ymin= self.bottom_line.y1,
-                                    ymax= self.top_line.y1)
-            self.right_line.update(ymin= self.bottom_line.y1,
-                                    ymax=self.top_line.y1)
-           
-        if self.left_line.has_move:
-           
-            self.left_line.update()
-            self.right_line.update(xmin = - self.left_line.x1,
-                                   xmax = - self.left_line.x1)
-            self.bottom_line.update(xmin=  self.left_line.x1,
-                                     xmax= self.right_line.x1)
-            self.top_line.update(xmin= self.left_line.x1,
-                                    xmax= self.right_line.x1)
-           
-        if self.right_line.has_move:
-           
-            self.right_line.update()
-            self.left_line.update(xmin = -self.right_line.x1,
-                                   xmax = -self.right_line.x1)
-            
-            self.bottom_line.update(xmin= self.left_line.x1,
-                                 xmax= self.right_line.x1)
-            
-            self.top_line.update(xmin= self.left_line.x1,
-                                    xmax= self.right_line.x1)
-               
-            
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.base.freeze_axes()
-        self.left_line.save(ev)
-        self.right_line.save(ev)
-        self.top_line.save(ev)
-        self.bottom_line.save(ev)
-    def _post_data(self):
-        pass
-        
-    
-    def post_data(self,new_slab=None , nbins=None):
-        """ post data averaging in Q"""
-        x_min= min(self.left_line.x1, self.right_line.x1)
-        x_max= max(self.left_line.x1, self.right_line.x1)
-        
-        y_min= min(self.top_line.y1, self.bottom_line.y1)
-        y_max= max(self.top_line.y1, self.bottom_line.y1)  
-        
-        if nbins !=None:
-            self.nbins
-        if self.averager==None:
-            if new_slab ==None:
-                raise ValueError,"post data:cannot average , averager is empty"
-            self.averager= new_slab
-        bin_width= (x_max + math.fabs(x_min))/self.nbins
-        
-        box = self.averager( x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max,
-                         bin_width=bin_width)
-        
-        boxavg = box(self.base.data2D)
-        
-        from sans.guiframe.dataFitting import Data1D
-        if hasattr(boxavg,"dxl"):
-            dxl= boxavg.dxl
-        else:
-            dxl= None
-        if hasattr(boxavg,"dxw"):
-            dxw=boxavg.dxw
-        else:
-            dxw= None
-       
-        new_plot = Data1D(x=boxavg.x,y=boxavg.y,dy=boxavg.dy,dxl=dxl,dxw=dxw)
-        new_plot.name = str(self.averager.__name__) +"("+ self.base.data2D.name+")"
-        
-       
-
-        new_plot.source=self.base.data2D.source
-        new_plot.interactive = True
-        #print "loader output.detector",output.source
-        new_plot.detector =self.base.data2D.detector
-        # If the data file does not tell us what the axes are, just assume...
-        new_plot.xaxis("\\rm{Q}", 'rad')
-        new_plot.yaxis("\\rm{Intensity} ","cm^{-1}")
-        new_plot.group_id = str(self.averager.__name__)+self.base.data2D.name
-        new_plot.id = str(self.averager.__name__)
-        wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot,
-                                                 title=str(self.averager.__name__) ))
-        
-        
-    def _post_data(self):
-        # Compute data
-        data = self.base.data2D
-        from DataLoader.manipulations import  Boxavg
-        radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))
-        self.x= math.fabs(self.right_line.x1)
-        self.y= math.fabs(self.top_line.y1 )
-       
-        box =  Boxavg (x_min=-self.x, x_max=self.x, y_min=-self.y, y_max=self.y)
-       
-        self.count, self.error= box(self.base.data2D)
-        
-        #print "post data"
-              
-                                       
-    def moveend(self, ev):
-        self.base.thaw_axes()
-        
-        # Post paramters
-        event = SlicerParameterEvent()
-        event.type = self.__class__.__name__
-        event.params = self.get_params()
-        wx.PostEvent(self.base.parent, event)
-
-        self._post_data()
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.left_line.restore()
-        self.right_line.restore()
-        self.top_line.restore()
-        self.bottom_line.restore()
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        pass
-        
-    def set_cursor(self, x, y):
-        pass
-        
-    def get_params(self):
-        params = {}
-        params["x_max"]= math.fabs(self.right_line.x1)
-        params["y_max"]= math.fabs(self.top_line.y1)
-        params["nbins"]= self.nbins
-        params["errors"] = self.error
-        params["count"]= self.count
-        return params
-    
-    def set_params(self, params):
-        
-        self.x = float(math.fabs(params["x_max"]))
-        self.y = float(math.fabs(params["y_max"] ))
-        self.nbins=params["nbins"]
-        self.left_line.update(xmin= -1*self.x,
-                              xmax = -1*self.x,
-                              ymin= -self.y,
-                              ymax=  self.y, 
-                              )
-        self.right_line.update(xmin= self.x,
-                              xmax = self.x,
-                              ymin= -self.y,
-                              ymax=  self.y, 
-                              )
-        self.top_line.update(xmin= -1*self.x,
-                             xmax= self.x,
-                             ymin= self.y,
-                             ymax= self.y)
-        self.bottom_line.update(xmin= -1*self.x,
-                                 xmax= self.x,
-                                 ymin= -1*self.y,
-                                 ymax= -1*self.y)
-       
-        self.post_data( nbins=None)
-    def freeze_axes(self):
-        self.base.freeze_axes()
-        
-    def thaw_axes(self):
-        self.base.thaw_axes()
-
-    def draw(self):
-        self.base.draw()
-
-class HorizontalLine(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5,mline=None,ymin=None, ymax=None, y=0.5,
-                 xmin=0.0,xmax=0.5):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self.x1= xmax
-        self.save_x1= xmax
-        
-        self.x2= xmin
-        self.save_x2= xmin
-        
-        self.y1= ymax
-        self.save_y1= ymax
-        
-        self.y2= ymin
-        self.save_y2= ymin
-        self.mline= mline
-        try:
-            # Inner circle marker
-            self.inner_marker = self.axes.plot([0],[self.y1], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          pickradius=5, label="pick", 
-                                          zorder=zorder, # Prefer this to other lines
-                                          visible=True)[0]
-        except:
-            self.inner_marker = self.axes.plot([0],[self.y1], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          label="pick", 
-                                          visible=True)[0]
-            message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
-            message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
-        self.line = self.axes.plot([self.x1,-self.x1],
-                                   [self.y1,self.y2],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
-        
-        self.npts = 20
-        self.has_move=False
-        self.connect_markers([self.line, self.inner_marker])
-        self.update()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-   
-    def get_radius(self):
-        
-        return 0
-   
-    def update(self,xmin=None, xmax=None,ymin=None,ymax=None, mline=None,translation=False):
-        """
-        Draw the new roughness on the graph.
-        """
-        if xmin !=None:
-            self.x1 = xmin
-        if ymin !=None:
-            self.y1 = ymin
-        self.inner_marker.set(xdata=[0],ydata=[self.y1])
-        self.line.set(xdata=[self.x1,-self.x1],
-                       ydata=[self.y1,self.y1])
-    
-        
-        
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.save_x1= self.x1
-        self.save_x2= self.x2
-       
-        self.save_y1= self.y1
-        self.save_y2= self.y2
-    
-        
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-       
-        self.has_move=False
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.x1 = self.save_x1
-        self.x2 = self.save_x2
-        self.y1 = self.save_y1
-        self.y2 = self.save_y2
-        
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        #print "horizontal move x y "
-        self.y1= y
-        self.has_move=True
-        self.base.base.update()
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        params = {}
-        params["radius"] = self.x1
-        #params["theta"] = self.xmax
-        return params
-    
-    def set_params(self, params):
-
-        x = params["radius"] 
-        self.set_cursor(x, self._inner_mouse_y)
-        
-
-
-
-class VerticalLine(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5, mline=None, ymin=0.0, 
-                 ymax=0.5,xmin=-0.5,xmax=0.5
-                 ):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        
-        self.x1= xmax
-        self.x2= xmin
-        self.y1= ymax
-        self.y2= ymin
-        try:
-            # Inner circle marker
-            self.inner_marker = self.axes.plot([self.x1],[0], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          pickradius=5, label="pick", 
-                                          zorder=zorder, # Prefer this to other lines
-                                          visible=True)[0]
-        except:
-            self.inner_marker = self.axes.plot([self.x1],[0], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          label="pick", 
-                                          visible=True)[0]
-            message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
-            message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
-        self.line = self.axes.plot([self.x1,self.x2],[self.y1,self.y2],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
-      
-        self.has_move=False
-        self.connect_markers([self.line, self.inner_marker])
-        self.update()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-   
-    
-    def get_radius(self):
-        return 0
-    
-    def update(self,xmin=None,xmax=None,ymin=None, ymax=None, opline=None,translation=False):
-        """
-        Draw the new roughness on the graph.
-        """
-
-   
-        if xmin!=None:
-            self.x1=xmin
-        if ymin!=None:
-            self.y1=ymin
-        self.inner_marker.set(xdata=[self.x1],ydata=[0]) 
-        self.line.set(xdata=[self.x1,self.x1],
-                       ydata=[self.y1,-self.y1]) 
-        
-    
-        
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.save_x1= self.x1
-        self.save_x2= self.x2
-        self.save_y1= self.y1
-        self.save_y2= self.y2
-        
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-        
-        self.has_move=False
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.x1 = self.save_x1
-        self.x2 = self.save_x2
-        self.y1 = self.save_y1
-        self.y2= self.save_y2
-      
-        
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        self.has_move=True
-        
-        # compute the b intercept of the vertical line
-        self.x1= x
-        
-        
-        self.base.base.update()
-        
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        params = {}
-        params["x"] = self.xmin
-        params["ymin"] = self.ymin
-        params["ymax"] = self.ymax
-        return params
-    
-    def set_params(self, params):
-        """
-            Draw a vertical line given some value of params
-            @param params: a dictionary containing value for x, ymin , ymax to draw 
-            a vertical line
-        """
-        x = params["x"] 
-        ymin = params["ymin"] 
-        ymax = params["ymax"] 
-        #self.set_cursor(x, self._inner_mouse_y)
-        self.update(self,x =x,ymin =ymin, ymax =ymax)
-        
-
-class BoxInteractorX(BoxInteractor):
-    def __init__(self,base,axes,color='black', zorder=3):
-        BoxInteractor.__init__(self, base, axes, color=color)
-        self.base=base
-        self._post_data()
-    def _post_data(self):
-        from DataLoader.manipulations import SlabX
-        self.post_data(SlabX )   
-        
-
-class BoxInteractorY(BoxInteractor):
-    def __init__(self,base,axes,color='black', zorder=3):
-        BoxInteractor.__init__(self, base, axes, color=color)
-        self.base=base
-        self._post_data()
-    def _post_data(self):
-        from DataLoader.manipulations import SlabY
-        self.post_data(SlabY )   
-        
-        
Index: guiframe/local_perspectives/plotting/old_ boxSum.py
===================================================================
--- guiframe/local_perspectives/plotting/old_ boxSum.py	(revision 0d9dae840601f23ae4dd0b9e0317056593727f90)
+++ 	(revision )
@@ -1,510 +1,0 @@
-#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
-#      before pushing a new 1D data update.
-
-#
-#TODO: NEED MAJOR REFACTOR
-#
-
-
-# Debug printout
-import math
-import wx
-from copy import deepcopy
-
-from BaseInteractor import _BaseInteractor
-from sans.guicomm.events import NewPlotEvent, StatusEvent,SlicerParameterEvent,EVT_SLICER_PARS
-class BoxSum(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=3, x_min=0.0025, x_max=0.0025, y_min=0.0025, y_max=0.0025):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self.qmax = self.base.data2D.xmax
-        self.connect = self.base.connect
-        
-        self.xmin= -1* x_min
-        self.ymin= -1* y_min
-        self.xmax= x_max
-        self.ymax=  y_max
-        # center of the figure
-        self.center_x= 0.0
-        self.center_y= 0.0
-       
-        ## Number of points on the plot
-        self.nbins = 20
-        self.count=0
-        self.error=0
-        
-        self.left_line = VerticalLine(self, self.base.subplot,color='blue', zorder=zorder, 
-                                        ymin= self.ymin, ymax= self.ymax,
-                                        x= self.xmin,
-                                        center_x= self.center_x,
-                                        center_y= self.center_y)
-        self.left_line.qmax = self.qmax
-        
-        self.right_line= VerticalLine(self, self.base.subplot,color='black', zorder=zorder,
-                                     ymin= self.ymin, ymax= self.ymax,
-                                     x=self.xmax,
-                                     center_x= self.center_x,
-                                     center_y= self.center_y)
-        self.right_line.qmax = self.qmax
-        
-        self.top_line= HorizontalLine(self, self.base.subplot,color='green', zorder=zorder,
-                                    y= self.ymax,
-                                    xmin= self.xmin, xmax= self.xmax,
-                                    center_x= self.center_x,
-                                    center_y= self.center_y)
-        self.top_line.qmax = self.qmax
-        
-        self.bottom_line= HorizontalLine(self, self.base.subplot,color='red', zorder=zorder,
-                                    y =self.ymin,
-                                    xmin= self.xmin, xmax= self.xmax,
-                                    center_x= self.center_x,
-                                    center_y= self.center_y)
-        self.bottom_line.qmax = self.qmax
-        #self.outer_circle.set_cursor(self.base.qmax/1.8, 0)
-        
-        self.connect_markers([])
-                      
-        self.update()
-        self._post_data()
-        
-        # Bind to slice parameter events
-        self.base.parent.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
-
-
-    def _onEVT_SLICER_PARS(self, event):
-        #printEVT("AnnulusSlicer._onEVT_SLICER_PARS")
-        event.Skip()
-        if event.type == self.__class__.__name__:
-            self.set_params(event.params)
-            self.base.update()
-
-    def update_and_post(self):
-        self.update()
-        self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        self.left_line.clear()
-        self.right_line.clear()
-        self.top_line.clear()
-        self.bottom_line.clear()
-        
-        #self.base.connect.disconnect()
-        self.base.parent.Unbind(EVT_SLICER_PARS)
-        
-    def update(self):
-        """
-        Respond to changes in the model by recalculating the profiles and
-        resetting the widgets.
-        """
-        if self.left_line.has_move:
-            print "left has moved"
-            self.left_line.update(mline=[self.center_x, self.center_y],translation=True)
-            
-            #self.right_line.update(mline= [self.center_x, self.center_y],translation=True)
-            self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x,
-                                  mline= [self.center_x, self.center_y],translation=True)
-            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x,
-                                    mline= [self.center_x, self.center_y],translation=True)
-        if self.right_line.has_move:
-            print "right has moved"
-            self.right_line.update(mline= [self.center_x, self.center_y],translation=True)
-            #self.left_line.update(mline=[self.center_x, self.center_y],translation=True)
-            #self.left_line.update(xmin= self.right_line.x ,xmax=-1*self.right_line.x)
-            self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x,
-                                  mline= [self.center_x, self.center_y],translation=True)
-            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x,
-                                    mline= [self.center_x, self.center_y],translation=True)
-            
-            
-        if self.bottom_line.has_move:
-            print "bottom has moved"
-            self.bottom_line.update(mline= [self.center_x, self.center_y],translation=True)
-            #self.top_line.update(y= -1*self.top_line.y,translation=True)
-            self.left_line.update( ymin= self.bottom_line.y ,ymax= self.top_line.y,
-                                   mline= [self.center_x, self.center_y],translation=True)
-            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
-                                   mline= [self.center_x, self.center_y],translation=True)
-            
-        if self.top_line.has_move:
-            print "top has moved"
-            self.top_line.update(mline= [self.center_x, self.center_y],translation=True)
-            
-            #self.bottom_line.update(y= -1*self.top_line.y,mline= [self.center_x, self.center_y],
-            #                        translation=True )
-            self.left_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
-                                  mline= [self.center_x, self.center_y],translation=True)
-            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
-                                   mline= [self.center_x, self.center_y],translation=True)
-            
-    
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.base.freeze_axes()
-        self.inner_circle.save(ev)
-        self.outer_circle.save(ev)
-
-    def _post_data(self):
-        # Compute data
-        data = self.base.data2D
-        from DataLoader.manipulations import  Boxavg
-        radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))
-        x_min= self.left_line.x 
-        x_max= self.right_line.x 
-        y_min= self.bottom_line.y
-        y_max= self.top_line.y
-        box =  Boxavg (x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max)
-        self.count, self.error = box(self.base.data2D)
-        print "count, error",self.count, self.error
-        
-                                       
-    def moveend(self, ev):
-        self.base.thaw_axes()
-        
-        # Post paramters
-        event = SlicerParameterEvent()
-        event.type = self.__class__.__name__
-        print "event type boxsum: ", event.type
-        event.params = self.get_params()
-        
-        wx.PostEvent(self.base.parent, event)
-
-        self._post_data()
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.inner_circle.restore()
-        self.outer_circle.restore()
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        print "in move"
-        if self.xmin <= x and x <= self.xmax:
-            print "has move whole", x
-        
-    def set_cursor(self, x, y):
-        pass
-        
-    def get_params(self):
-        params = {}
-        params["x_min"] = self.left_line.x 
-        params["x_max"] = self.right_line.x 
-        params["y_min"] = self.bottom_line.y
-        params["y_max"] = self.top_line.y
-        params["count"] = self.count
-        params["errors"]= self.error
-        return params
-    
-    
-    def get_result(self):
-        """
-            return the result of box summation
-        """
-        result={}
-        result["count"] = self.count
-        result["error"] = self.error
-        return result
-        
-        
-    def set_params(self, params):
-        
-        x_min = -math.fabs(params["x_min"] )
-        x_max = math.fabs(params["x_max"] )
-        y_min = -math.fabs(params["y_min"])
-        y_max = math.fabs(params["y_max"]) 
-        
-        self.left_line.update(ymin= y_min ,ymax= y_max , x= x_min)
-        self.right_line.update(ymin= y_min ,ymax= y_max, x= x_max)
-        self.top_line.update( xmin= x_min ,xmax= x_max, y= y_max)
-        self.bottom_line.update(xmin= x_min ,xmax= x_max, y=y_min)
-        """
-        self.left_line.update(mline= [center_x, center_y],ymin= y_min ,ymax= y_max)
-        self.right_line.update(mline= [center_x, center_y],ymin= y_min ,ymax= y_max)
-        self.top_line.update(mline= [center_x, center_y], xmin= x_min ,xmax= xmax)
-        self.bottom_line.update(mline= [center_x, center_y],xmin= xmin ,xmax= xmax)
-        """
-        
-        self._post_data()
-    def freeze_axes(self):
-        self.base.freeze_axes()
-        
-    def thaw_axes(self):
-        self.base.thaw_axes()
-
-    def draw(self):
-        self.base.draw()
-class HorizontalLine(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5, y=0.5,
-                 xmin=0.0,xmax=0.5,
-                 center_x= 0.0,
-                 center_y= 0.0):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        # center
-        self.center_x = center_x
-        self.center_y = center_y
-        
-        self.y= y - self.center_y
-        self.save_y= y- self.center_y
-        
-        self.xmin = xmin - self.center_x
-        self.save_xmin = xmin - self.center_x
-        self.xmax = xmax - self.center_x
-        self.save_xmax = xmax - self.center_x
-        
-       
-        self.line = self.axes.plot([self.xmin,self.xmax],[self.y,self.y],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
- 
-
-        self.npts = 20
-        self.has_move=False
-        self.connect_markers([self.line])
-        self.update()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-        
-    def get_radius(self):
-        
-        return 0
-   
-    def update(self,xmin=None, xmax=None,y=None, mline=None,translation=False):
-        """
-        Draw the new roughness on the graph.
-        """
-        #print "update main line", self.has_move
-        if xmin !=None:
-            self.xmin = xmin # - self.center_x
-        if xmax !=None:
-            self.xmax = xmax #- self.center_x
-        if y !=None:
-            self.y = y #- self.center_y
-        
-        self.line.set(xdata=[self.xmin,self.xmax], ydata=[self.y,self.y])
-     
-        
-        
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.save_xmin= self.xmin
-        self.save_xmax= self.xmax
-       
-        self.save_y= self.y
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-        
-        self.has_move=False
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.y= self.save_y
-       
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        self.y= y - self.center_y
-        
-        self.has_move=True
-        self.base.base.update()
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        params = {}
-        params["radius"] = self.xmin
-        params["theta"] = self.xmax
-        
-        return params
-    
-    def set_params(self, params):
-
-        x = params["radius"] 
-        self.set_cursor(x, self._inner_mouse_y)
-        
-
-
-
-class VerticalLine(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5, ymin=0.0, 
-                 ymax=0.5,x= 0.5,
-                   center_x= 0,
-                 center_y= 0):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        # x coordinate of the vertical line
-        self.center_x= center_x
-        self.center_y= center_y
-        self.x = x - center_x
-        self.save_x = x - center_x
-        # minimum value of y coordinate of the vertical line 
-        self.ymin = ymin - center_y
-        self.save_ymin = ymin - center_y
-        # maximum value of y coordinate of the vertical line 
-        self.ymax= ymax - center_y
-        self.save_ymax= ymax - center_y
-        
-        # Draw vertical line
-        self.line = self.axes.plot([self.x,self.x],[self.ymin,self.ymax],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
-      
-        self.npts = 20
-        # Check vertical line motion
-        self.has_move=False
-        self.connect_markers([self.line])
-        self.update()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-        
-    def get_radius(self):
-        return 0
-    
-    def update(self,x=None,ymin=None, ymax=None, mline=None,translation=False):
-        """
-        Draw the new roughness on the graph.
-        """
-        if x!=None:
-            self.x = x #-self.center_x
-        if ymin !=None:
-            self.ymin = ymin #- self.center_y
-        if ymax !=None:
-            self.ymax = ymax #- self.center_y
-        
-        self.line.set(xdata=[self.x,self.x], ydata=[self.ymin,self.ymax])
-     
-        
-        
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.save_x= self.x
-        self.save_ymin= self.ymin
-        self.save_ymax= self.ymax
-        
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-        
-        self.has_move=False
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.x = self.save_x
-        
-        self.ymin=self.save_ymin
-        self.ymax=self.save_ymax
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        self.x = x - self.center_x
-       
-        self.has_move=True
-        self.base.base.update()
-        
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        params = {}
-        params["x"] = self.xmin
-        params["ymin"] = self.ymin
-        params["ymax"] = self.ymax
-        return params
-    
-    def set_params(self, params):
-        """
-            Draw a vertical line given some value of params
-            @param params: a dictionary containing value for x, ymin , ymax to draw 
-            a vertical line
-        """
-        x = params["x"] 
-        ymin = params["ymin"] 
-        ymax = params["ymax"] 
-        #self.set_cursor(x, self._inner_mouse_y)
-        self.update(self,x =x,ymin =ymin, ymax =ymax)
-        
-
-         
Index: guiframe/local_perspectives/plotting/old_boxSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/old_boxSlicer.py	(revision 0d9dae840601f23ae4dd0b9e0317056593727f90)
+++ 	(revision )
@@ -1,876 +1,0 @@
-#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
-#      before pushing a new 1D data update.
-
-#
-#TODO: NEED MAJOR REFACTOR
-#
-
-
-# Debug printout
-import math
-import wx
-from copy import deepcopy
-
-from BaseInteractor import _BaseInteractor
-from sans.guicomm.events import NewPlotEvent, StatusEvent,SlicerParameterEvent,EVT_SLICER_PARS
-
-
-def find_intersection(a1= 2, a2= -0.5,b1= 1,b2= 1 ):
-    """ @ return x, y  coordinates of an intersection between 2 lines
-        @param a1: the slope of the first line
-        @param a2 : the slope of the 2nd line
-        @param b1 : line intercept of the 1 st line
-        @param b2 : line intercept of the 2 nd ligne
-        @note 1st line equation  is y= a1*x +b1 ; 2nd line equation  is y= a2*x +b2 
-    """
-    x= ( b2- b1) /(a1- a2)
-    y= ( -a2*b1 + a1*b2 )/(a1 -a2)
-    return x, y
-class BoxInteractor(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=3,
-                  x_min=0.0025, x_max=0.0025, y_min=0.0025, y_max=0.0025):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self.qmax = self.base.qmax
-        self.connect = self.base.connect
-        self.xmin= -1* x_min
-        self.ymin= -1* y_min
-        
-        self.xmax= x_max
-        self.ymax=  y_max
-        
-        self.theta2= math.pi/3
-        ## Number of points on the plot
-        self.nbins = 20
-        self.count=0
-        self.error=0
-        self.main_line = LineInteractor(self, self.base.subplot,color='orange',
-                                         zorder=zorder, ymin=y_min ,ymax=y_max,
-                                           theta= self.theta2)
-        self.main_line.qmax = self.base.qmax
-        self.left_line = VerticalLine(self, self.base.subplot,color='blue', 
-                                      zorder=zorder,
-                                      mline= self.main_line, 
-                                        ymin= self.ymin , 
-                                        ymax= self.ymax ,
-                                        xmin=self.xmin,
-                                        xmax=self.xmin,
-                                        theta2= self.theta2)
-        self.left_line.qmax = self.base.qmax
-        
-        self.right_line= VerticalLine(self, self.base.subplot,color='black', 
-                                      zorder=zorder,
-                                      mline= self.main_line, 
-                                     ymin= self.ymin , 
-                                     ymax= self.ymax,
-                                    xmin= self.xmax,
-                                    xmax= self.xmax,
-                                    theta2= self.theta2)
-        self.right_line.qmax = self.base.qmax
-        
-        self.top_line= HorizontalLine(self, self.base.subplot,color='green', 
-                                      zorder=zorder,
-                                      mline= self.main_line,
-                                      xmin=self.right_line.x1,
-                                      xmax=self.left_line.x1,
-                                      ymin=self.right_line.y1,
-                                      ymax=self.left_line.y1)
-        self.top_line.qmax= self.base.qmax
-        
-        self.bottom_line= HorizontalLine(self, self.base.subplot,color='gray', 
-                                      zorder=zorder,
-                                      mline= self.main_line,
-                                      xmin=self.right_line.x2,
-                                      xmax=self.left_line.x2,
-                                      ymin=self.right_line.y2,
-                                      ymax=self.left_line.y2)
-        self.bottom_line.qmax= self.base.qmax
-        
-        self.update()
-        #self._post_data()
-        
-        # Bind to slice parameter events
-        self.base.parent.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
-
-
-    def _onEVT_SLICER_PARS(self, event):
-        #printEVT("AnnulusSlicer._onEVT_SLICER_PARS")
-        event.Skip()
-        if event.type == self.__class__.__name__:
-            #self.set_params(event.params)
-            self.base.update()
-
-    def update_and_post(self):
-        self.update()
-        self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-       
-       
-        self.main_line.clear()
-        #self.base.connect.disconnect()
-        self.base.parent.Unbind(EVT_SLICER_PARS)
-        
-    def update(self):
-        """
-        Respond to changes in the model by recalculating the profiles and
-        resetting the widgets.
-        """
-        
-        if self.main_line.has_move:
-            
-            self.main_line.update()
-            self.left_line.update(
-                                  xmin= self.xmin,
-                                  xmax= self.xmin,
-                                  ymin= self.ymin,
-                                  ymax=self.ymax
-                                  )
-            self.right_line.update(
-                                   xmin= self.xmax,
-                                  xmax= self.xmax,
-                                  ymin= self.ymin,
-                                  ymax=self.ymax)
-            self.top_line.update(xmin= self.right_line.x1,
-                                 xmax= self.left_line.x1,
-                                 ymin= self.right_line.y1,
-                                 ymax= self.left_line.y1)
-            self.bottom_line.update(xmin= self.right_line.x2,
-                                 xmax= self.left_line.x2,
-                                 ymin= self.right_line.y2,
-                                 ymax= self.left_line.y2)
-        if self.top_line.has_move:
-            print "top has moved",self.left_line.slope, self.top_line.slope
-            x2, y2= find_intersection(a1= self.left_line.slope,
-                                     a2= self.top_line.slope,
-                                     b1= self.left_line.b,
-                                     b2= self.top_line.b )
-            print "x, y max: ",x2,y2
-            x1, y1= find_intersection(a1= self.right_line.slope,
-                                     a2= self.top_line.slope,
-                                     b1= self.right_line.b,
-                                     b2= self.top_line.b )
-            print "x, y min: ",x1 ,y1
-            self.top_line.update(xmin= x2,
-                                 ymin= y2,
-                                 xmax= x1,
-                                 ymax= y1)
-            
-            self.bottom_line.update(xmin= -x2,
-                                    ymin= -y2,
-                                    xmax= -x1,
-                                    ymax= -y1)
-            self.left_line.update(xmin= -x1,
-                                  ymin= -y1,
-                                  xmax= x2,
-                                  ymax= y2,
-                                  translation= True)
-            self.right_line.update(
-                                   xmin= -x2,
-                                   ymin= -y2,
-                                   xmax= x1,
-                                   ymax= y1,
-                                  translation= True)
-            print "top has moved",self.left_line.slope, self.top_line.slope
-            x2, y2= find_intersection(a1= self.main_line.slope,
-                                     a2= self.top_line.slope,
-                                     b1= self.main_line.b,
-                                     b2= self.top_line.b )
-            print "main x, y max: ",x2,y2
-            x1, y1= find_intersection(a1= self.main_line.slope,
-                                     a2= self.bottom_line.slope,
-                                     b1= self.main_line.b,
-                                     b2= self.bottom_line.b )
-            print "main x, y min: ",x1,y1
-            self.main_line.update(x1= -x2,
-                                  y1= -y2,
-                                  x2= x2,
-                                  y2= y2,
-                                  translation= True)
-        if self.bottom_line.has_move:
-            
-            print "bottom has moved",self.left_line.slope, self.bottom_line.slope
-            x2, y2= find_intersection(a1= self.left_line.slope,
-                                     a2= self.bottom_line.slope,
-                                     b1= self.left_line.b,
-                                     b2= self.bottom_line.b )
-            print "x, y max: ",x2,y2
-            x1, y1= find_intersection(a1= self.right_line.slope,
-                                     a2= self.bottom_line.slope,
-                                     b1= self.right_line.b,
-                                     b2= self.bottom_line.b )
-            print "x, y min: ",x1 ,y1
-            self.bottom_line.update(xmin= x2,
-                                 ymin= y2,
-                                 xmax= x1,
-                                 ymax= y1)
-            
-            self.top_line.update(xmin= -x2,
-                                    ymin= -y2,
-                                    xmax= -x1,
-                                    ymax= -y1)
-            self.left_line.update(xmin= -x1,
-                                  ymin= -y1,
-                                  xmax= x2,
-                                  ymax= y2,
-                                  translation= True)
-            self.right_line.update(
-                                   xmin= -x2,
-                                   ymin= -y2,
-                                   xmax= x1,
-                                   ymax= y1,
-                                  translation= True)
-            print "bottom has moved",self.left_line.slope, self.bottom_line.slope
-            x2, y2= find_intersection(a1= self.main_line.slope,
-                                     a2= self.bottom_line.slope,
-                                     b1= self.main_line.b,
-                                     b2= self.bottom_line.b )
-            print "main x, y max: ",x2,y2
-            x1, y1= find_intersection(a1= self.main_line.slope,
-                                     a2= self.top_line.slope,
-                                     b1= self.main_line.b,
-                                     b2= self.top_line.b )
-            print "main x, y min: ",x1,y1
-            self.main_line.update(x1= -x2,
-                                  y1= -y2,
-                                  x2= x2,
-                                  y2= y2,
-                                  translation= True)
-        if self.left_line.has_move:
-            print "left_line has moved",self.left_line.slope, self.top_line.slope
-            x2, y2= find_intersection(a1= self.left_line.slope,
-                                     a2= self.top_line.slope,
-                                     b1= self.left_line.b,
-                                     b2= self.top_line.b )
-            print "main x, y max: ",x2,y2
-            x1, y1= find_intersection(a1= self.left_line.slope,
-                                     a2= self.bottom_line.slope,
-                                     b1= self.left_line.b,
-                                     b2= self.bottom_line.b )
-            self.left_line.update(xmin = x1,
-                                   xmax = x2,
-                                    ymin= y1, 
-                                    ymax= y2,
-                                   translation=True)
-            
-            self.right_line.update(xmin = -x1,
-                                   xmax = -x2,
-                                    ymin= -y1, 
-                                    ymax= -y2,
-                                   translation=True)
-            
-            self.bottom_line.update(xmin= x1,
-                                 ymin= y1,
-                                 xmax= -x2,
-                                 ymax= -y2)
-            
-            self.top_line.update(xmin= x2,
-                                    ymin= y2,
-                                    xmax= -x1,
-                                    ymax= -y1)
-            print "initial xmin", self.xmin
-            self.xmin= math.sqrt(math.pow((self.main_line.x2 - self.left_line.x2),2)\
-                                 +math.pow((self.main_line.y2 - self.left_line.y2),2))
-                                 
-            print "new xmin ", self.xmin, self.main_line.x2 , self.left_line.x2
-        if self.right_line.has_move:
-            print "right_line has moved",self.right_line.slope, self.top_line.slope
-            x2, y2= find_intersection(a1= self.right_line.slope,
-                                     a2= self.top_line.slope,
-                                     b1= self.right_line.b,
-                                     b2= self.top_line.b )
-            print "main x, y max: ",x2,y2
-            x1, y1= find_intersection(a1= self.right_line.slope,
-                                     a2= self.bottom_line.slope,
-                                     b1= self.right_line.b,
-                                     b2= self.bottom_line.b )
-            self.right_line.update(xmin = x1,
-                                   xmax = x2,
-                                    ymin= y1, 
-                                    ymax= y2,
-                                   translation=True)
-            
-            self.left_line.update(xmin = -x1,
-                                   xmax = -x2,
-                                    ymin= -y1, 
-                                    ymax= -y2,
-                                   translation=True)
-            
-            self.bottom_line.update(xmin= x1,
-                                 ymin= y1,
-                                 xmax= -x2,
-                                 ymax= -y2)
-            
-            self.top_line.update(xmin= x2,
-                                    ymin= y2,
-                                    xmax= -x1,
-                                    ymax= -y1)
-               
-            print "initial xmax", self.xmax
-            self.xmax= math.sqrt(math.pow((self.main_line.x2 - self.right_line.x2),2)\
-                                 +math.pow((self.main_line.y2 - self.right_line.y2),2))
-            print "new xmax",self.xmax
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.base.freeze_axes()
-        self.inner_circle.save(ev)
-        self.outer_circle.save(ev)
-
-    def _post_data(self):
-        # Compute data
-        #data = self.base.data2D
-        #from DataLoader.manipulations import  Boxavg
-        #radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))
-        #x_min= self.left_line.xmin 
-        #x_max= self.right_line.xmax 
-        #y_min= self.bottom_line.y
-        #y_max= self.top_line.y
-        #box =  Boxavg (x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max)
-       
-        #self.count, self.error= box(self.base.data2D)
-        
-        print "post data"
-              
-                                       
-    def moveend(self, ev):
-        self.base.thaw_axes()
-        
-        # Post paramters
-        event = SlicerParameterEvent()
-        event.type = self.__class__.__name__
-        #event.params = self.get_params()
-        wx.PostEvent(self.base.parent, event)
-
-        self._post_data()
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.inner_circle.restore()
-        self.outer_circle.restore()
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        pass
-        
-    def set_cursor(self, x, y):
-        pass
-        
-    def get_params(self):
-        params = {}
-        params["x1"]= self.xmax
-        params["y1"]= self.ymin
-        params["x2"]= self.xmin
-        params["y2"]= self.ymax
-        params["phi"] = self.main_line.theta
-        return params
-    
-    def set_params(self, params):
-        self.xmax = params["x1"]
-        self.ymin = params["y1"] 
-        self.xmin = params["x2"]
-        self.ymax = params["y2"]
-        theta = params["theta"]
-        print "theta setparams",theta
-        self.main_line.update(radius1= math.fabs(self.ymax), radius2= math.fabs(self.ymin), theta= theta)
-        self.left_line.update(xmin= -1*self.xmin)
-        self.right_line.update(xmin= self.xmax)
-        
-        self.top_line.update(xmin= self.right_line.x1,
-                                 xmax= self.left_line.x1,
-                                 ymin= self.right_line.y1,
-                                 ymax= self.left_line.y1)
-        self.bottom_line.update(xmin= self.right_line.x2,
-                                 xmax= self.left_line.x2,
-                                 ymin= self.right_line.y2,
-                                 ymax= self.left_line.y2)
-        self._post_data()
-    def freeze_axes(self):
-        self.base.freeze_axes()
-        
-    def thaw_axes(self):
-        self.base.thaw_axes()
-
-    def draw(self):
-        self.base.draw()
-
-class HorizontalLine(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5,mline=None,ymin=None, ymax=None, y=0.5,
-                 xmin=0.0,xmax=0.5,
-                 theta2= math.pi/3 ):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self.x1= xmax
-        self.save_x1= xmax
-        
-        self.x2= xmin
-        self.save_x2= xmin
-        
-        self.y1= ymax
-        self.save_y1= ymax
-        
-        self.y2= ymin
-        self.save_y2= ymin
-        self.mline= mline
-        self.line = self.axes.plot([self.x1,self.x2],
-                                   [self.y1,self.y2],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
-        
-        self.slope= -1/math.tan(self.mline.theta)
-        self.b= self.y1- self.slope* self.x1
-        self.save_b= self.b
-        print "slope from point",(self.y2- self.y1)/(self.x2- self.x1)
-        print "my slope horizontal", self.slope
-        print "b from point ", self.y2- self.slope*self.x2, self.b
-        self.npts = 20
-        self.has_move=False
-        self.connect_markers([self.line])
-        self.update()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-   
-    def get_radius(self):
-        
-        return 0
-   
-    def update(self,xmin=None, xmax=None,ymin=None,ymax=None, mline=None,translation=False):
-        """
-        Draw the new roughness on the graph.
-        """
-        self.slope= -1/math.tan(self.mline.theta)
-        if xmin !=None:
-            self.x2 = xmin
-        if xmax !=None:
-            self.x1 = xmax
-        if ymin !=None:
-            self.y2 = ymin
-        if ymax != None:
-            self.y1 = ymax
-        self.b= self.y1- self.slope * self.x1
-        self.line.set(xdata=[self.x1,self.x2],
-                       ydata=[self.y1,self.y2])
-    
-        
-        
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.save_x1= self.x1
-        self.save_x2= self.x2
-       
-        self.save_y1= self.y1
-        self.save_y2= self.y2
-        self.save_b= self.b
-        
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-       
-        self.has_move=False
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.x1 = self.save_x1
-        self.x2 = self.save_x2
-        self.y1 = self.save_y1
-        self.y2 = self.save_y2
-        self.b = self.save_b
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        print "horizontal move x y ", x, y
-        self.b =  y - (-1/self.mline.slope) *x
-        self.has_move=True
-        self.base.base.update()
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        params = {}
-        params["radius"] = self.x1
-        #params["theta"] = self.xmax
-        return params
-    
-    def set_params(self, params):
-
-        x = params["radius"] 
-        self.set_cursor(x, self._inner_mouse_y)
-        
-
-
-
-class VerticalLine(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5, mline=None, ymin=0.0, 
-                 ymax=0.5,xmin=-0.5,xmax=0.5,
-                 theta2= math.pi/3 ):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        
-        self.theta2 = mline.theta
-        self.mline =mline
-        self.xmin= xmin
-        self.x1= mline.x1 + xmin*math.cos(math.pi/2 - self.theta2)
-        self.x2= mline.x2 + xmin*math.cos(math.pi/2 - self.theta2)
-        self.y1= mline.y1 - xmin*math.sin(math.pi/2 - self.theta2)
-        self.y2= mline.y2 - xmin*math.sin(math.pi/2 - self.theta2)
-        self.line = self.axes.plot([self.x1,self.x2],[self.y1,self.y2],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
-      
-        
-        self.slope= math.tan(self.mline.theta)
-        print "vertical line intercetp ",self.y2- self.slope*self.x2, self.y1- self.slope* self.x1 
-       
-        self.b = self.y1- self.slope* self.x1 
-        self.has_move=False
-        self.connect_markers([self.line])
-        self.update()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-   
-    
-    def get_radius(self):
-        return 0
-    
-    def update(self,xmin=None,xmax=None,ymin=None, ymax=None, opline=None,translation=False):
-        """
-        Draw the new roughness on the graph.
-        """
-        
-        self.slope= math.tan(self.mline.theta)
-        if translation:
-            if xmin!=None:
-                self.x2=xmin
-                self.xmin= xmin
-            if xmax!=None:
-                self.x1=xmax
-            if ymin!=None:
-                self.y2=ymin
-            if ymax!=None:
-                self.y1=ymax
-            self.line.set(xdata=[self.x1,self.x2],
-                           ydata=[self.y1,self.y2]) 
-            self.b= self.y1- self.slope * self.x1
-            return 
-        
-        self.x1= self.mline.x1 + self.xmin*math.cos(math.pi/2 - self.mline.theta)
-        self.x2= self.mline.x2 + self.xmin*math.cos(math.pi/2 - self.mline.theta)
-        self.y1= self.mline.y1 - self.xmin*math.sin(math.pi/2 - self.mline.theta)
-        self.y2= self.mline.y2 - self.xmin*math.sin(math.pi/2 - self.mline.theta)
-        self.line.set(xdata=[self.x1,self.x2],
-                           ydata=[self.y1,self.y2]) 
-        print "update slope ", (self.y2-self.y1)/(self.x2- self.x1)
-        #print "main slope", math.tan(self.mline.theta)
-        
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.save_x1= self.x1
-        self.save_x2= self.x2
-        self.save_y1= self.y1
-        self.save_y2= self.y2
-        
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-        
-        self.has_move=False
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.x1 = self.save_x1
-        self.x2 = self.save_x2
-        self.y1 = self.save_y1
-        self.y2= self.save_y2
-      
-        
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        self.has_move=True
-        
-        # compute the b intercept of the vertical line
-        self.b=y - self.mline.slope * x
-        
-        
-        self.base.base.update()
-        
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        params = {}
-        params["x"] = self.xmin
-        params["ymin"] = self.ymin
-        params["ymax"] = self.ymax
-        return params
-    
-    def set_params(self, params):
-        """
-            Draw a vertical line given some value of params
-            @param params: a dictionary containing value for x, ymin , ymax to draw 
-            a vertical line
-        """
-        x = params["x"] 
-        ymin = params["ymin"] 
-        ymax = params["ymax"] 
-        #self.set_cursor(x, self._inner_mouse_y)
-        self.update(self,x =x,ymin =ymin, ymax =ymax)
-        
-
-        
-class LineInteractor(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5, ymin=1.0,ymax=1.0,theta=math.pi/4):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        
-        self.save_theta = theta 
-        self.theta= theta
-        
-        self.radius1 = math.fabs(ymax)
-        self.radius2 = math.fabs(ymin)
-        self.scale = 10.0
-           
-        # Inner circle
-        self.x1= self.radius1*math.cos(self.theta)
-        self.y1= self.radius1*math.sin(self.theta)
-        self.x2= -1*self.radius2*math.cos(self.theta)
-        self.y2= -1*self.radius2*math.sin(self.theta)
-       
-        self.line = self.axes.plot([self.x1,self.x2],[self.y1,self.y2],
-                                      linestyle='-', marker='',
-                                      color=self.color,
-                                      visible=True)[0]
-        self.slope= math.tan(self.theta)
-        self.b= math.fabs(self.y1- self.slope * self.x1)
-        print "intercept main",math.fabs(self.y2- self.slope * self.x2),math.fabs(self.y1- self.slope * self.x1)
-        self.npts = 20
-        self.has_move=False
-        self.connect_markers([self.line])
-        self.update()
-
-    def set_layer(self, n):
-        
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        """
-            Remove the line of the plot
-        """
-        self.clear_markers()
-        try:
-            self.line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-        
-        
-        
-    def get_delta_angle(self):
-        """
-            return difference between initial angle and the final angle during
-            rotation
-        """
-        return self.theta - self.save_theta
-        
-    def update(self,x1=None,
-               y1=None,
-               x2=None,
-               y2=None,
-               translation=False,
-               xmin=None,vline=None, theta=None,radius1=None,radius2=None):
-        """
-            Draw a line given and angle relative to the x-axis and a radius
-            @param  theta: the angle realtive to the x-axis
-            @param radius: the distance between the center and one end of the line
-        """
-        if translation:
-            if x1 !=None:
-                self.x1= x1
-            if x2 !=None:
-                self.x2= x2
-            if y1 !=None:
-                self.y1= y1
-            if y2 !=None:
-                self.y2= y2
-        
-            self.line.set(xdata=[self.x1,self.x2], ydata=[self.y1,self.y2])
-            self.radius1= math.fabs(self.x1/math.cos(self.theta))
-            self.radius2= math.fabs(self.x2/math.cos(self.theta))
-            print "radius 1, radius2", self.radius1, self.radius2
-            return     
-      
-        if theta !=None:
-            self.theta= theta
-        if radius1 !=None:
-            self.radius1 =radius1
-        if radius2 !=None:
-            self.radius2 =radius2
-        #print "update main line", math.degrees(self.theta),self.radius1, self.radius2
-        #print "smain radius 1 2", self.radius1, self.radius2
-        self.x1= self.radius1*math.cos(self.theta)
-        self.y1= self.radius1*math.sin(self.theta)
-        self.x2= -1*self.radius2*math.cos(self.theta)
-        self.y2= -1*self.radius2*math.sin(self.theta)
-        print "init mainline sintercept ", self.y1 - math.tan(self.theta)*self.x1,\
-         self.y2 - math.tan(self.theta)*self.x2
-        #print "main line slope ", (self.y2- self.y1)/(self.x2- self.x1)
-        #print "theta", math.tan(self.theta)
-        self.line.set(xdata=[self.x1,self.x2], ydata=[self.y1,self.y2])  
-     
-        
-        
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.save_theta= self.theta
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-        
-        self.has_move=False
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.theta = self.save_theta
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        self.theta= math.atan2(y,x)
-        self.slope= math.tan(self.theta)
-        self.b=  y - self.slope *x
-        
-        print "main move slope , theta, b", self.slope, self.theta, self.b
-        
-        #print "main_line previous theta --- next theta ",math.degrees(self.save_theta),math.degrees(self.theta)
-        self.has_move=True
-        self.base.base.update()
-        
-        
-    def set_cursor(self, x, y):
-        
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        """
-            return params a dictionary containing values of paramters necessary to draw 
-            this line
-        """
-        params = {}
-        params["ymax"] = self.radius1
-        params["ymin"] = self.radius2
-        params["theta"] = self.theta
-        return params
-    
-    def set_params(self, params):
-        """
-            Draw the line given value contains by params
-            @param params: dictionary containing name of parameters and their values
-        """
-        radius1 = params["ymax"]
-        radius2 = params["ymin"]
-        theta = params["theta"]
-        self.update(x, theta= theta , radius1 = radius1 ,radius2 = radius2)
-        
-
-
-
-        
Index: guiframe/local_perspectives/plotting/old_detector_dialog.py
===================================================================
--- guiframe/local_perspectives/plotting/old_detector_dialog.py	(revision 6d920cd2a2b96abc4845a5766911d8ef7fe5adc5)
+++ 	(revision )
@@ -1,207 +1,0 @@
-#!/usr/bin/env python
-
-# version
-__id__ = "$Id: aboutdialog.py 1193 2007-05-03 17:29:59Z dmitriy $"
-__revision__ = "$Revision: 1193 $"
-
-import wx
-from sans.guiframe.utils import format_number
-from sans.guicomm.events import StatusEvent ,NewPlotEvent,SlicerEvent
-class DetectorDialog(wx.Dialog):
-    """
-        Dialog box to let the user edit detector settings
-    """
-    
-    def __init__(self,parent,id=1,base=None, *args, **kwds):
-
-        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
-        wx.Dialog.__init__(self,parent,id=1, *args, **kwds)
-        self.parent=base
-        self.label_xnpts = wx.StaticText(self, -1, "Detector width in pixels")
-        self.label_ynpts = wx.StaticText(self, -1, "Detector Height in pixels")
-        self.label_qmax = wx.StaticText(self, -1, "Q max")
-        self.label_zmin = wx.StaticText(self, -1, "Min amplitude for color map (optional)")
-        self.label_zmax = wx.StaticText(self, -1, "Max amplitude for color map (optional)")
-        self.label_beam = wx.StaticText(self, -1, "Beam stop radius in units of q")
-        #self.label_sym  = wx.StaticText(self, -1, 'Use 4-fold symmetry')
-        
-        # Npts, q max
-        #self.npts_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        #self.qmax_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        #self.beam_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        self.xnpts_ctl = wx.StaticText(self, -1, "")
-        self.ynpts_ctl = wx.StaticText(self, -1, "")
-        self.qmax_ctl = wx.StaticText(self, -1, "")
-        self.beam_ctl = wx.StaticText(self, -1, "")
-        
-        self.zmin_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        self.zmax_ctl = wx.TextCtrl(self, -1, size=(60,20))
-        #self.chk_sym  = wx.CheckBox(self, -1, '')
-
-        self.static_line_3 = wx.StaticLine(self, -1)
-        
-        
-        self.button_OK = wx.Button(self, wx.ID_OK, "OK")
-        self.button_Cancel = wx.Button(self, wx.ID_CANCEL, "Cancel")
-        self.Bind(wx.EVT_BUTTON, self.checkValues, self.button_OK)
-
-        self.__set_properties()
-        self.__do_layout()
-
-        self.Fit()
-        
-    class Event:
-        xnpts = 0
-        ynpts = 0
-        qpax = 0
-        beam = 0
-        zmin = 0
-        zmax = 0
-        sym4 = False
-        
-    def checkValues(self, event):
-        flag = True
-        try:
-            value=self.zmin_ctl.GetValue()
-            if value and float( value)==0.0:
-                flag = False
-                wx.PostEvent(self.parent, StatusEvent(status="Enter number greater than zero"))
-                self.zmin_ctl.SetBackgroundColour("pink")
-                self.zmin_ctl.Refresh()
-            else:
-                self.zmin_ctl.SetBackgroundColour(wx.WHITE)
-                self.zmin_ctl.Refresh()
-        except:
-            flag = False
-            wx.PostEvent(self.parent, StatusEvent(status="Enter float value"))
-            self.zmin_ctl.SetBackgroundColour("pink")
-            self.zmin_ctl.Refresh()
-        try:
-            value=self.zmax_ctl.GetValue()
-            if value and int(value)==0.0:
-                flag = False
-                wx.PostEvent(self.parent, StatusEvent(status="Enter number greater than zero"))
-                self.zmax_ctl.SetBackgroundColour("pink")
-                self.zmax_ctl.Refresh()
-            else:
-                self.zmax_ctl.SetBackgroundColour(wx.WHITE)
-                self.zmax_ctl.Refresh()
-        except:
-            flag = False
-            wx.PostEvent(self.parent, StatusEvent(status="Enter Integer value"))
-            self.zmax_ctl.SetBackgroundColour("pink")
-            self.zmax_ctl.Refresh()
-        
-        if flag:
-            event.Skip(True)
-    
-    def setContent(self, xnpts,ynpts, qmax, beam,zmin=None,zmax=None, sym=False):
-        self.xnpts_ctl.SetLabel(str(format_number(xnpts)))
-        self.ynpts_ctl.SetLabel(str(format_number(ynpts)))
-        self.qmax_ctl.SetLabel(str(format_number(qmax)))
-        self.beam_ctl.SetLabel(str(format_number(beam)))
-        #self.chk_sym.SetValue(sym)
-        if zmin !=None:
-            self.zmin_ctl.SetValue(str(format_number(zmin)))
-        if zmax !=None:
-            self.zmax_ctl.SetValue(str(format_number(zmax)))
-
-    def getContent(self):
-        event = self.Event()
-        #event.npts = int(self.npts_ctl.GetValue())
-        #event.qmax = float(self.qmax_ctl.GetValue())
-        #event.beam = float(self.beam_ctl.GetValue())
-        #event.sym4 = self.chk_sym.GetValue()
-        
-        t_min = self.zmin_ctl.GetValue()
-        t_max = self.zmax_ctl.GetValue()
-        v_min = None
-        v_max = None
-        
-        if len(t_min.lstrip())>0:
-            try:
-                v_min = float(t_min)
-            except:
-                v_min = None
-        
-        if len(t_max.lstrip())>0:
-            try:
-                v_max = float(t_max)
-            except:
-                v_max = None
-        
-        event.zmin = v_min
-        event.zmax = v_max
-        
-        return event
-
-    def __set_properties(self):
-        self.SetTitle("Detector parameters")
-        self.SetSize((600, 595))
-
-    def __do_layout(self):
-        sizer_main = wx.BoxSizer(wx.VERTICAL)
-        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_params = wx.GridBagSizer(5,5)
-
-        iy = 0
-        sizer_params.Add(self.label_xnpts, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        sizer_params.Add(self.xnpts_ctl,   (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        sizer_params.Add(self.label_ynpts, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        sizer_params.Add(self.ynpts_ctl,   (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        sizer_params.Add(self.label_qmax, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        sizer_params.Add(self.qmax_ctl,   (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        sizer_params.Add(self.label_beam, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        sizer_params.Add(self.beam_ctl,   (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        sizer_params.Add(self.label_zmin, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        sizer_params.Add(self.zmin_ctl,   (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        sizer_params.Add(self.label_zmax, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        sizer_params.Add(self.zmax_ctl,   (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        #sizer_params.Add(self.label_sym,  (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        #sizer_params.Add(self.chk_sym,    (iy,1), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-
-        sizer_main.Add(sizer_params, 0, wx.EXPAND|wx.ALL, 10)
-        sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0)
-        
-        
-        sizer_button.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        sizer_button.Add(self.button_OK, 0, wx.LEFT|wx.ADJUST_MINSIZE, 10)
-        sizer_button.Add(self.button_Cancel, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)
-        
-        
-        sizer_main.Add(sizer_button, 0, wx.EXPAND|wx.BOTTOM|wx.TOP, 10)
-        self.SetAutoLayout(True)
-        self.SetSizer(sizer_main)
-        self.Layout()
-        self.Centre()
-        # end wxGlade
-
-
-# end of class DialogAbout
-
-##### testing code ############################################################
-class MyApp(wx.App):
-    def OnInit(self):
-        wx.InitAllImageHandlers()
-        dialog = DetectorDialog(None, -1, "")
-        self.SetTopWindow(dialog)
-        dialog.setContent(128, 0.05)
-        print dialog.ShowModal()
-        evt = dialog.getContent()
-        print evt.npts, evt.qmax
-        dialog.Destroy()
-        return 1
-
-# end of class MyApp
-
-if __name__ == "__main__":
-    app = MyApp(0)
-    app.MainLoop()
-    
-##### end of testing code #####################################################    
Index: guiframe/local_perspectives/plotting/ring.py
===================================================================
--- guiframe/local_perspectives/plotting/ring.py	(revision 0d9dae840601f23ae4dd0b9e0317056593727f90)
+++ 	(revision )
@@ -1,344 +1,0 @@
-#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
-#      before pushing a new 1D data update.
-
-#
-#TODO: NEED MAJOR REFACTOR
-#
-
-
-# Debug printout
-import math
-import wx
-from copy import deepcopy
-
-from BaseInteractor import _BaseInteractor
-from sans.guicomm.events import NewPlotEvent, StatusEvent,SlicerParameterEvent,EVT_SLICER_PARS
-
-class AnnulusInteractor(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=3):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self.qmax = self.base.data2D.xmax
-        self.connect = self.base.connect
-        
-        ## Number of points on the plot
-        self.nbins = 20
-
-        # Inner circle
-        self.inner_circle = RingInteractor(self, self.base.subplot, zorder=zorder, r=self.qmax/2.0)
-        self.inner_circle.qmax = self.qmax
-      
-        #self.outer_circle.set_cursor(self.base.qmax/1.8, 0)
-        
-                      
-        self.update()
-        self._post_data()
-        
-        # Bind to slice parameter events
-        self.base.parent.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
-
-
-    def _onEVT_SLICER_PARS(self, event):
-        printEVT("AnnulusSlicer._onEVT_SLICER_PARS")
-        event.Skip()
-        if event.type == self.__class__.__name__:
-            self.set_params(event.params)
-            self.base.update()
-
-    def update_and_post(self):
-        self.update()
-        self._post_data()
-
-    def save_data(self, path, image, x, y):
-        output = open(path, 'w')
-        
-        data_x, data_y = self.get_data(image, x, y)
-        
-        output.write("<phi>  <average>\n")
-        for i in range(len(data_x)):
-            output.write("%g  %g\n" % (data_x[i], data_y[i]))
-        output.close()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-       
-        self.inner_circle.clear()
-        #self.base.connect.disconnect()
-        self.base.parent.Unbind(EVT_SLICER_PARS)
-        
-    def update(self):
-        """
-        Respond to changes in the model by recalculating the profiles and
-        resetting the widgets.
-        """
-        # Update locations        
-        self.inner_circle.update()
-       
-        
-        
-    def get_data(self, image, x, y):
-        """ 
-            Return a 1D vector corresponding to the slice
-            @param image: data matrix
-            @param x: x matrix
-            @param y: y matrix
-        """
-        # If we have no data, just return
-        if image == None:
-            return        
-        
-        nbins = self.nbins
-        
-        data_x = nbins*[0]
-        data_y = nbins*[0]
-        counts = nbins*[0]
-        length = len(image)
-        print "length x , y , image", len(x), len(y), length
-        
-        for i_x in range(length):
-            for i_y in range(length):
-                        
-                q = math.sqrt(x[i_x]*x[i_x] + y[i_y]*y[i_y])
-                if (q>self.inner_circle._inner_mouse_x \
-                    and q<self.outer_circle._inner_mouse_x) \
-                    or (q<self.inner_circle._inner_mouse_x \
-                    and q>self.outer_circle._inner_mouse_x):
-                            
-                    i_bin = int(math.ceil(nbins*(math.atan2(y[i_y], x[i_x])+math.pi)/(2.0*math.pi)) - 1)
-                    
-                    
-                    #data_y[i_bin] += math.exp(image[i_x][i_y])
-                    data_y[i_bin] += image[i_y][i_x]
-                    counts[i_bin] += 1.0
-                    
-        for i in range(nbins):
-            data_x[i] = (1.0*i+0.5)*2.0*math.pi/nbins
-            if counts[i]>0:
-                data_y[i] = data_y[i]/counts[i]
-        
-        return data_x, data_y
-
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self.base.freeze_axes()
-        self.inner_circle.save(ev)
-       
-
-    def _post_data(self):
-        # Compute data
-        data = self.base.get_corrected_data()
-        # If we have no data, just return
-        if data == None:
-            return
-
-        data_x, data_y = self.get_data(data, self.base.x, self.base.y)
-        
-        name = "Ring"
-        if hasattr(self.base, "name"):
-            name += " %s" % self.base.name
-        
-        wx.PostEvent(self.base.parent, AddPlotEvent(name=name,
-                                               x = data_x,
-                                               y = data_y,
-                                               qmin = self.inner_circle._inner_mouse_x,
-                                               qmax = self.outer_circle._inner_mouse_x,
-                                               yscale = 'log',
-                                               variable = 'ANGLE',
-                                               ylabel = "\\rm{Intensity} ",
-                                               yunits = "cm^{-1}",
-                                               xlabel = "\\rm{\phi}",
-                                               xunits = "rad",
-                                               parent = self.base.__class__.__name__))
-                                               
-        
-    def moveend(self, ev):
-        self.base.thaw_axes()
-        
-        # Post paramters
-        event = SlicerParameterEvent()
-        event.type = self.__class__.__name__
-        event.params = self.get_params()
-        wx.PostEvent(self.base.parent, event)
-
-        self._post_data()
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self.inner_circle.restore()
-      
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        pass
-        
-    def set_cursor(self, x, y):
-        pass
-        
-    def get_params(self):
-        params = {}
-        params["inner_radius"] = self.inner_circle._inner_mouse_x
-       
-        params["nbins"] = self.nbins
-        return params
-    
-    def set_params(self, params):
-        
-        inner = params["inner_radius"] 
-        
-        self.nbins = int(params["nbins"])
-        self.inner_circle.set_cursor(inner, self.inner_circle._inner_mouse_y)
-       
-        self._post_data()
-        
-    def freeze_axes(self):
-        self.base.freeze_axes()
-        
-    def thaw_axes(self):
-        self.base.thaw_axes()
-
-    def draw(self):
-        self.base.draw()
-
-        
-class RingInteractor(_BaseInteractor):
-    """
-         Select an annulus through a 2D plot
-    """
-    def __init__(self,base,axes,color='black', zorder=5, r=1.0):
-        
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.markers = []
-        self.axes = axes
-        self._inner_mouse_x = r
-        self._inner_mouse_y = 0
-        self._inner_save_x  = r
-        self._inner_save_y  = 0
-        self.scale = 10.0
-        
-        try:
-            # Inner circle marker
-            self.inner_marker = self.axes.plot([self._inner_mouse_x],[0], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          pickradius=5, label="pick", 
-                                          zorder=zorder, # Prefer this to other lines
-                                          visible=True)[0]
-        except:
-            self.inner_marker = self.axes.plot([self._inner_mouse_x],[0], linestyle='',
-                                          marker='s', markersize=10,
-                                          color=self.color, alpha=0.6,
-                                          label="pick", 
-                                          visible=True)[0]
-            message  = "\nTHIS PROTOTYPE NEEDS THE LATEST VERSION OF MATPLOTLIB\n"
-            message += "Get the SVN version that is at least as recent as June 1, 2007"
-            
-            #raise "Version error", message
-            
-        # Inner circle
-
-           
-        [self.inner_circle] = self.axes.plot([],[],
-                                      linestyle='-', marker='',
-                                      color=self.color)
-        self.npts = 20
-            
-        self.connect_markers([self.inner_marker])
-        self.update()
-
-    def set_layer(self, n):
-        self.layernum = n
-        self.update()
-        
-    def clear(self):
-        self.clear_markers()
-        try:
-            self.inner_marker.remove()
-            self.inner_circle.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
-        
-        
-        
-    def get_radius(self):
-        return self._inner_mouse_x
-        
-    def update(self):
-        """
-        Draw the new roughness on the graph.
-        """
-        # Plot inner circle
-        x = []
-        y = []
-        for i in range(self.npts):
-            phi = 2.0*math.pi/(self.npts-1)*i
-            
-            xval = 1.0*self._inner_mouse_x*math.cos(phi) 
-            yval = 1.0*self._inner_mouse_x*math.sin(phi) 
-            
-            x.append(xval)
-            y.append(yval)
-        
-        self.inner_marker.set(xdata=[self._inner_mouse_x],ydata=[0])
-        self.inner_circle.set_data(x, y)        
-
-    def save(self, ev):
-        """
-        Remember the roughness for this layer and the next so that we
-        can restore on Esc.
-        """
-        self._inner_save_x = self._inner_mouse_x
-        self._inner_save_y = self._inner_mouse_y
-        self.base.freeze_axes()
-
-    def moveend(self, ev):
-        self.base.moveend(ev)
-            
-    def restore(self):
-        """
-        Restore the roughness for this layer.
-        """
-        self._inner_mouse_x = self._inner_save_x
-        self._inner_mouse_y = self._inner_save_y
-
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        self._inner_mouse_x = x
-        self._inner_mouse_y = y
-        self.base.base.update()
-        
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
-        
-        
-    def get_params(self):
-        params = {}
-        params["radius"] = self._inner_mouse_x
-        return params
-    
-    def set_params(self, params):
-
-        x = params["radius"] 
-        self.set_cursor(x, self._inner_mouse_y)
-        
-        
