Index: guiframe/data_loader.py
===================================================================
--- guiframe/data_loader.py	(revision 768656ee3fc923f226cb348145fb3cfb09f09903)
+++ guiframe/data_loader.py	(revision e8c96f51ec0e9f1d2c4bedbb070fee80c770d464)
@@ -94,7 +94,7 @@
             #print "data_loader",output
         else:
-            print "output.dx, output.dy",output.dx, output.dy
+            #print "output.dx, output.dy",output.dx, output.dy
             if output.dy ==None:
-                print "went here theory1D"
+                #print "went here theory1D"
                 new_plot = Theory1D(output.x,output.y, dxl, dxw)
             else:
Index: guiframe/local_perspectives/plotting/Arc.py
===================================================================
--- guiframe/local_perspectives/plotting/Arc.py	(revision b98db8c4671a4e41c20e4315cb33c65a1a0bb272)
+++ guiframe/local_perspectives/plotting/Arc.py	(revision e8c96f51ec0e9f1d2c4bedbb070fee80c770d464)
@@ -29,5 +29,5 @@
         self.theta1=theta1
         self.theta2=theta2
-      
+        self.radius= r
         [self.inner_circle] = self.axes.plot([],[],
                                       linestyle='-', marker='',
@@ -58,5 +58,5 @@
         return radius
         
-    def update(self,theta1=None,theta2=None):
+    def update(self,theta1=None,theta2=None, nbins=None, r=None):
         """
         Draw the new roughness on the graph.
@@ -69,22 +69,27 @@
         if theta2 !=None:
             self.theta2= theta2
+        
         print "ring update theta1 theta2", math.degrees(self.theta1), math.degrees(self.theta2)
         while self.theta2 < self.theta1: self.theta2 += 2*math.pi
-        npts = int((self.theta2 - self.theta1)/(math.pi/120))
+        
         
         
             
-            
+        if nbins!=None:
+            self.npts =nbins
+        else:
+            npts = int((self.theta2 - self.theta1)/(math.pi/120))   
         for i in range(self.npts):
             
             phi =(self.theta2-self.theta1)/(self.npts-1)*i +self.theta1
             #delta= phi1-phi
-            r=  math.sqrt(math.pow(self._inner_mouse_x, 2)+math.pow(self._inner_mouse_y, 2))
-            xval = 1.0*r*math.cos(phi) 
-            yval = 1.0*r*math.sin(phi) 
-            #xval = 1.0*self._inner_mouse_x*math.cos(phi) 
-            #yval = 1.0*self._inner_mouse_x*math.sin(phi)
-          
-           
+            if r ==None:
+                self.radius=  math.sqrt(math.pow(self._inner_mouse_x, 2)+math.pow(self._inner_mouse_y, 2))
+            else:
+                self.radius= r
+            
+            xval = 1.0*self.radius*math.cos(phi) 
+            yval = 1.0*self.radius*math.sin(phi) 
+            
             x.append(xval)
             y.append(yval)
@@ -93,15 +98,5 @@
         self.inner_circle.set_data(x, y) 
         
-        """
-        r=  math.sqrt(math.pow(self._inner_mouse_x, 2)+math.pow(self._inner_mouse_y, 2))
-        x1=  r*math.cos(self.theta1)
-        y1= r*math.sin(self.theta1)
-        """
-        #x1= self._inner_mouse_x*math.cos(self.theta1)
-        #y1= self._inner_mouse_x*math.sin(self.theta1)
-        #x2= r2*math.cos(self.theta1)
-        #y2= r2*math.sin(self.theta1)
-       
-   
+      
     def save(self, ev):
         """
@@ -109,13 +104,20 @@
         can restore on Esc.
         """
-        #self._inner_save_x = self._inner_mouse_x
-        #self._inner_save_y = self._inner_mouse_y
-        self._inner_save_x = ev.xdata
-        self._inner_save_y = ev.ydata
-        print "save value",self._inner_save_x ,self._inner_save_y
+        self._inner_save_x = self._inner_mouse_x
+        self._inner_save_y = self._inner_mouse_y
+        #self._inner_save_x = ev.xdata
+        #self._inner_save_y = ev.ydata
+        
         self.base.freeze_axes()
 
     def moveend(self, ev):
         self.has_move= False
+        
+        event = SlicerParameters.SlicerParameterEvent()
+        event.type = self.__class__.__name__
+        event.params = self.get_params()
+        print "in arc moveend params",self.get_params()
+        #wx.PostEvent(self.base.base.parent, event)
+        
         self.base.moveend(ev)
             
@@ -131,5 +133,5 @@
         Process move to a new position, making sure that the move is allowed.
         """
-        print "ring move x, y", x,y
+        #print "ring move x, y", x,y
         self._inner_mouse_x = x
         self._inner_mouse_y = y
@@ -137,12 +139,16 @@
         self.base.base.update()
         
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
-        self.update()
+    def set_cursor(self,radius, phi_min, phi_max,nbins):
+        
+        self.theta1= phi_min
+        self.theta2= phi_max
+        self.update(nbins=nbins, r=radius)
         
         
     def get_params(self):
         params = {}
-        params["radius"] = self._inner_mouse_x
+        params["radius"] = self.radius
+        params["theta1"] = self.theta1
+        params["theta2"] = self.theta2
         return params
     
Index: guiframe/local_perspectives/plotting/DataPanel.py
===================================================================
--- guiframe/local_perspectives/plotting/DataPanel.py	(revision 356aea7851c1dda619149e40e61be7ef49e0fe97)
+++ guiframe/local_perspectives/plotting/DataPanel.py	(revision e8c96f51ec0e9f1d2c4bedbb070fee80c770d464)
@@ -28,5 +28,5 @@
 DEFAULT_QSTEP = 0.001
 DEFAULT_BEAM = 0.005
-
+BIN_WIDTH =1
 import pylab
 
@@ -482,6 +482,6 @@
         
         id = wx.NewId()
-        slicerpop.Append(id, '&Edit Parameters')
-        wx.EVT_MENU(self, id, self._onEditDetector) 
+        slicerpop.Append(id, '&Edit Slicer Parameters')
+        wx.EVT_MENU(self, id, self._onEditSlicer) 
         
         slicerpop.AppendSeparator()
@@ -580,5 +580,6 @@
         
         from DataLoader.manipulations import CircularAverage
-        Circle = CircularAverage( r_min= -self.qmax, r_max= self.qmax, bin_width=0.001)
+        #Circle = CircularAverage( r_min= -self.qmax, r_max= self.qmax, bin_width=BIN_WIDTH )
+        Circle = CircularAverage( r_min= -1, r_max= 1, bin_width=0.001 )
         circ = Circle(self.data2D)
         from sans.guiframe.dataFitting import Data1D
@@ -608,4 +609,12 @@
         
         
+    def _onEditSlicer(self, event):
+        if self.slicer !=None:
+            from SlicerParameters import SlicerParameterPanel
+            dialog = SlicerParameterPanel(self.parent, -1, "Slicer Parameters")
+            dialog.set_slicer(self.slicer.__class__.__name__,
+                            self.slicer.get_params())
+            if dialog.ShowModal() == wx.ID_OK:
+                dialog.Destroy() 
         
     def onSectorQ(self, event):
Index: guiframe/local_perspectives/plotting/Edge.py
===================================================================
--- guiframe/local_perspectives/plotting/Edge.py	(revision b98db8c4671a4e41c20e4315cb33c65a1a0bb272)
+++ guiframe/local_perspectives/plotting/Edge.py	(revision e8c96f51ec0e9f1d2c4bedbb070fee80c770d464)
@@ -64,8 +64,8 @@
         
         
-    def get_radius(self):
+    def get_angle(self):
         return self.theta
         
-    def update(self,r1=None, r2=None, theta_right=None, theta_left=None):
+    def update(self,r1=None, r2=None, theta=None):
         """
         Draw the new roughness on the graph.
@@ -75,25 +75,8 @@
         if r2!=None:
             self.r2=r2
-        """
-        self.theta_left=theta_left
-        self.theta_right=theta_right
-        if r1 !=None:
-            self.r1=r1
-        if r2!=None:
-            self.r2=r2
-        if theta_right!=None:
-            if theta_right < self.theta:
-                self.move_stop=True
-            else:
-                self.move_stop=False
-        if theta_left !=None:
-            if theta_left > self.theta:
-                self.move_stop=True
-            else:
-                self.move_stop=False
-        if theta_left ==None and theta_right==None:
-            self.move_stop=True
-        """
-        #print "in the edge theta_right theta_left",theta_right,theta_left,self.theta
+        if theta !=None:
+            self.theta= theta
+       
+        print "in the edge r1, r2",self.r1,self.r2,math.degrees(self.theta)
         x1= self.r1*math.cos(self.theta)
         y1= self.r1*math.sin(self.theta)
@@ -109,5 +92,6 @@
         can restore on Esc.
         """
-        self.save_theta= self.theta
+        self.save_theta= math.atan2(ev.y,ev.x)
+        #self.save_theta= self.theta
         self.base.freeze_axes()
    
@@ -126,18 +110,5 @@
         Process move to a new position, making sure that the move is allowed.
         """
-        #print "on move theta left , theta right",self.theta_left,self.theta_right
-        theta= math.atan2(y,x)
-        """print "on move theta left , theta right",self.theta_left,self.theta_right,theta
-            if self.theta_left !=None:
-                if self.theta_left >= theta:
-                    print "went hier"
-                        self.move_stop= True
-                if self.theta_right !=None:
-                    if self.theta_right <= theta:
-                        self.move_stop= True
-           
-            self.move_stop= True
-            if self.move_stop:
-         """
+        
         self.theta= math.atan2(y,x)
         self.has_move= True
@@ -145,6 +116,8 @@
         self.base.base.update()
         
-    def set_cursor(self, x, y):
-        self.move(x, y, None)
+    def set_cursor(self,r_min, r_max, theta):
+        self.theta= theta
+        self.r1= r_min
+        self.r2=r_max
         self.update()
         
@@ -154,11 +127,14 @@
         params["radius1"] = self.r1
         params["radius2"] = self.r2
+        params["theta"] = self.theta
         return params
     
     def set_params(self, params):
+        print "when here set curcor arc"
 
         x1 = params["radius1"] 
         x2 = params["radius2"] 
-        self.set_cursor(x, self._inner_mouse_y)
+        theta= params["theta"]
+        self.set_cursor(x1, x2, theta)
         
     
Index: guiframe/local_perspectives/plotting/SectorSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/SectorSlicer.py	(revision b98db8c4671a4e41c20e4315cb33c65a1a0bb272)
+++ guiframe/local_perspectives/plotting/SectorSlicer.py	(revision e8c96f51ec0e9f1d2c4bedbb070fee80c770d464)
@@ -48,9 +48,9 @@
         #self.outer_circle.set_cursor(self.base.qmax/1.8, 0)
         from Edge import RadiusInteractor
-        self.inner_radius= RadiusInteractor(self, self.base.subplot, zorder=zorder+1,
+        self.right_edge= RadiusInteractor(self, self.base.subplot, zorder=zorder+1,
                                              arc1=self.inner_circle,
                                              arc2=self.outer_circle,
                                             theta=theta1)
-        self.outer_radius= RadiusInteractor(self, self.base.subplot, zorder=zorder+1,
+        self.left_edge= RadiusInteractor(self, self.base.subplot, zorder=zorder+1,
                                              arc1=self.inner_circle,
                                              arc2=self.outer_circle,
@@ -59,5 +59,5 @@
         self._post_data()
         # Bind to slice parameter events
-        #self.base.parent.Bind(SlicerParameters.EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
+        self.base.parent.Bind(SlicerParameters.EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
 
 
@@ -93,8 +93,8 @@
         self.outer_circle.clear()
         self.inner_circle.clear()
-        self.inner_radius.clear()
-        self.outer_radius.clear()
+        self.right_edge.clear()
+        self.left_edge.clear()
         #self.base.connect.disconnect()
-        #self.base.parent.Unbind(SlicerParameters.EVT_SLICER_PARS)
+        self.base.parent.Unbind(SlicerParameters.EVT_SLICER_PARS)
         
     def update(self):
@@ -109,6 +109,6 @@
             r1=self.inner_circle.get_radius()
             r2=self.outer_circle.get_radius()
-            self.inner_radius.update(r1,r2)
-            self.outer_radius.update(r1,r2)
+            self.right_edge.update(r1,r2)
+            self.left_edge.update(r1,r2)
         if self.outer_circle.has_move:    
             print "outer circle has moved" 
@@ -116,16 +116,16 @@
             r1=self.inner_circle.get_radius()
             r2=self.outer_circle.get_radius()
-            self.inner_radius.update(r1,r2)
-            self.outer_radius.update(r1,r2)
-        if self.inner_radius.has_move:
-            print "inner radius has moved"
-            self.inner_radius.update(theta_left=self.outer_radius.get_radius())
-            self.inner_circle.update(theta1=self.inner_radius.get_radius(), theta2=None)
-            self.outer_circle.update(theta1=self.inner_radius.get_radius(), theta2=None)
-        if  self.outer_radius.has_move:
-             print "outer radius has moved"
-             self.outer_radius.update(theta_right=self.inner_radius.get_radius())
-             self.inner_circle.update(theta1=None, theta2=self.outer_radius.get_radius())
-             self.outer_circle.update(theta1=None, theta2=self.outer_radius.get_radius())
+            self.left_edge.update(r1,r2)
+            self.right_edge.update(r1,r2)
+        if self.right_edge.has_move:
+            print "right edge has moved"
+            self.right_edge.update()
+            self.inner_circle.update(theta1=self.right_edge.get_angle(), theta2=None)
+            self.outer_circle.update(theta1=self.right_edge.get_angle(), theta2=None)
+        if  self.left_edge.has_move:
+            print "left Edge has moved"
+            self.left_edge.update()
+            self.inner_circle.update(theta1=None, theta2=self.left_edge.get_angle())
+            self.outer_circle.update(theta1=None, theta2=self.left_edge.get_angle())
              
         
@@ -138,6 +138,10 @@
         self.inner_circle.save(ev)
         self.outer_circle.save(ev)
+        self.right_edge.save(ev)
+        self.left_edge.save(ev)
+        
     def _post_data(self):
         pass
+    
     def post_data(self,new_sector ):
         """ post data averaging in Q"""
@@ -148,10 +152,10 @@
             rmin=self.outer_circle.get_radius()
             rmax=self.inner_circle.get_radius()
-        if self.inner_radius.get_radius() < self.outer_radius.get_radius():
-            phimin=self.inner_radius.get_radius()
-            phimax=self.outer_radius.get_radius()
-        else:
-            phimin=self.outer_radius.get_radius()
-            phimax=self.inner_radius.get_radius()
+        if self.right_edge.get_angle() < self.left_edge.get_angle():
+            phimin=self.right_edge.get_angle()
+            phimax=self.left_edge.get_angle()
+        else:
+            phimin=self.left_edge.get_angle()
+            phimax=self.right_edge.get_angle()
             
         print "phimin, phimax, rmin ,rmax",math.degrees(phimin), math.degrees(phimax), rmin ,rmax
@@ -190,12 +194,12 @@
         
     def moveend(self, ev):
-        self.base.thaw_axes()
-        
-        # Post paramters
+        #self.base.thaw_axes()
+        
+         # Post paramters
         event = SlicerParameters.SlicerParameterEvent()
         event.type = self.__class__.__name__
         event.params = self.get_params()
+        print "main moveend ", event.params
         wx.PostEvent(self.base.parent, event)
-
         self._post_data()
             
@@ -205,5 +209,7 @@
         """
         self.inner_circle.restore()
-        #self.outer_circle.restore()
+        self.outer_circle.restore()
+        self.right_edge.restore()
+        self.left_edge.restore()
 
     def move(self, x, y, ev):
@@ -218,24 +224,24 @@
     def get_params(self):
         params = {}
-        params["inner_radius"] = self.inner_circle._inner_mouse_x
-        params["outer_radius"] = self.outer_circle._inner_mouse_x
-        params["phi_min"] = self.inner_radius.get_radius()
-        params["phi_max"] = self.inner_radius.get_radius()
+        params["r_min"] = self.inner_circle.get_radius()
+        params["r_max"] = self.outer_circle.get_radius()
+        params["phi_min"] = self.right_edge.get_angle()
+        params["phi_max"] = self.left_edge.get_angle()
         params["nbins"] = self.nbins
         return params
     
     def set_params(self, params):
-        
-        inner = params["inner_radius"] 
-        outer = params["outer_radius"] 
+        print "setparams on main slicer ",params
+        inner = params["r_min"] 
+        outer = params["r_max"] 
         phi_min= params["phi_min"]
-        phi_min=params["phi_max"]
+        phi_max=params["phi_max"]
         self.nbins = int(params["nbins"])
         
         
-        self.inner_circle.set_cursor(inner, self.inner_circle._inner_mouse_y)
-        self.outer_circle.set_cursor(outer, self.outer_circle._inner_mouse_y)
-        self.inner_radius.set_cursor(inner, self.inner_circle._inner_mouse_y)
-        self.outer_radius.set_cursor(outer, self.outer_circle._inner_mouse_y)
+        self.inner_circle.set_cursor(inner, phi_min, phi_max,self.nbins)
+        self.outer_circle.set_cursor(outer,  phi_min, phi_max, self.nbins)
+        self.right_edge.set_cursor(inner, outer, phi_min)
+        self.left_edge.set_cursor(inner, outer, phi_max)
         self._post_data()
         
Index: guiframe/local_perspectives/plotting/SlicerParameters.py
===================================================================
--- guiframe/local_perspectives/plotting/SlicerParameters.py	(revision b06ef8cb70788b49507ed818acd3b911d08edcbc)
+++ guiframe/local_perspectives/plotting/SlicerParameters.py	(revision e8c96f51ec0e9f1d2c4bedbb070fee80c770d464)
@@ -10,10 +10,23 @@
 (SlicerParameterEvent, EVT_SLICER_PARS)   = wx.lib.newevent.NewEvent()
 
-class SlicerParameterPanel(wx.Panel):
+def format_number(value, high=False):
+    """
+        Return a float in a standardized, human-readable formatted string 
+    """
+    try: 
+        value = float(value)
+    except:
+        return "NaN"
+    
+    if high:
+        return "%-6.4g" % value
+    else:
+        return "%-5.3g" % value
+class SlicerParameterPanel(wx.Dialog):
     #TODO: show units
     #TODO: order parameters properly
     
-    def __init__(self, parent, *args, **kwargs):
-        wx.Panel.__init__(self, parent, *args, **kwargs)
+    def __init__(self, parent, id, title):
+        wx.Dialog.__init__(self, parent, id, title, size=(400, 350))
         self.params = {}
         self.parent = parent
@@ -30,4 +43,6 @@
         self.parent.Bind(EVT_SLICER, self.onEVT_SLICER)
         self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
+        
+       
 
     def onEVT_SLICER(self, event):
@@ -39,4 +54,5 @@
         """
         event.Skip()
+        print "on event slicer parameters"
         if event.obj_class==None:
             self.set_slicer(None, None)
@@ -48,4 +64,5 @@
             Rebuild the panel
         """
+        
         self.bck.Clear(True)  
         self.type = type  
@@ -74,5 +91,5 @@
                 
                 
-                ctl.SetValue(str(params[item]))
+                ctl.SetValue(format_number(str(params[item])))
                 self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter)
                 ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter)
@@ -113,3 +130,7 @@
             event = SlicerParameterEvent(type=self.type, params=params)
             wx.PostEvent(self.parent, event)
+            
+ 
+       
+
         
