Index: itools/.project
===================================================================
--- guitools/.project	(revision 2bf92f2eb410d943f4de97881e7615508e97dcb9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>guitools</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.python.pydev.PyDevBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.python.pydev.pythonNature</nature>
-	</natures>
-</projectDescription>
Index: itools/.pydevproject
===================================================================
--- guitools/.pydevproject	(revision 2bf92f2eb410d943f4de97881e7615508e97dcb9)
+++ 	(revision )
@@ -1,9 +1,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?>
-
-<pydev_project>
-<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/guitools/src</path>
-</pydev_pathproperty>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.5</pydev_property>
-</pydev_project>
Index: itools/BaseInteractor.py
===================================================================
--- guitools/BaseInteractor.py	(revision 4972de2b5011084cbeaf6d68d05d0d2406b76a68)
+++ 	(revision )
@@ -1,156 +1,0 @@
-interface_color = 'black'
-disable_color = 'gray'
-active_color = 'red'
-rho_color = 'black'
-mu_color = 'green'
-P_color = 'blue'
-theta_color = 'orange'
-profile_colors = [rho_color, mu_color, P_color, theta_color]
-
-class _BaseInteractor:
-    """
-    Share some functions between the interface interactor and various layer
-    interactors.
-    
-    Individual interactors need the following functions:
-    
-        save(ev)  - save the current state for later restore
-        restore() - restore the old state
-        move(x,y,ev) - move the interactor to position x,y
-        moveend(ev) - end the drag event
-        update() - draw the interactors
-        
-    The following are provided by the base class:
-    
-        connect_markers(markers) - register callbacks for all markers
-        clear_markers() - remove all items in self.markers
-        onHilite(ev) - enter/leave event processing
-        onLeave(ev) - enter/leave event processing
-        onClick(ev) - mouse click: calls save()
-        onRelease(ev) - mouse click ends: calls moveend()
-        onDrag(ev) - mouse move: calls move() or restore()
-        onKey(ev) - keyboard move: calls move() or restore()
-        
-    Interactor attributes:
-    
-        base  - model we are operating on
-        axes  - axes holding the interactor
-        color - color of the interactor in non-active state
-        markers - list of handles for the interactor
-    """
-    def __init__(self,base,axes,color='black'):
-        self.base = base
-        self.axes = axes
-        self.color = color
-        
-    def clear_markers(self):
-        '''
-        Clear old markers and interfaces.
-        '''
-        for h in self.markers: h.remove()
-        if self.markers: self.base.connect.clear(*self.markers)
-        self.markers = []
-
-    def save(self, ev):
-        pass
-    def restore(self, ev):
-        pass
-    def move(self, x, y, ev):
-        pass
-    def moveend(self, ev):
-        pass
-
-    def connect_markers(self,markers):
-        """
-        Connect markers to callbacks
-        """
-        for h in markers:
-            connect = self.base.connect
-            connect('enter', h, self.onHilite)
-            connect('leave', h, self.onLeave)
-            connect('click', h, self.onClick)
-            connect('release', h, self.onRelease)
-            connect('drag', h, self.onDrag)
-            connect('key', h, self.onKey)
-
-    def onHilite(self, ev):
-        """
-        Hilite the artist reporting the event, indicating that it is
-        ready to receive a click.
-        """
-        ev.artist.set_color(active_color)
-        self.base.draw()
-        return True
-
-    def onLeave(self, ev):
-        """
-        Restore the artist to the original colour when the cursor leaves.
-        """
-        ev.artist.set_color(self.color)
-        self.base.draw()
-        return True
-            
-    def onClick(self, ev):
-        """
-        Prepare to move the artist.  Calls save() to preserve the state for
-        later restore().
-        """
-        self.clickx,self.clicky = ev.xdata,ev.ydata
-        self.save(ev)
-        return True
-
-    def onRelease(self, ev):
-        self.moveend(ev)
-        return True
-
-    def onDrag(self, ev):
-        """
-        Move the artist.  Calls move() to update the state, or restore() if
-        the mouse leaves the window.
-        """
-        inside,prop = self.axes.contains(ev)
-        if inside:
-            self.clickx,self.clicky = ev.xdata,ev.ydata
-            self.move(ev.xdata,ev.ydata,ev)
-        else:
-            self.restore()
-        self.base.update()
-        return True
-    
-    def onKey(self, ev):
-        '''
-        Respond to keyboard events.  Arrow keys move the widget.  Escape
-        restores it to the position before the last click.
-        
-        Calls move() to update the state.  Calls restore() on escape.
-        '''
-        if ev.key == 'escape':
-            self.restore()
-        elif ev.key in ['up', 'down', 'right', 'left']:
-            dx,dy = self.dpixel(self.clickx,self.clicky,nudge=ev.control)
-            if ev.key == 'up': self.clicky += dy
-            elif ev.key == 'down': self.clicky -= dy
-            elif ev.key == 'right': self.clickx += dx
-            else: self.clickx -= dx
-            self.move(self.clickx,self.clicky,ev)
-        else:
-            return False
-        self.base.update()
-        return True
-
-    def dpixel(self,x,y,nudge=False):
-        '''
-        Return the step size in data coordinates for a small
-        step in screen coordinates.  If nudge is False (default)
-        the step size is one pixel.  If nudge is True, the step
-        size is 0.2 pixels.
-        '''
-        ax = self.axes
-        px,py = ax.transData.inverse_xy_tup((x,y))
-        if nudge:
-            nx,ny = ax.transData.xy_tup((px+0.2,py+0.2))
-        else:
-            nx,ny = ax.transData.xy_tup((px+1.,py+1.))
-        dx,dy = nx-x,ny-y
-        return dx,dy
-
Index: itools/LineModel.py
===================================================================
--- guitools/LineModel.py	(revision b3328d82c6c5d22953eea19b587d8ec627827b23)
+++ 	(revision )
@@ -1,77 +1,0 @@
-#!/usr/bin/env python
-""" 
-    Provide Line function (y= A + Bx) as a BaseComponent model
-"""
-
-from sans.models.BaseComponent import BaseComponent
-import math
-
-
-class LineModel(BaseComponent):
-    """ 
-        Class that evaluates a linear model.
-        
-        f(x) = A + Bx
-         
-        List of default parameters:
-          A = 1.0
-          B = 1.0 
-    """
-        
-    def __init__(self):
-        """ Initialization """
-        
-        # Initialize BaseComponent first, then sphere
-        BaseComponent.__init__(self)
-        
-        ## Name of the model
-        self.name = "LineModel"
-
-        ## Define parameters
-        self.params = {}
-        self.params['A'] = 1.0
-        self.params['B'] = 1.0
-        self.description='f(x) = A + Bx'
-        ## Parameter details [units, min, max]
-        self.details = {}
-        self.details['A'] = ['', None, None]
-        self.details['B'] = ['', None, None]
-               
-    def _line(self, x):
-        """
-            Evaluate the function
-            @param x: x-value
-            @return: function value
-        """
-        return  self.params['A'] + x *self.params['B']
-    
-    def run(self, x = 0.0):
-        """ Evaluate the model
-            @param x: simple value
-            @return: (Line value)
-        """
-        if x.__class__.__name__ == 'list':
-            return self._line(x[0]*math.cos(x[1]))*self._line(x[0]*math.sin(x[1]))
-        elif x.__class__.__name__ == 'tuple':
-            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
-        else:
-            return self._line(x)
-   
-    def runXY(self, x = 0.0):
-        """ Evaluate the model
-            @param x: simple value
-            @return: Line value
-        """
-        if x.__class__.__name__ == 'list':
-            return self._line(x[0])*self._line(x[1])
-        elif x.__class__.__name__ == 'tuple':
-            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
-        else:
-            return self._line(x)
-   
-
-if __name__ == "__main__": 
-    l = Line()
-    print "hello"
-       
-# End of file
Index: itools/PlotPanel.py
===================================================================
--- guitools/PlotPanel.py	(revision 3755d77dd1f4e2ab6dee7b2d899e977bc89c828b)
+++ 	(revision )
@@ -1,936 +1,0 @@
-import wx.lib.newevent
-try:
-    import matplotlib
-except:
-    import pkg_resources
-    pkg_resources.require("matplotlib<0.92.0")
-    import matplotlib
-    
-matplotlib.interactive(False)
-#Use the WxAgg back end. The Wx one takes too long to render
-matplotlib.use('WXAgg')
-from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
-from matplotlib.figure import Figure
-import os
-import fittings
-import transform
-from canvas import FigureCanvas
-from matplotlib.widgets import RectangleSelector
-from pylab import  gca, gcf
-from plottables import Theory1D
-#TODO: make the plottables interactive
-from binder import BindArtist
-
-DEBUG = False
-
-from plottables import Graph
-#(FuncFitEvent, EVT_FUNC_FIT) = wx.lib.newevent.NewEvent()
-import math,pylab,re
-
-def show_tree(obj,d=0):
-    """Handy function for displaying a tree of graph objects"""
-    print "%s%s" % ("-"*d,obj.__class__.__name__)
-    if 'get_children' in dir(obj):
-        for a in obj.get_children(): show_tree(a,d+1)
-     
-from unitConverter import UnitConvertion as convertUnit   
-def _convertUnit(pow,unit):
-    """ 
-        Displays the unit with the proper convertion
-        @param pow: the user set the power of the unit
-        @param unit: the unit of the data
-    """ 
-    return unit
-    toks=re.match("^", unit)
-    if not toks==None:
-        unitValue= re.split("{",unit)
-        unitPower= re.split("}",unitValue[1])
-        power= int(unitPower[0])*pow
-        word= unitValue[0]+"{"+str(power)+"}"
-        if power==1:
-            tempUnit=re.split("\^",unitValue[0])
-            unit=tempUnit[0]
-        else:
-            unit = word
-    #print"this is unit",unit
-    return unit
-def _rescale(lo,hi,step,pt=None,bal=None,scale='linear'):
-        """
-        Rescale (lo,hi) by step, returning the new (lo,hi)
-        The scaling is centered on pt, with positive values of step
-        driving lo/hi away from pt and negative values pulling them in.
-        If bal is given instead of point, it is already in [0,1] coordinates.
-    
-        This is a helper function for step-based zooming.
-        """
-        # Convert values into the correct scale for a linear transformation
-        # TODO: use proper scale transformers
-        loprev = lo
-        hiprev = hi
-        ptprev = pt
-        if scale=='log':
-            assert lo >0
-            if lo > 0 :
-                lo = math.log10(lo)
-            if hi > 0 :
-                hi = math.log10(hi)
-            if pt is not None: pt = math.log10(pt)
-        
-        # Compute delta from axis range * %, or 1-% if persent is negative
-        if step > 0:
-            delta = float(hi-lo)*step/100
-        else:
-            delta = float(hi-lo)*step/(100-step)
-    
-        # Add scale factor proportionally to the lo and hi values, preserving the
-        # point under the mouse
-        if bal is None:
-            bal = float(pt-lo)/(hi-lo)
-        lo = lo - bal*delta
-        hi = hi + (1-bal)*delta
-    
-        # Convert transformed values back to the original scale
-        if scale=='log':
-            if (lo <= -250) or (hi >= 250):
-                lo=loprev
-                hi=hiprev
-            else:
-                lo,hi = math.pow(10.,lo),math.pow(10.,hi)
-        return (lo,hi)
-
-
-class PlotPanel(wx.Panel):
-    """
-    The PlotPanel has a Figure and a Canvas. OnSize events simply set a 
-    flag, and the actually redrawing of the
-    figure is triggered by an Idle event.
-    """
-    def __init__(self, parent, id = -1, color = None,\
-        dpi = None, **kwargs):
-        wx.Panel.__init__(self, parent, id = id, **kwargs)
-        self.parent = parent
-        self.figure = Figure(None, dpi)
-        #self.figure = pylab.Figure(None, dpi)
-        #self.canvas = NoRepaintCanvas(self, -1, self.figure)
-        self.canvas = FigureCanvas(self, -1, self.figure)
-        self.SetColor(color)
-        #self.Bind(wx.EVT_IDLE, self._onIdle)
-        #self.Bind(wx.EVT_SIZE, self._onSize)
-        self._resizeflag = True
-        self._SetSize()
-        self.subplot = self.figure.add_subplot(111)
-        self.figure.subplots_adjust(left=.2, bottom=.2)
-        self.yscale = 'linear'
-        self.xscale = 'linear'
-        sizer = wx.BoxSizer(wx.VERTICAL)
-        sizer.Add(self.canvas,1,wx.EXPAND)
-        self.SetSizer(sizer)
-        
-        # Graph object to manage the plottables
-        self.graph = Graph()
-        #self.Bind(EVT_FUNC_FIT, self.onFitRange)
-        self.Bind(wx.EVT_CONTEXT_MENU, self.onContextMenu)
-        
-        #self.Bind(EVT_PROPERTY, self._onEVT_FUNC_PROPERTY)
-        # Define some constants
-        self.colorlist = ['b','g','r','c','m','y']
-        self.symbollist = ['o','x','^','v','<','>','+','s','d','D','h','H','p']
-        #User scale
-        self.xLabel ="x"
-        self.yLabel ="y"
-        self.viewModel ="--"
-        # keep track if the previous transformation of x and y in Property dialog
-        self.prevXtrans ="x"
-        self.prevYtrans ="y"
-        self.canvas.mpl_connect('scroll_event',self.onWheel)
-        #taking care of dragging
-        self.canvas.mpl_connect('motion_notify_event',self.onMouseMotion)
-        self.canvas.mpl_connect('button_press_event',self.onLeftDown)
-        self.canvas.mpl_connect('button_release_event',self.onLeftUp)
-        
-       
-        self.leftdown=False
-        self.leftup=False
-        self.mousemotion=False
-        
-        self.axes = [self.subplot]
-        
-        ## Fit dialog
-        self._fit_dialog = None
-        
-        # Interactor
-        self.connect = BindArtist(self.subplot.figure)
-        #self.selected_plottable = None
-
-        # new data for the fit 
-        self.fit_result = Theory1D(x=[], y=[], dy=None)
-        #self.fit_result = Data1D(x=[], y=[],dx=None, dy=None)
-        self.fit_result.name = "Fit"
-        # For fit Dialog initial display
-        self.xmin=0.0
-        self.xmax=0.0
-        self.xminView=0.0
-        self.xmaxView=0.0
-        self._scale_xlo = None
-        self._scale_xhi = None
-        self._scale_ylo = None
-        self._scale_yhi = None
-        self.Avalue=None
-        self.Bvalue=None
-        self.ErrAvalue=None
-        self.ErrBvalue=None
-        self.Chivalue=None
-        
-        # Dragging info
-        self.begDrag=False
-        self.xInit=None
-        self.yInit=None
-        self.xFinal=None
-        self.yFinal=None
-        
-        # Default locations
-        self._default_save_location = os.getcwd()        
-        
-        
-    def onLeftDown(self,event): 
-        """ left button down and ready to drag"""
-        # Check that the LEFT button was pressed
-        if event.button == 1:
-            self.leftdown=True
-            ax = event.inaxes
-            if ax != None:
-                self.xInit,self.yInit=event.xdata,event.ydata
-            
-            
-    def onLeftUp(self,event): 
-        """ Dragging is done """
-        # Check that the LEFT button was released
-        if event.button == 1:
-            self.leftdown=False
-            self.mousemotion=False 
-            self.leftup=True
-      
-    def onMouseMotion(self,event): 
-        """
-            check if the left button is press and the mouse in moving.
-            computer delta for x and y coordinates and then calls draghelper 
-            to perform the drag
-        """
-        self.mousemotion=True 
-        if self.leftdown==True and self.mousemotion==True:
-            
-            ax = event.inaxes
-            if ax !=None:#the dragging is perform inside the figure
-                self.xFinal,self.yFinal=event.xdata,event.ydata
-                
-                # Check whether this is the first point
-                if self.xInit==None:
-                    self.xInit = self.xFinal
-                    self.yInit = self.yFinal
-                    
-                xdelta = self.xFinal -self.xInit
-                ydelta = self.yFinal -self.yInit
-                
-                if self.xscale=='log':
-                    xdelta = math.log10(self.xFinal) -math.log10(self.xInit)
-                if self.yscale=='log':
-                    ydelta = math.log10(self.yFinal) -math.log10(self.yInit)
-                self.dragHelper(xdelta,ydelta)
-              
-            else:# no dragging is perform elsewhere
-                self.dragHelper(0,0)
-                
-    def _offset_graph(self):
-        """
-             Zoom and offset the graph to the last known 
-             settings 
-        """
-
-        for ax in self.axes:
-            if self._scale_xhi is not None and self._scale_xlo is not None:
-                ax.set_xlim(self._scale_xlo, self._scale_xhi)
-            if self._scale_yhi is not None and self._scale_ylo is not None:
-                ax.set_ylim(self._scale_ylo, self._scale_yhi)
-            
-            
-    def dragHelper(self,xdelta,ydelta):
-        """ dragging occurs here"""
-       
-        # Event occurred inside a plotting area
-        for ax in self.axes:
-            lo,hi= ax.get_xlim()
-            #print "x lo %f and x hi %f"%(lo,hi)
-            newlo,newhi= lo- xdelta, hi- xdelta
-            if self.xscale=='log':
-                if lo > 0:
-                    newlo= math.log10(lo)-xdelta
-                if hi > 0:
-                    newhi= math.log10(hi)-xdelta
-            if self.xscale=='log':
-                self._scale_xlo = math.pow(10,newlo)
-                self._scale_xhi = math.pow(10,newhi)
-                ax.set_xlim(math.pow(10,newlo),math.pow(10,newhi))
-            else:
-                self._scale_xlo = newlo
-                self._scale_xhi = newhi
-                ax.set_xlim(newlo,newhi)
-            #print "new lo %f and new hi %f"%(newlo,newhi)
-            
-            lo,hi= ax.get_ylim()
-            #print "y lo %f and y hi %f"%(lo,hi)
-            newlo,newhi= lo- ydelta, hi- ydelta
-            if self.yscale=='log':
-                if lo > 0:
-                    newlo= math.log10(lo)-ydelta
-                if hi > 0:
-                    newhi= math.log10(hi)-ydelta
-                #print "new lo %f and new hi %f"%(newlo,newhi)
-            if  self.yscale=='log':
-                self._scale_ylo = math.pow(10,newlo)
-                self._scale_yhi = math.pow(10,newhi)
-                ax.set_ylim(math.pow(10,newlo),math.pow(10,newhi))
-            else:
-                self._scale_ylo = newlo
-                self._scale_yhi = newhi
-                ax.set_ylim(newlo,newhi)
-        self.canvas.draw_idle()
-        
-        
-   
-    def resetFitView(self):
-        """
-             For fit Dialog initial display
-        """
-        self.xmin=0.0
-        self.xmax=0.0
-        self.xminView=0.0
-        self.xmaxView=0.0
-        self._scale_xlo = None
-        self._scale_xhi = None
-        self._scale_ylo = None
-        self._scale_yhi = None
-        self.Avalue=None
-        self.Bvalue=None
-        self.ErrAvalue=None
-        self.ErrBvalue=None
-        self.Chivalue=None
-    
-    def onWheel(self, event):
-        """
-            Process mouse wheel as zoom events
-            @param event: Wheel event
-        """
-        ax = event.inaxes
-        step = event.step
-
-        if ax != None:
-            # Event occurred inside a plotting area
-            lo,hi = ax.get_xlim()
-            lo,hi = _rescale(lo,hi,step,pt=event.xdata,scale=ax.get_xscale())
-            if not self.xscale=='log' or lo>0:
-                self._scale_xlo = lo
-                self._scale_xhi = hi
-                ax.set_xlim((lo,hi))
-
-            lo,hi = ax.get_ylim()
-            lo,hi = _rescale(lo,hi,step,pt=event.ydata,scale=ax.get_yscale())
-            if not self.yscale=='log' or lo>0:
-                self._scale_ylo = lo
-                self._scale_yhi = hi
-                ax.set_ylim((lo,hi))
-        else:
-             # Check if zoom happens in the axes
-            xdata,ydata = None,None
-            x,y = event.x,event.y
-           
-            for ax in self.axes:
-                insidex,_ = ax.xaxis.contains(event)
-                if insidex:
-                    xdata,_ = ax.transAxes.inverse_xy_tup((x,y))
-                insidey,_ = ax.yaxis.contains(event)
-                if insidey:
-                    _,ydata = ax.transAxes.inverse_xy_tup((x,y))
-            if xdata is not None:
-                lo,hi = ax.get_xlim()
-                lo,hi = _rescale(lo,hi,step,bal=xdata,scale=ax.get_xscale())
-                if not self.xscale=='log' or lo>0:
-                    self._scale_xlo = lo
-                    self._scale_xhi = hi
-                    ax.set_xlim((lo,hi))
-            if ydata is not None:
-                lo,hi = ax.get_ylim()
-                lo,hi = _rescale(lo,hi,step,bal=ydata,scale=ax.get_yscale())
-                if not self.yscale=='log' or lo>0:
-                    self._scale_ylo = lo
-                    self._scale_yhi = hi
-                    ax.set_ylim((lo,hi))
-               
-        self.canvas.draw_idle()
-
-
-    def returnTrans(self):
-        """
-            Return values and labels used by Fit Dialog
-        """
-        return self.xLabel,self.yLabel, self.Avalue, self.Bvalue,\
-                self.ErrAvalue,self.ErrBvalue,self.Chivalue
-    
-    def setTrans(self,xtrans,ytrans): 
-        """
-            @param xtrans: set x transformation on Property dialog
-            @param ytrans: set y transformation on Property dialog
-        """
-        self.prevXtrans =xtrans
-        self.prevYtrans =ytrans
-   
-    def onFitting(self, event): 
-        """
-            when clicking on linear Fit on context menu , display Fitting Dialog
-        """
-        list = {}
-        plotlist = self.graph.returnPlottable()
-        if self.graph.selected_plottable is not None:
-            for item in plotlist:
-                if item.name==self.graph.selected_plottable:
-                    list[item] = plotlist[item]
-        else:
-            list = plotlist
-        from fitDialog import LinearFit
-        
-        if len(list.keys())>0:
-            first_item = list.keys()[0]
-            dlg = LinearFit( None, first_item, self.onFitDisplay,self.returnTrans, -1, 'Linear Fit')
-           
-            if (self.xmin !=0.0 )and ( self.xmax !=0.0)\
-                and(self.xminView !=0.0 )and ( self.xmaxView !=0.0):
-                dlg.setFitRange(self.xminView,self.xmaxView,self.xmin,self.xmax)
-            dlg.ShowModal() 
-
-    def linear_plottable_fit(self, plot): 
-        """
-            when clicking on linear Fit on context menu , display Fitting Dialog
-            @param plot: PlotPanel owning the graph
-        """
-        from fitDialog import LinearFit
-        
-        if self._fit_dialog is not None:
-            return
-        
-        self._fit_dialog = LinearFit( None, plot, self.onFitDisplay,self.returnTrans, -1, 'Linear Fit')
-        
-        # Set the zoom area 
-        if self._scale_xhi is not None and self._scale_xlo is not None:
-            self._fit_dialog.set_fit_region(self._scale_xlo, self._scale_xhi)
-        
-        # Register the close event
-        self._fit_dialog.register_close(self._linear_fit_close)
-        
-        # Show a non-model dialog
-        self._fit_dialog.Show() 
-
-    def _linear_fit_close(self):
-        """
-            A fit dialog was closed
-        """
-        self._fit_dialog = None
-        
-
-    def _onProperties(self, event):
-        """
-            when clicking on Properties on context menu ,The Property dialog is displayed
-            The user selects a transformation for x or y value and a new plot is displayed
-        """
-        if self._fit_dialog is not None:
-            self._fit_dialog.Destroy()
-            self._fit_dialog = None
-            
-        list =[]
-        list = self.graph.returnPlottable()
-        if len(list.keys())>0:
-            first_item = list.keys()[0]
-            if first_item.x !=[]:
-                from PropertyDialog import Properties
-                dial = Properties(self, -1, 'Properties')
-                dial.setValues( self.prevXtrans, self.prevYtrans,self.viewModel )
-                if dial.ShowModal() == wx.ID_OK:
-                    self.xLabel, self.yLabel,self.viewModel = dial.getValues()
-                    if self.viewModel =="Guinier lny vs x^(2)":
-                        self.xLabel="x^(2)"
-                        self.yLabel="ln(y)"
-                        self.viewModel = "--"
-                        dial.setValues( self.xLabel, self.yLabel,self.viewModel )
-                    self._onEVT_FUNC_PROPERTY()
-                dial.Destroy()
-           
-  
-    def set_yscale(self, scale='linear'):
-        """
-            Set the scale on Y-axis
-            @param scale: the scale of y-axis
-        """
-        self.subplot.set_yscale(scale)
-        self.yscale = scale
-        
-    def get_yscale(self):
-        """
-             @return: Y-axis scale
-        """
-        return self.yscale
-    
-    def set_xscale(self, scale='linear'):
-        """
-            Set the scale on x-axis
-            @param scale: the scale of x-axis
-        """
-        self.subplot.set_xscale(scale)
-        self.xscale = scale
-       
-    def get_xscale(self):
-        """
-             @return: x-axis scale
-        """
-        return self.xscale
-
-    def SetColor(self, rgbtuple):
-        """Set figure and canvas colours to be the same"""
-        if not rgbtuple:
-            rgbtuple = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE).Get()
-        col = [c/255.0 for c in rgbtuple]
-        self.figure.set_facecolor(col)
-        self.figure.set_edgecolor(col)
-        self.canvas.SetBackgroundColour(wx.Colour(*rgbtuple))
-
-    def _onSize(self, event):
-        self._resizeflag = True
-
-    def _onIdle(self, evt):
-        if self._resizeflag:
-            self._resizeflag = False
-            self._SetSize()
-            self.draw()
-
-    def _SetSize(self, pixels = None):
-        """
-        This method can be called to force the Plot to be a desired size, which defaults to
-        the ClientSize of the panel
-        """
-        if not pixels:
-            pixels = self.GetClientSize()
-        self.canvas.SetSize(pixels)
-        self.figure.set_size_inches(pixels[0]/self.figure.get_dpi(),
-        pixels[1]/self.figure.get_dpi())
-
-    def draw(self):
-        """Where the actual drawing happens"""
-        self.figure.canvas.draw_idle()
-        
-        
-    def onSaveImage(self, evt):
-        #figure.savefig
-        #print "Save image not implemented"
-        path = None
-        dlg = wx.FileDialog(self, "Choose a file", self._default_save_location, "", "*.png", wx.SAVE)
-        if dlg.ShowModal() == wx.ID_OK:
-            path = dlg.GetPath()
-            self._default_save_location = os.path.dirname(path)
-        dlg.Destroy()
-        if not path == None:
-            self.subplot.figure.savefig(path,dpi=300, facecolor='w', edgecolor='w',
-                                        orentation='portrait', papertype=None, format='png')
-        
-    def onContextMenu(self, event):
-        """
-            Default context menu for a plot panel
-        """
-        # Slicer plot popup menu
-        id = wx.NewId()
-        slicerpop = wx.Menu()
-        slicerpop.Append(id,'&Save image', 'Save image as PNG')
-        wx.EVT_MENU(self, id, self.onSaveImage)
-        
-        #id = wx.NewId()
-        #slicerpop.Append(id, '&Load 1D data file')
-        #wx.EVT_MENU(self, id, self._onLoad1DData)
-       
-        id = wx.NewId()
-        slicerpop.AppendSeparator()
-        slicerpop.Append(id, '&Properties')
-        wx.EVT_MENU(self, id, self._onProperties)
-        
-        id = wx.NewId()
-        slicerpop.AppendSeparator()
-        slicerpop.Append(id, '&Linear Fit')
-        wx.EVT_MENU(self, id, self.onFitting)
-        
-        id = wx.NewId()
-        slicerpop.AppendSeparator()
-        slicerpop.Append(id, '&Reset Graph')
-        wx.EVT_MENU(self, id, self.onResetGraph)
-       
-        pos = event.GetPosition()
-        pos = self.ScreenToClient(pos)
-        self.PopupMenu(slicerpop, pos)
-    
-    ## The following is plottable functionality
-
-
-    def properties(self,prop):
-        """Set some properties of the graph.
-        
-        The set of properties is not yet determined.
-        """
-        # The particulars of how they are stored and manipulated (e.g., do 
-        # we want an inventory internally) is not settled.  I've used a
-        # property dictionary for now.
-        #
-        # How these properties interact with a user defined style file is
-        # even less clear.
-
-        # Properties defined by plot
-        self.subplot.set_xlabel(r"$%s$" % prop["xlabel"])
-        self.subplot.set_ylabel(r"$%s$" % prop["ylabel"])
-        self.subplot.set_title(prop["title"])
-
-        # Properties defined by user
-        #self.axes.grid(True)
-
-    def clear(self):
-        """Reset the plot"""
-        
-        # TODO: Redraw is brutal.  Render to a backing store and swap in
-        # TODO: rather than redrawing on the fly.
-        self.subplot.clear()
-        self.subplot.hold(True)
-    
-    def render(self):
-        """Commit the plot after all objects are drawn"""
-        # TODO: this is when the backing store should be swapped in.
-        from matplotlib.font_manager import FontProperties
-        self.subplot.legend(prop=FontProperties(size=10), handletextsep=.05)
-
-    def xaxis(self,label,units):
-        """xaxis label and units.
-        
-        Axis labels know about units.
-        
-        We need to do this so that we can detect when axes are not
-        commesurate.  Currently this is ignored other than for formatting
-        purposes.
-        """
-        if units != "": label = label + " (" + units + ")"
-        self.subplot.set_xlabel(label)
-        pass
-    
-    def yaxis(self,label,units):
-        """yaxis label and units."""
-        if units != "": label = label + " (" + units + ")"
-        self.subplot.set_ylabel(label)
-        pass
-
-    def _connect_to_xlim(self,callback):
-        """Bind the xlim change notification to the callback"""
-        def process_xlim(axes):
-            lo,hi = subplot.get_xlim()
-            callback(lo,hi)
-        self.subplot.callbacks.connect('xlim_changed',process_xlim)
-    
-    #def connect(self,trigger,callback):
-    #    print "PlotPanel.connect???"
-    #    if trigger == 'xlim': self._connect_to_xlim(callback)
-
-    def interactive_points(self,x,y,dx=None,dy=None,name='', color=0,symbol=0,label=None):
-        """Draw markers with error bars"""
-        self.subplot.set_yscale('linear')
-        self.subplot.set_xscale('linear')
-        
-        from plottable_interactor import PointInteractor
-        p = PointInteractor(self, self.subplot, zorder=3, id=name)
-        p.points(x, y, dx=dx, dy=dy, color=color, symbol=symbol, label=label)
-        
-        self.subplot.set_yscale(self.yscale)
-        self.subplot.set_xscale(self.xscale)
-
-    def interactive_curve(self,x,y,dy=None,name='',color=0,symbol=0,label=None):
-        """Draw markers with error bars"""
-        self.subplot.set_yscale('linear')
-        self.subplot.set_xscale('linear')
-        
-        from plottable_interactor import PointInteractor
-        p = PointInteractor(self, self.subplot, zorder=4, id=name)
-        p.curve(x, y, dy=dy, color=color, symbol=symbol, label=label)
-        
-        self.subplot.set_yscale(self.yscale)
-        self.subplot.set_xscale(self.xscale)
-
-    def plottable_selected(self, id):
-        """
-            Called to register a plottable as selected
-        """
-        #TODO: check that it really is in the list of plottables
-        self.graph.selected_plottable = id
-
-    def points(self,x,y,dx=None,dy=None,color=0,symbol=0,label=None):
-        """Draw markers with error bars"""
-        self.subplot.set_yscale('linear')
-        self.subplot.set_xscale('linear')
-        
-        # Convert tuple (lo,hi) to array [(x-lo),(hi-x)]
-        if dx != None and type(dx) == type(()):
-            dx = nx.vstack((x-dx[0],dx[1]-x)).transpose()
-        if dy != None and type(dy) == type(()):
-            dy = nx.vstack((y-dy[0],dy[1]-y)).transpose()
-
-        if dx==None and dy==None:
-            h = self.subplot.plot(x,y,color=self._color(color),
-                                   marker=self._symbol(symbol),linestyle='',label=label)
-        else:
-            col = self._color(color)
-            self.subplot.errorbar(x, y, yerr=dy, xerr=None,
-             ecolor=col, capsize=2,linestyle='', barsabove=False,
-             mec=col, mfc=col,
-             marker=self._symbol(symbol),
-             lolims=False, uplims=False,
-             xlolims=False, xuplims=False,label=label)
-            
-        self.subplot.set_yscale(self.yscale)
-        self.subplot.set_xscale(self.xscale)
-
-    def curve(self,x,y,dy=None,color=0,symbol=0,label=None):
-        """Draw a line on a graph, possibly with confidence intervals."""
-        c = self._color(color)
-        self.subplot.set_yscale('linear')
-        self.subplot.set_xscale('linear')
-        
-        hlist = self.subplot.plot(x,y,color=c,marker='',linestyle='-',label=label)
-        
-        self.subplot.set_yscale(self.yscale)
-        self.subplot.set_xscale(self.xscale)
-
-    def _color(self,c):
-        """Return a particular colour"""
-        return self.colorlist[c%len(self.colorlist)]
-
-    def _symbol(self,s):
-        """Return a particular symbol"""
-        return self.symbollist[s%len(self.symbollist)]
-   
-    def _replot(self, remove_fit=False):
-        """
-            Rescale the plottables according to the latest
-            user selection and update the plot
-            
-            @param remove_fit: Fit line will be removed if True
-        """
-        self.graph.reset_scale()
-        self._onEVT_FUNC_PROPERTY(remove_fit=remove_fit)
-        
-        #TODO: Why do we have to have the following line?
-        self.fit_result.reset_view()
-        
-        self.graph.render(self)
-        self.subplot.figure.canvas.draw_idle()
-   
-    def _onEVT_FUNC_PROPERTY(self, remove_fit=True):
-        """
-             Receive the x and y transformation from myDialog,Transforms x and y in View
-              and set the scale    
-        """ 
-        # The logic should be in the right order
-        # Delete first, and then get the whole list...
-        if remove_fit:
-            self.graph.delete(self.fit_result)
-            
-        list =[]
-        list = self.graph.returnPlottable()
-        
-        # Changing the scale might be incompatible with
-        # currently displayed data (for instance, going 
-        # from ln to log when all plotted values have
-        # negative natural logs). 
-        # Go linear and only change the scale at the end.
-        self.set_xscale("linear")
-        self.set_yscale("linear")
-        _xscale = 'linear'
-        _yscale = 'linear'
-        
-        
-        for item in list:
-            item.setLabel(self.xLabel,self.yLabel)
-            if ( self.xLabel=="x" ):
-                item.transformX(transform.toX,transform.errToX)
-                name, units = item.get_xaxis()
-                self.graph._xaxis_transformed("%s" % name,  "%s" % units)
-                
-                
-            if ( self.xLabel=="x^(2)" ):
-                item.transformX(transform.toX2,transform.errToX2)
-                name, units = item.get_xaxis()
-                units=convertUnit(2,units) 
-                self.graph._xaxis_transformed("%s^{2}" % name,  "%s" % units)
-                
-                
-            if (self.xLabel=="log10(x)" ):
-                item.transformX(transform.toX_pos,transform.errToX_pos)
-                _xscale = 'log'
-                name, units = item.get_xaxis() 
-                self.graph._xaxis_transformed("\log_{10}\ \  (%s)" % name,  "%s" % units)
-                
-                
-            if ( self.yLabel=="ln(y)" ):
-                item.transformY(transform.toLogX,transform.errToLogX)
-                name, units = item.get_yaxis()
-                self.graph._yaxis_transformed("\log\ \ %s" % name,  "%s" % units)
-                
-                
-            if ( self.yLabel=="y" ):
-                item.transformY(transform.toX,transform.errToX)
-                name, units = item.get_yaxis()
-                self.graph._yaxis_transformed("%s" % name,  "%s" % units)
-               
-                
-            if ( self.yLabel=="log10(y)" ): 
-                item.transformY(transform.toX_pos,transform.errToX_pos)
-                _yscale = 'log'  
-                name, units = item.get_yaxis()
-                self.graph._yaxis_transformed("\log_{10}\ \ (%s)" % name,  "%s" % units)
-                
-                
-            if ( self.yLabel=="y^(2)" ):
-                item.transformY( transform.toX2,transform.errToX2 )    
-                name, units = item.get_yaxis()
-                units=convertUnit(2,units) 
-                self.graph._yaxis_transformed("%s^{2}" % name,  "%s" % units)
-                
-                
-            if ( self.yLabel =="1/y"):
-                item.transformY(transform.toOneOverX,transform.errOneOverX )
-                name, units = item.get_yaxis()
-                units=convertUnit(-1,units)
-                self.graph._yaxis_transformed("1/%s" % name,  "%s" % units)
-                
-            if ( self.yLabel =="1/sqrt(y)" ):
-                item.transformY(transform.toOneOverSqrtX,transform.errOneOverSqrtX )
-                name, units = item.get_yaxis()
-                units=convertUnit(-0.5,units)
-                self.graph._yaxis_transformed("1/\sqrt{%s}" %name,  "%s" % units)
-                
-            if ( self.yLabel =="ln(y*x)"):
-                item.transformY( transform.toLogXY,transform.errToLogXY)
-                yname, yunits = item.get_yaxis()
-                xname, xunits = item.get_xaxis()
-                self.graph._yaxis_transformed("\log\ (%s \ \ %s)" % (yname,xname),  "%s%s" % (yunits,xunits))
-               
-                
-            if ( self.yLabel =="ln(y*x^(2))"):
-                item.transformY( transform.toLogYX2,transform.errToLogYX2)
-                yname, yunits = item.get_yaxis()
-                xname, xunits = item.get_xaxis() 
-                xunits = convertUnit(2,xunits) 
-                self.graph._yaxis_transformed("\log (%s \ \ %s^{2})" % (yname,xname),  "%s%s" % (yunits,xunits))
-                
-            
-            if ( self.yLabel =="ln(y*x^(4))"):
-                item.transformY(transform.toLogYX4,transform.errToLogYX4)
-                yname, yunits = item.get_yaxis()
-                xname, xunits = item.get_xaxis()
-                xunits = convertUnit(4,xunits) 
-                self.graph._yaxis_transformed("\log (%s \ \ %s^{4})" % (yname,xname),  "%s%s" % (yunits,xunits))
-                
-            if ( self.viewModel == "Guinier lny vs x^(2)"):
-                
-                item.transformX(transform.toX2,transform.errToX2)
-                name, units = item.get_xaxis()
-                units = convertUnit(2,units) 
-                self.graph._xaxis_transformed("%s^{2}" % name,  "%s" % units)
-                
-                
-                item.transformY(transform.toLogX,transform.errToLogX )
-                name, units = item.get_yaxis()
-                self.graph._yaxis_transformed("\log\ \ %s" % name,  "%s" % units)
-               
-                
-            item.transformView()
-            
-        self.resetFitView()   
-        self.prevXtrans = self.xLabel 
-        self.prevYtrans = self.yLabel  
-        self.graph.render(self)
-        
-        self.set_xscale(_xscale)
-        self.set_yscale(_yscale)
-         
-        self.subplot.figure.canvas.draw_idle()
-        
-        
-    
-    def onFitDisplay(self, tempx,tempy,xminView,xmaxView,xmin,xmax,func):
-        """
-            Add a new plottable into the graph .In this case this plottable will be used 
-            to fit some data
-            @param tempx: The x data of fit line
-            @param tempy: The y data of fit line
-            @param xminView: the lower bound of fitting range
-            @param xminView: the upper bound of  fitting range
-            @param xmin: the lowest value of data to fit to the line
-            @param xmax: the highest value of data to fit to the line
-        """
-        # Saving value to redisplay in Fit Dialog when it is opened again
-        self.Avalue,self.Bvalue,self.ErrAvalue,self.ErrBvalue,self.Chivalue=func
-        self.xminView=xminView
-        self.xmaxView=xmaxView
-        self.xmin= xmin
-        self.xmax= xmax
-        #In case need to change the range of data plotted
-        list =[]
-        list = self.graph.returnPlottable()
-        for item in list:
-            #item.onFitRange(xminView,xmaxView)
-            item.onFitRange(None,None)
-        
-        # Create new data plottable with result
-        self.fit_result.x =[] 
-        self.fit_result.y =[]
-        self.fit_result.x =tempx  
-        self.fit_result.y =tempy     
-        self.fit_result.dx=None
-        self.fit_result.dy=None
-        #Load the view with the new values
-        self.fit_result.reset_view()
-        # Add the new plottable to the graph 
-        self.graph.add(self.fit_result) 
-        self.graph.render(self)
-        self._offset_graph()
-        self.subplot.figure.canvas.draw_idle()
-        
-   
-    def onResetGraph(self,event):
-        """
-            Reset the graph by plotting the full range of data 
-        """
-        list =[]
-        list = self.graph.returnPlottable()
-        for item in list:
-            item.onReset()
-        self.graph.render(self)
-        self.subplot.figure.canvas.draw_idle()
-        
-class NoRepaintCanvas(FigureCanvasWxAgg):
-    """We subclass FigureCanvasWxAgg, overriding the _onPaint method, so that
-    the draw method is only called for the first two paint events. After that,
-    the canvas will only be redrawn when it is resized.
-    """
-    def __init__(self, *args, **kwargs):
-        FigureCanvasWxAgg.__init__(self, *args, **kwargs)
-        self._drawn = 0
-
-    def _onPaint(self, evt):
-        """
-        Called when wxPaintEvt is generated
-        """
-        if not self._isRealized:
-            self.realize()
-        if self._drawn < 2:
-            self.draw(repaint = False)
-            self._drawn += 1
-        self.gui_repaint(drawDC=wx.PaintDC(self))
-           
Index: itools/PropertyDialog.py
===================================================================
--- guitools/PropertyDialog.py	(revision 573eb2d6f6edac31cb4abc63b97d363251796b04)
+++ 	(revision )
@@ -1,101 +1,0 @@
-#!/usr/bin/python
-
-# myDialog.py
-
-import wx
-
-class Properties(wx.Dialog):
-    def __init__(self, parent, id, title):
-        wx.Dialog.__init__(self, parent, id, "Select the scale of the graph")
-        """
-            for the properties window
-        """
-        self.parent = parent
-        vbox  = wx.BoxSizer(wx.VERTICAL)
-        sizer = wx.GridBagSizer(5,5)
-
-        x_size = 70
-
-        ix = 1
-        iy = 1
-        sizer.Add(wx.StaticText(self, -1, 'X'),(iy, ix))
-        ix += 2
-        sizer.Add(wx.StaticText(self, -1, 'Y'),(iy, ix))
-        ix += 2
-        sizer.Add(wx.StaticText(self, -1, 'View'),(iy, ix))
-        iy += 1
-        ix = 1
-        self.xvalue = wx.ComboBox(self, -1)
-        x_size += self.xvalue.GetSize()[0]
-        sizer.Add(self.xvalue,(iy,ix), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        
-        ix +=2
-        self.yvalue = wx.ComboBox(self, -1)
-        x_size += self.yvalue.GetSize()[0]
-        sizer.Add( self.yvalue,(iy, ix), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        
-        ix +=2
-        self.view =wx.ComboBox(self, -1)
-        x_size += self.view.GetSize()[0]
-        self.view.SetMinSize((160,30))
-        sizer.Add(self.view,(iy,ix), (1,1), wx.EXPAND|wx.RIGHT|wx.ADJUST_MINSIZE, 10)
-        
-        self.SetMinSize((x_size,50))
-        
-        vbox.Add(sizer, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-       
-       
-        btCancel=wx.Button(self, wx.ID_CANCEL,'Cancel' )
-        btOk = wx.Button(self, wx.ID_OK, "OK")
-
-        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_button.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        sizer_button.Add(btOk, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)
-        sizer_button.Add(btCancel, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)        
-        vbox.Add(sizer_button, 0, wx.EXPAND|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE, 10)
- 
-        
-        # scale value for x
-        self.xvalue.SetValue("x")
-        self.xvalue.Insert("x",0)
-        self.xvalue.Insert("x^(2)",1)
-        self.xvalue.Insert("log10(x)",2)
-        
-        
-        # scale value for y
-        self.yvalue.SetValue("log10(y)")
-        self.yvalue.Insert("y",0)
-        self.yvalue.Insert("1/y",1)
-        self.yvalue.Insert("ln(y)",2)
-        self.yvalue.Insert("y^(2)",3)
-        self.yvalue.Insert("1/sqrt(y)",4)
-        self.yvalue.Insert("log10(y)",5)
-        self.yvalue.Insert("ln(y*x)",6)
-        self.yvalue.Insert("ln(y*x^(2))",7)
-        self.yvalue.Insert("ln(y*x^(4))",8)
-        
-        # type of view or model used 
-        self.view.SetValue("--")
-        self.view.Insert("--",0)
-        self.view.Insert("Guinier lny vs x^(2)",1)
-        
-        self.SetSizer(vbox)
-        
-        self.Fit()        
-        self.Centre()
-           
-        
-    def setValues(self,x,y,view):
-        return  self.xvalue.SetValue(x),  self.yvalue.SetValue(y),self.view.SetValue(view)
-        
-    def getValues(self):
-        return self.xvalue.GetValue(), self.yvalue.GetValue(),self.view.GetValue()
-        
-
-if __name__ == "__main__": 
-    app = wx.App()
-    dialog = Properties(None, -1, 'Properties')
-    dialog.ShowModal()
-    app.MainLoop()
-
-
Index: itools/aboutbox.py
===================================================================
--- guitools/aboutbox.py	(revision 4e290cdc8529613c8819aaaec7949e6ff9fa2c49)
+++ 	(revision )
@@ -1,211 +1,0 @@
-#!/usr/bin/env python
-########################################################################
-#
-# PDFgui            by DANSE Diffraction group
-#                   Simon J. L. Billinge
-#                   (c) 2006 trustees of the Michigan State University.
-#                   All rights reserved.
-#
-# File coded by:    Dmitriy Bryndin
-#
-# See AUTHORS.txt for a list of people who contributed.
-# See LICENSE.txt for license information.
-#
-# Modified by U. Tennessee for DANSE/SANS
-########################################################################
-
-# version
-__id__ = "$Id: aboutdialog.py 1193 2007-05-03 17:29:59Z dmitriy $"
-__revision__ = "$Revision: 1193 $"
-
-import wx
-import wx.lib.hyperlink
-import random
-import os.path
-import os
-import config
-
-def launchBrowser(url):
-    '''Launches browser and opens specified url
-    
-    In some cases may require BROWSER environment variable to be set up.
-    
-    @param url: URL to open
-    '''
-    import webbrowser
-    webbrowser.open(url)
-
-
-class DialogAbout(wx.Dialog):
-    '''"About" Dialog
-    
-    Shows product name, current version, authors, and link to the product page.
-    Current version is taken from version.py
-    '''
-    
-    def __init__(self, *args, **kwds):
-
-        # begin wxGlade: DialogAbout.__init__
-        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
-        wx.Dialog.__init__(self, *args, **kwds)
-        
-        # Mac doesn't display images with transparent background so well, keep it for Windows
-        if os.name == 'nt':
-            self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(os.path.join("images",config._corner_image)))
-        else:
-            self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(os.path.join("images",config._corner_image)))
-        
-        self.label_title = wx.StaticText(self, -1, config.__appname__)
-        self.label_version = wx.StaticText(self, -1, "")
-        self.label_build = wx.StaticText(self, -1, "Build:")
-        self.label_svnrevision = wx.StaticText(self, -1, "")
-        self.label_copyright = wx.StaticText(self, -1, config._copyright)
-        self.label_author = wx.StaticText(self, -1, "authors")
-        self.hyperlink = wx.lib.hyperlink.HyperLinkCtrl(self, -1, config._homepage, URL=config._homepage)
-        #self.hyperlink_license = wx.lib.hyperlink.HyperLinkCtrl(self, -1, "Comments? Bugs? Requests?", URL=config._paper)
-        self.hyperlink_license = wx.StaticText(self, -1, "Comments? Bugs? Requests?")
-        self.hyperlink_paper = wx.lib.hyperlink.HyperLinkCtrl(self, -1, "Send us a ticket", URL=config._license)
-        self.hyperlink_download = wx.lib.hyperlink.HyperLinkCtrl(self, -1, "Get the latest version", URL=config._download)
-        self.static_line_1 = wx.StaticLine(self, -1)
-        self.label_acknowledgement = wx.StaticText(self, -1, config._acknowledgement)
-        self.static_line_2 = wx.StaticLine(self, -1)
-        self.bitmap_button_nsf = wx.BitmapButton(self, -1, wx.NullBitmap)
-        self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap)
-        self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap)
-        self.static_line_3 = wx.StaticLine(self, -1)
-        self.button_OK = wx.Button(self, wx.ID_OK, "OK")
-
-        self.__set_properties()
-        self.__do_layout()
-
-        self.Bind(wx.EVT_BUTTON, self.onNsfLogo, self.bitmap_button_nsf)
-        self.Bind(wx.EVT_BUTTON, self.onDanseLogo, self.bitmap_button_danse)
-        self.Bind(wx.EVT_BUTTON, self.onUTLogo, self.bitmap_button_msu)
-        # end wxGlade
-        
-        # fill in acknowledgements
-#       self.text_ctrl_acknowledgement.SetValue(__acknowledgement__)
-
-        # randomly shuffle authors' names
-        random.shuffle(config._authors)
-        strLabel = ", ".join(config._authors)
-        
-        # display version and svn revison numbers
-        verwords = config.__version__.split('.')
-        version = '.'.join(verwords[:-1])
-        revision = verwords[-1]
-        
-        self.label_author.SetLabel(strLabel)
-        self.label_version.SetLabel(version)
-        self.label_svnrevision.SetLabel(config.__version__)
-        
-        # set bitmaps for logo buttons
-        logo = wx.Bitmap(os.path.join("images",config._nsf_logo))
-        self.bitmap_button_nsf.SetBitmapLabel(logo)
-        logo = wx.Bitmap(os.path.join("images",config._danse_logo))
-        self.bitmap_button_danse.SetBitmapLabel(logo)
-        logo = wx.Bitmap(os.path.join("images",config._inst_logo))
-        self.bitmap_button_msu.SetBitmapLabel(logo)
-        
-        # resize dialog window to fit version number nicely
-        if wx.VERSION >= (2,7,2,0):
-            size = [self.GetEffectiveMinSize()[0], self.GetSize()[1]]
-        else:
-            size = [self.GetBestFittingSize()[0], self.GetSize()[1]]
-
-        self.Fit()
-#        self.SetSize(size)
-#       self.FitInside()
-        
-
-    def __set_properties(self):
-        # begin wxGlade: DialogAbout.__set_properties
-        self.SetTitle("About")
-        self.SetSize((600, 595))
-        self.label_title.SetFont(wx.Font(26, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
-        self.label_version.SetFont(wx.Font(26, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
-        #self.hyperlink_license.Enable(False)
-        #self.hyperlink_license.Hide()
-        self.hyperlink_paper.Enable(True)
-        #self.hyperlink_paper.Hide()
-        self.bitmap_button_nsf.SetSize(self.bitmap_button_nsf.GetBestSize())
-        self.bitmap_button_danse.SetSize(self.bitmap_button_danse.GetBestSize())
-        self.bitmap_button_msu.SetSize(self.bitmap_button_msu.GetBestSize())
-        # end wxGlade
-
-    def __do_layout(self):
-        # begin wxGlade: DialogAbout.__do_layout
-        sizer_main = wx.BoxSizer(wx.VERTICAL)
-        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_logos = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_header = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_titles = wx.BoxSizer(wx.VERTICAL)
-        sizer_build = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_title = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND, 0)
-        sizer_title.Add(self.label_title, 0, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10)
-        sizer_title.Add((20, 20), 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        sizer_title.Add(self.label_version, 0, wx.RIGHT|wx.ALIGN_BOTTOM|wx.ADJUST_MINSIZE, 10)
-        sizer_titles.Add(sizer_title, 0, wx.EXPAND, 0)
-        sizer_build.Add(self.label_build, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)
-        sizer_build.Add(self.label_svnrevision, 0, wx.ADJUST_MINSIZE, 0)
-        sizer_titles.Add(sizer_build, 0, wx.TOP|wx.EXPAND, 5)
-        sizer_titles.Add(self.label_copyright, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.ADJUST_MINSIZE, 10)
-        sizer_titles.Add(self.label_author, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)
-        sizer_titles.Add(self.hyperlink, 0, wx.LEFT|wx.RIGHT, 10)
-        sizer_titles.Add((20, 20), 0, wx.ADJUST_MINSIZE, 0)
-        sizer_titles.Add(self.hyperlink_license, 0, wx.LEFT|wx.RIGHT, 10)
-        sizer_titles.Add(self.hyperlink_paper, 0, wx.LEFT|wx.RIGHT, 10)
-        sizer_titles.Add((20, 20), 0, wx.ADJUST_MINSIZE, 0)
-        sizer_titles.Add(self.hyperlink_download, 0, wx.LEFT|wx.RIGHT, 10)
-        sizer_header.Add(sizer_titles, 0, wx.EXPAND, 0)
-        sizer_main.Add(sizer_header, 0, wx.BOTTOM|wx.EXPAND, 3)
-        sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0)
-        sizer_main.Add(self.label_acknowledgement, 0, wx.LEFT|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE, 7)
-        sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0)
-        sizer_logos.Add(self.bitmap_button_nsf, 0, wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_danse, 0, wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_msu, 0, wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add((50, 50), 0, wx.ADJUST_MINSIZE, 0)
-        sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0)
-        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.RIGHT|wx.ADJUST_MINSIZE, 10)
-        sizer_main.Add(sizer_button, 0, wx.EXPAND, 0)
-        self.SetAutoLayout(True)
-        self.SetSizer(sizer_main)
-        self.Layout()
-        self.Centre()
-        # end wxGlade
-
-    def onNsfLogo(self, event): # wxGlade: DialogAbout.<event_handler>
-        launchBrowser(config._nsf_url)
-        event.Skip()
-
-    def onDanseLogo(self, event): # wxGlade: DialogAbout.<event_handler>
-        launchBrowser(config._danse_url)
-        event.Skip()
-
-    def onUTLogo(self, event): # wxGlade: DialogAbout.<event_handler>
-        launchBrowser(config._inst_url)
-        event.Skip()
-
-# end of class DialogAbout
-
-##### testing code ############################################################
-class MyApp(wx.App):
-    def OnInit(self):
-        wx.InitAllImageHandlers()
-        dialog = DialogAbout(None, -1, "")
-        self.SetTopWindow(dialog)
-        dialog.ShowModal()
-        dialog.Destroy()
-        return 1
-
-# end of class MyApp
-
-if __name__ == "__main__":
-    app = MyApp(0)
-    app.MainLoop()
-    
-##### end of testing code #####################################################    
Index: itools/binder.py
===================================================================
--- guitools/binder.py	(revision 4972de2b5011084cbeaf6d68d05d0d2406b76a68)
+++ 	(revision )
@@ -1,384 +1,0 @@
-"""
-Extension to MPL to support the binding of artists to key/mouse events.
-"""
-
-class Selection:
-    """
-    Store and compare selections.
-    """
-    # TODO: We need some way to check in prop matches, preferably
-    # TODO: without imposing structure on prop.
-        
-    artist=None
-    prop={}
-    def __init__(self,artist=None,prop={}):
-        self.artist,self.prop = artist,self.prop
-    def __eq__(self,other):
-        return self.artist is other.artist
-    def __ne__(self,other):
-        return self.artist is not other.artist
-    def __nonzero__(self):
-        return self.artist is not None
-
-class BindArtist:
-
-    # Track keyboard modifiers for events.
-    # TODO: Move keyboard modifier support into the backend.  We cannot
-    # TODO: properly support it from outside the windowing system since there
-    # TODO: is no way to recognized whether shift is held down when the mouse
-    # TODO: first clicks on the the application window.
-    control,shift,alt,meta=False,False,False,False
-
-    # Track doubleclick
-    dclick_threshhold = 0.25
-    _last_button, _last_time = None, 0
-    
-    # Mouse/keyboard events we can bind to
-    events= ['enter','leave','motion','click','dclick','drag','release',
-             'scroll','key','keyup']
-    # TODO: Need our own event structure
-    
-    def __init__(self,figure):
-        canvas = figure.canvas
-
-        # Link to keyboard/mouse
-        try:
-            self._connections = [
-                canvas.mpl_connect('motion_notify_event',self._onMotion),
-                canvas.mpl_connect('button_press_event',self._onClick),
-                canvas.mpl_connect('button_release_event',self._onRelease),
-                canvas.mpl_connect('key_press_event',self._onKey),
-                canvas.mpl_connect('key_release_event',self._onKeyRelease),
-                canvas.mpl_connect('scroll_event',self._onScroll)
-            ]
-        except:
-            print "bypassing scroll_event: wrong matplotlib version"
-            self._connections = [
-                canvas.mpl_connect('motion_notify_event',self._onMotion),
-                canvas.mpl_connect('button_press_event',self._onClick),
-                canvas.mpl_connect('button_release_event',self._onRelease),
-                canvas.mpl_connect('key_press_event',self._onKey),
-                canvas.mpl_connect('key_release_event',self._onKeyRelease),
-            ]
-            
-
-        # Turn off picker if it hasn't already been done
-        try:
-            canvas.mpl_disconnect(canvas.button_pick_id)
-            canvas.mpl_disconnect(canvas.scroll_pick_id)
-        except: 
-            pass
-        
-        self.canvas = canvas
-        self.figure = figure
-        self.clearall()
-        
-    def clear(self, *artists):
-        """
-        self.clear(h1,h2,...)
-            Remove connections for artists h1, h2, ...
-            
-        Use clearall() to reset all connections.
-        """
-
-        for h in artists:
-            for a in self.events:
-                if h in self._actions[a]: del self._actions[a][h]
-            if h in self._artists: self._artists.remove(h)
-        if self._current.artist in artists: self._current = Selection()
-        if self._hasclick.artist in artists: self._hasclick = Selection()
-        if self._haskey.artist in artists: self._haskey = Selection()
-        
-    def clearall(self):
-        """
-        Clear connections to all artists.
-        
-        Use clear(h1,h2,...) to reset specific artists.
-        """
-        # Don't monitor any actions
-        self._actions = {}
-        for action in self.events:
-            self._actions[action] = {}
-
-        # Need activity state
-        self._artists = []
-        self._current = Selection()
-        self._hasclick = Selection()
-        self._haskey = Selection()
-
-    def disconnect(self):
-        """
-        In case we need to disconnect from the canvas...
-        """
-        try: 
-            for cid in self._connections: self.canvas.mpl_disconnect(cid)
-        except: 
-            pass
-        self._connections = []
-
-    def __del__(self):
-        self.disconnect()
-
-    def __call__(self,trigger,artist,action):
-        """Register a callback for an artist to a particular trigger event.
-        
-        usage:
-            self.connect(eventname,artist,action)
-    
-        where:
-            eventname is a string
-            artist is the particular graph object to respond to the event
-            action(event,**kw) is called when the event is triggered
-
-        The action callback is associated with particular artists.
-        Different artists will have different kwargs.  See documentation
-        on the contains() method for each artist.  One common properties
-        are ind for the index of the item under the cursor, which is
-        returned by Line2D and by collections.
-
-        The following events are supported:
-            enter: mouse cursor moves into the artist or to a new index
-            leave: mouse cursor leaves the artist
-            click: mouse button pressed on the artist
-            drag: mouse button pressed on the artist and cursor moves
-            release: mouse button released for the artist
-            key: key pressed when mouse is on the artist
-            keyrelease: key released for the artist
-    
-        The event received by action has a number of attributes:
-            name is the event name which was triggered
-            artist is the object which triggered the event
-            x,y are the screen coordinates of the mouse
-            xdata,ydata are the graph coordinates of the mouse
-            button is the mouse button being pressed/released
-            key is the key being pressed/released
-            shift,control,alt,meta are flags which are true if the
-                corresponding key is pressed at the time of the event.
-            details is a dictionary of artist specific details, such as the 
-                id(s) of the point that were clicked.
-                
-        When receiving an event, first check the modifier state to be
-        sure it applies.  E.g., the callback for 'press' might be:
-            if event.button == 1 and event.shift: process Shift-click
-
-        TODO: Only receive events with the correct modifiers (e.g., S-click,
-        TODO:   or *-click for any modifiers).
-        TODO: Only receive button events for the correct button (e.g., click1
-        TODO:   release3, or dclick* for any button)
-        TODO: Support virtual artist, so that and artist can be flagged as
-        TODO:   having a tag list and receive the correct events
-        TODO: Support virtual events for binding to button-3 vs shift button-1
-        TODO:   without changing callback code
-        TODO: Attach multiple callbacks to the same event?
-        TODO: Clean up interaction with toolbar modes
-        TODO: push/pushclear/pop context so that binding changes for the duration
-        TODO:   e.g., to support ? context sensitive help
-        """
-        # Check that the trigger is valid
-        if trigger not in self._actions:
-            raise ValueError,"%s invalid --- valid triggers are %s"\
-                %(trigger,", ".join(self.events))
-
-        # Register the trigger callback
-        self._actions[trigger][artist]=action
-        #print "==> added",artist,[artist],"to",trigger,":",self._actions[trigger].keys()
-
-        # Maintain a list of all artists
-        if artist not in self._artists: 
-            self._artists.append(artist)
-
-    def trigger(self,actor,action,ev):
-        """
-        Trigger a particular event for the artist.  Fallback to axes,
-        to figure, and to 'all' if the event is not processed.
-        """
-        if action not in self.events:
-            raise ValueError, "Trigger expects "+", ".join(self.events)
-        
-        # Tag the event with modifiers
-        for mod in ('alt','control','shift','meta'):
-            setattr(ev,mod,getattr(self,mod))
-        setattr(ev,'artist',None)
-        setattr(ev,'action',action)
-        setattr(ev,'prop',{})
-        
-        # Fallback scheme.  If the event does not return false, pass to parent.
-        processed = False
-        artist,prop = actor.artist,actor.prop
-        if artist in self._actions[action]:
-            ev.artist,ev.prop = artist,prop
-            processed = self._actions[action][artist](ev)
-        if not processed and ev.inaxes in self._actions[action]:
-            ev.artist,ev.prop = ev.inaxes,{}
-            processed = self._actions[action][ev.inaxes](ev)
-        if not processed and self.figure in self._actions[action]:
-            ev.artist,ev.prop = self.figure,{}
-            processed = self._actions[action][self.figure](ev)
-        if not processed and 'all' in self._actions[action]:
-            ev.artist,ev.prop = None,{}
-            processed = self._actions[action]['all'](ev)
-        return processed
-
-    def _find_current(self, event):
-        """
-        Find the artist who will receive the event.  Only search
-        registered artists.  All others are invisible to the mouse.
-        """
-        # TODO: sort by zorder of axes then by zorder within axes
-        self._artists.sort(cmp=lambda x,y: cmp(y.zorder,x.zorder))
-        # print "search"," ".join([str(h) for h in self._artists])
-        found = Selection()
-        #print "searching in",self._artists
-        for artist in self._artists:
-            # TODO: should contains() return false if invisible?
-            if not artist.get_visible(): 
-                continue
-            # TODO: optimization - exclude artists not inaxes
-            try:
-                inside,prop = artist.contains(event)
-            except:
-                # Probably an old version of matplotlib
-                inside = False
-            if inside:
-                found.artist,found.prop = artist,prop
-                break
-        #print "found",found.artist
-        
-        # TODO: how to check if prop is equal?
-        if found != self._current:
-            self.trigger(self._current,'leave',event)
-            self.trigger(found,'enter',event)
-        self._current = found
-
-        return found
-        
-    def _onMotion(self,event):
-        """
-        Track enter/leave/motion through registered artists; all
-        other artists are invisible.
-        """
-        ## Can't kill double-click on motion since Windows produces
-        ## spurious motion events.
-        #self._last_button = None
-        
-        # Dibs on the motion event for the clicked artist
-        if self._hasclick:
-            # Make sure the x,y data use the coordinate system of the
-            # artist rather than the default axes coordinates.
-            
-            transform = self._hasclick.artist.get_transform()
-            #x,y = event.xdata,event.ydata
-            x,y = event.x,event.y
-            x,y = transform.inverse_xy_tup((x,y))
-            event.xdata,event.ydata = x,y
-            self.trigger(self._hasclick,'drag',event)
-        else:
-            found = self._find_current(event)
-            #print "found",found.artist
-            self.trigger(found,'motion',event)
-
-    def _onClick(self,event):
-        """
-        Process button click
-        """
-        import time
-        
-        # Check for double-click
-        event_time = time.time()
-        #print event_time,self._last_time,self.dclick_threshhold
-        #print (event_time > self._last_time + self.dclick_threshhold)
-        #print event.button,self._last_button
-        if (event.button != self._last_button) or \
-                (event_time > self._last_time + self.dclick_threshhold):
-            action = 'click'
-        else:
-            action = 'dclick'
-        self._last_button = event.button
-        self._last_time = event_time
-        
-        # If an artist is already dragging, feed any additional button
-        # presses to that artist.
-        # TODO: do we want to force a single button model on the user?
-        # TODO: that is, once a button is pressed, no other buttons
-        # TODO: can come through?  I think this belongs in canvas, not here.
-        if self._hasclick:
-            found = self._hasclick
-        else:
-            found = self._find_current(event)
-        #print "button %d pressed"%event.button
-        # Note: it seems like if "click" returns False then hasclick should
-        # not be set.  The problem is that there are two reasons it can
-        # return false: because there is no click action for this artist
-        # or because the click action returned false.  A related problem
-        # is that click actions will go to the canvas if there is no click
-        # action for the artist, even if the artist has a drag. I'll leave
-        # it to future maintainers to sort out this problem.  For now the
-        # recommendation is that users should define click if they have
-        # drag or release on the artist.
-        self.trigger(found,action,event)
-        self._hasclick = found
-
-    def _onDClick(self,event):
-        """
-        Process button double click
-        """
-        # If an artist is already dragging, feed any additional button
-        # presses to that artist.
-        # TODO: do we want to force a single button model on the user?
-        # TODO: that is, once a button is pressed, no other buttons
-        # TODO: can come through?  I think this belongs in canvas, not here.
-        if self._hasclick:
-            found = self._hasclick
-        else:
-            found = self._find_current(event)
-        self.trigger(found,'dclick',event)
-        self._hasclick = found
-
-    def _onRelease(self,event):
-        """
-        Process release release
-        """
-        self.trigger(self._hasclick,'release',event)
-        self._hasclick = Selection()
-            
-    def _onKey(self,event):
-        """
-        Process key click
-        """
-        # TODO: Do we really want keyboard focus separate from mouse focus?
-        # TODO: Do we need an explicit focus command for keyboard?
-        # TODO: Can we tab between items?
-        # TODO: How do unhandled events get propogated to axes, figure and
-        # TODO: finally to application?  Do we need to implement a full tags 
-        # TODO: architecture a la Tk?
-        # TODO: Do modifiers cause a grab?  Does the artist see the modifiers?
-        if event.key in ('alt','meta','control','shift'):
-            setattr(self,event.key,True)
-            return
-
-        if self._haskey:
-            found = self._haskey
-        else:
-            found = self._find_current(event)
-        self.trigger(found,'key',event)
-        self._haskey = found
-    
-    def _onKeyRelease(self,event):
-        """
-        Process key release
-        """
-        if event.key in ('alt','meta','control','shift'):
-            setattr(self,event.key,False)
-            return
-        
-        if self._haskey:
-            self.trigger(self._haskey,'keyup',event)
-        self._haskey = Selection()
-
-    def _onScroll(self,event):
-        """
-        Process scroll event
-        """
-        found = self._find_current(event)
-        self.trigger(found,'scroll',event)
-
Index: itools/canvas.py
===================================================================
--- guitools/canvas.py	(revision 6ed101afdd576ec843ab16c992bbe4992d64a822)
+++ 	(revision )
@@ -1,101 +1,0 @@
-import wx
-from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg, _convert_agg_to_wx_bitmap
-from matplotlib.backends.backend_agg import FigureCanvasAgg
-from matplotlib.backend_bases import MouseEvent
-
-class FigureCanvas(FigureCanvasWxAgg):
-    """
-    Add features to the wx agg canvas for better support of AUI and
-    faster plotting.
-    """
-
-    def __init__(self, *args, **kw):
-        super(FigureCanvas,self).__init__(*args, **kw)
-        self._isRendered = False
-        
-        # Create an timer for handling draw_idle requests
-        # If there are events pending when the timer is
-        # complete, reset the timer and continue.  The
-        # alternative approach, binding to wx.EVT_IDLE,
-        # doesn't behave as nicely.
-        self.idletimer = wx.CallLater(1,self._onDrawIdle)
-        # Support for mouse wheel
-        self.Bind(wx.EVT_MOUSEWHEEL, self._onMouseWheel)
-
-
-    def draw_idle(self, *args, **kwargs):
-        """
-        Render after a delay if no other render requests have been made.
-        """
-        self.idletimer.Restart(5, *args, **kwargs)  # Delay by 5 ms
-
-    def _onDrawIdle(self, *args, **kwargs):
-        if False and wx.GetApp().Pending():
-            self.idletimer.Restart(5, *args, **kwargs)
-        else:
-            self.draw(*args, **kwargs)
-
-    def draw(self, drawDC=None):
-        """
-        Render the figure using agg.
-        """
-
-        # Only draw if window is shown, otherwise graph will bleed through
-        # on the notebook style AUI widgets.
-        if self.IsShownOnScreen():
-            self._isRendered = True
-            FigureCanvasWxAgg.draw(self)
-            self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)
-            self.gui_repaint(drawDC=drawDC)
-        else:
-            self._isRendered = False
-    def _onMouseWheel(self, evt):
-        """Translate mouse wheel events into matplotlib events"""
-        # Determine mouse location
-        w,h = self.figure.canvas.get_width_height()
-        x = evt.GetX()
-        y = h - evt.GetY()
-
-        # Convert delta/rotation/rate into a floating point step size
-        delta = evt.GetWheelDelta()
-        rotation = evt.GetWheelRotation()
-        rate = evt.GetLinesPerAction()
-        #print "delta,rotation,rate",delta,rotation,rate
-        step = rate*float(rotation)/delta
-
-        # Convert to mpl event
-        evt.Skip()
-        self.scroll_event(x, y, step, guiEvent=evt)
-
-    def scroll_event(self, x, y, step=1, guiEvent=None):
-        """
-        Backend derived classes should call this function on any
-        scroll wheel event.  x,y are the canvas coords: 0,0 is lower,
-        left.  button and key are as defined in MouseEvent
-        """
-        button = 'up' if step >= 0 else 'down'
-        self._button = button
-        s = 'scroll_event'
-        event = MouseEvent(s, self, x, y, button, self._key, guiEvent=guiEvent)
-        setattr(event,'step',step)
-        self.callbacks.process(s, event)
-
-
-    def _onPaint(self, evt):
-        """
-        Called when wxPaintEvt is generated
-        """
-
-        if not self._isRealized:
-            self.realize()
-
-        # Need to draw the graph the first time it is shown otherwise
-        # it is a black canvas.  After that we can use the rendered 
-        # bitmap for updates.
-        if self._isRendered:
-            self.gui_repaint(drawDC=wx.PaintDC(self))
-        else:
-            self.draw(drawDC=wx.PaintDC(self))
-
-        evt.Skip()
-   
Index: itools/data_generator/linear.txt
===================================================================
--- guitools/data_generator/linear.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  4.21109  0.28175
-0.213878  4.39887  0.317429
-0.417755  5.41562  0.353107
-0.621633  5.75563  0.388786
-0.82551  5.33939  0.424464
-1.02939  6.45678  0.460143
-1.23327  6.79205  0.495821
-1.43714  7.93867  0.5315
-1.64102  7.75161  0.567179
-1.8449  7.95457  0.602857
-2.04878  8.17361  0.638536
-2.25265  9.29893  0.674214
-2.45653  9.54271  0.709893
-2.66041  11.0321  0.745571
-2.86429  11.9139  0.78125
-3.06816  11.8059  0.816929
-3.27204  13.3123  0.852607
-3.47592  11.2891  0.888286
-3.6798  13.3376  0.923964
-3.88367  12.1024  0.959643
-4.08755  14.3129  0.995321
-4.29143  13.9388  1.031
-4.49531  16.1019  1.06668
-4.69918  16.898  1.10236
-4.90306  15.3141  1.13804
-5.10694  15.7769  1.17371
-5.31082  18.941  1.20939
-5.51469  18.2135  1.24507
-5.71857  19.405  1.28075
-5.92245  16.8944  1.31643
-6.12633  18.5731  1.35211
-6.3302  21.66  1.38779
-6.53408  21.9511  1.42346
-6.73796  20.6503  1.45914
-6.94184  22.065  1.49482
-7.14571  21.2012  1.5305
-7.34959  22.9362  1.56618
-7.55347  19.9378  1.60186
-7.75735  21.9261  1.63754
-7.96122  21.8531  1.67321
-8.1651  24.2046  1.70889
-8.36898  23.823  1.74457
-8.57286  24.7334  1.78025
-8.77673  24.1946  1.81593
-8.98061  27.4704  1.85161
-9.18449  27.1904  1.88729
-9.38837  26.0037  1.92296
-9.59224  27.7266  1.95864
-9.79612  26.9739  1.99432
-10  30.7491  2.03
Index: itools/data_generator/linear.txt_line.txt
===================================================================
--- guitools/data_generator/linear.txt_line.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0  3.36585  0.6
-0.204082  3.81589  0.676531
-0.408163  5.55447  0.753061
-0.612245  5.56557  0.829592
-0.816327  5.61916  0.906122
-1.02041  6.51882  0.982653
-1.22449  7.75599  1.05918
-1.42857  7.10419  1.13571
-1.63265  8.07074  1.21224
-1.83673  8.58405  1.28878
-2.04082  9.30284  1.36531
-2.2449  9.38598  1.44184
-2.44898  9.37361  1.51837
-2.65306  9.87356  1.5949
-2.85714  11.7657  1.67143
-3.06122  7.62904  1.74796
-3.26531  13.6205  1.82449
-3.46939  12.5429  1.90102
-3.67347  16.6936  1.97755
-3.87755  14.0171  2.05408
-4.08163  11.5002  2.13061
-4.28571  13.8845  2.20714
-4.4898  13.352  2.28367
-4.69388  14.6584  2.3602
-4.89796  14.1839  2.43673
-5.10204  18.5208  2.51327
-5.30612  18.7166  2.5898
-5.5102  14.7181  2.66633
-5.71429  15.999  2.74286
-5.91837  18.6496  2.81939
-6.12245  15.0761  2.89592
-6.32653  18.0872  2.97245
-6.53061  18.4008  3.04898
-6.73469  16.3463  3.12551
-6.93878  25.21  3.20204
-7.14286  22.3041  3.27857
-7.34694  28.208  3.3551
-7.55102  26.8189  3.43163
-7.7551  20.1973  3.50816
-7.95918  19.4889  3.58469
-8.16327  29.169  3.66122
-8.36735  25.0636  3.73776
-8.57143  23.6138  3.81429
-8.77551  25.7015  3.89082
-8.97959  26.885  3.96735
-9.18367  30.9332  4.04388
-9.38776  26.0401  4.12041
-9.59184  21.9498  4.19694
-9.79592  31.9634  4.27347
-10  36.1086  4.35
Index: itools/data_generator/logx_inv_sqrty.txt
===================================================================
--- guitools/data_generator/logx_inv_sqrty.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.02329  0.0669761  0.00976729
-1.17766  0.0521659  0.00696834
-1.35532  0.047948  0.00636476
-1.55977  0.0565792  0.00844594
-1.79507  0.0599306  0.00952072
-2.06587  0.0491594  0.00730583
-2.37751  0.0361006  0.0047441
-2.73617  0.0344446  0.00455798
-3.14893  0.0388383  0.00562079
-3.62396  0.0352893  0.00500983
-4.17065  0.0290394  0.0038454
-4.79981  0.0281314  0.00376724
-5.52389  0.030178  0.0042977
-6.35719  0.0293051  0.00421973
-7.3162  0.024369  0.00328107
-8.41988  0.0232319  0.00312975
-9.69006  0.0250963  0.00359887
-11.1519  0.0208162  0.00278279
-12.8342  0.0243297  0.00359733
-14.7702  0.0216404  0.00308567
-16.9984  0.0216947  0.00316554
-19.5627  0.0166108  0.00216653
-22.5138  0.0190148  0.0027095
-25.9101  0.0196957  0.00291536
-29.8188  0.0187753  0.00276835
-34.3171  0.0158225  0.00218417
-39.494  0.0177523  0.00264623
-45.4518  0.0149213  0.00207812
-52.3084  0.0138611  0.00189547
-60.1994  0.0157506  0.00233817
-69.2807  0.0158203  0.00239621
-79.732  0.0147632  0.0021984
-91.7599  0.0128195  0.00180988
-105.602  0.013433  0.00197459
-121.533  0.0107155  0.00143049
-139.867  0.0141431  0.00220505
-160.966  0.0133362  0.00205196
-185.249  0.0116604  0.0017045
-213.194  0.0112486  0.00164048
-245.356  0.00766655  0.000937387
-282.369  0.0109217  0.00161825
-324.965  0.00762605  0.000958415
-373.988  0.00793352  0.00103205
-430.405  0.00876134  0.00121524
-495.334  0.00865888  0.00121119
-570.057  0.00742519  0.000975459
-656.053  0.00796742  0.00109943
-755.021  0.00769823  0.00105861
-868.92  0.00872136  0.00129391
-1000  0.00634392  0.00081351
Index: itools/data_generator/logx_inv_y.txt
===================================================================
--- guitools/data_generator/logx_inv_y.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.02329  0.258797  0.0188705
-1.17766  0.228398  0.0152548
-1.35532  0.21897  0.0145334
-1.55977  0.237864  0.0177537
-1.79507  0.244807  0.0194453
-2.06587  0.221719  0.0164754
-2.37751  0.190002  0.0124844
-2.73617  0.185593  0.0122795
-3.14893  0.197074  0.0142606
-3.62396  0.187855  0.0133343
-4.17065  0.170409  0.0112828
-4.79981  0.167724  0.0112305
-5.52389  0.173718  0.0123697
-6.35719  0.171187  0.0123249
-7.3162  0.156106  0.0105091
-8.41988  0.15242  0.0102669
-9.69006  0.158418  0.0113588
-11.1519  0.144278  0.00964383
-12.8342  0.15598  0.0115314
-14.7702  0.147107  0.0104879
-16.9984  0.147291  0.0107459
-19.5627  0.128883  0.00840505
-22.5138  0.137894  0.00982455
-25.9101  0.140341  0.0103867
-29.8188  0.137023  0.0101018
-34.3171  0.125787  0.00868201
-39.494  0.133238  0.00993049
-45.4518  0.122153  0.00850623
-52.3084  0.117733  0.00804984
-60.1994  0.125501  0.00931534
-69.2807  0.125779  0.0095255
-79.732  0.121504  0.00904665
-91.7599  0.113223  0.00799251
-105.602  0.115901  0.00851846
-121.533  0.103515  0.00690956
-139.867  0.118925  0.00927077
-160.966  0.115483  0.0088843
-185.249  0.107983  0.00789242
-213.194  0.106059  0.00773379
-245.356  0.0875588  0.0053529
-282.369  0.104507  0.0077423
-324.965  0.0873273  0.00548749
-373.988  0.0890703  0.00579346
-430.405  0.093602  0.00649152
-495.334  0.0930531  0.00650808
-570.057  0.0861695  0.00566012
-656.053  0.0892604  0.00615853
-755.021  0.0877396  0.00603267
-868.92  0.0933882  0.00692756
-1000  0.0796487  0.00510686
Index: itools/data_generator/logx_lnxy.txt
===================================================================
--- guitools/data_generator/logx_lnxy.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.02329  41.5312  11.7014
-1.63636  72.5694  23.0356
-2.61671  66.7769  23.5794
-4.18439  47.7552  18.5665
-6.6913  53.108  22.5424
-10.7001  39.6051  18.224
-17.1106  41.6287  20.6404
-27.3617  129.416  68.7848
-43.7543  34.8584  19.7709
-69.9678  48.5635  29.2768
-111.886  260.596  166.4
-178.918  127.181  85.7472
-286.108  69.6402  49.4371
-457.518  200.812  149.72
-731.62  101.009  78.9137
-1169.94  55.7827  45.5705
-1870.86  322.845  275.26
-2991.7  54.9063  48.7725
-4784.05  188.87  174.509
-7650.21  92.4701  88.7383
-12233.5  116.178  115.635
-19562.7  41.2164  42.4941
-31282.8  61.8611  65.9859
-50024.6  2860.41  3153.2
-79994.7  419.281  477.157
-127920  1212.28  1422.87
-204558  15.2536  18.4476
-327110  162.156  201.896
-523084  6.80971  8.72153
-836467  1636.64  2154.52
-1.3376e+006  114.873  155.321
-2.13897e+006  407.692  565.789
-3.42044e+006  661.486  941.601
-5.46965e+006  186.818  272.594
-8.74655e+006  342.178  511.495
-1.39867e+007  5.58424  8.54668
-2.23662e+007  860.929  1348.37
-3.57659e+007  1872.25  2999.08
-5.71935e+007  803.026  1314.98
-9.14586e+007  195.314  326.802
-1.46252e+008  1702.85  2909.99
-2.33873e+008  95.8633  167.24
-3.73988e+008  1501.31  2672.71
-5.98046e+008  85.5069  155.274
-9.5634e+008  2513.31  4653.67
-1.52929e+009  994.079  1876.11
-2.4455e+009  34.2338  65.8303
-3.91061e+009  1428.81  2798.53
-6.25349e+009  82.2353  164.004
-1e+010  1165.07  2365.09
Index: itools/data_generator/logx_lny.txt
===================================================================
--- guitools/data_generator/logx_lny.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.00023  58.1656  16.2874
-1.15166  56.8873  16.5389
-1.326  72.4296  21.8336
-1.52675  61.0688  19.0632
-1.75788  73.1379  23.6143
-2.02401  145.133  48.4144
-2.33042  115.611  39.8049
-2.68323  384.56  136.525
-3.08944  109.674  40.1109
-3.55715  234.5  88.2757
-4.09567  304.581  117.921
-4.71571  273.074  108.648
-5.42962  352.094  143.86
-6.25161  788.11  330.453
-7.19804  1271.07  546.577
-8.28775  979.526  431.703
-9.54243  898.651  405.687
-10.9871  376.455  173.98
-12.6504  813.778  384.81
-14.5655  377.177  182.396
-16.7706  1494.7  738.823
-19.3095  837.891  423.143
-22.2328  877.018  452.299
-25.5986  1788.48  941.522
-29.474  603.126  323.97
-33.936  2329.79  1276.41
-39.0736  3544.96  1980.14
-44.989  4565.85  2599.31
-51.7999  7810.39  4530.09
-59.6418  4932.51  2913.74
-68.671  10246.2  6162.45
-79.0671  5502.93  3368.61
-91.0371  6461.32  4024.52
-104.819  21313.3  13503.6
-120.688  21875.4  14094.1
-138.959  10247.3  6712.04
-159.996  3394.26  2259.62
-184.217  19502  13191.8
-212.106  16716.6  11486.8
-244.217  22690  15834.5
-281.189  42400.5  30043.9
-323.758  21011.4  15113.3
-372.772  41713.3  30450.8
-429.206  90701.5  67184.1
-494.183  77690.1  58378.7
-568.997  36074.4  27493.9
-655.138  76081.1  58799.9
-754.319  96831  75874
-868.515  105524  83816.1
-1000  91116.6  73348.9
Index: itools/data_generator/logx_lnyx2.txt
===================================================================
--- guitools/data_generator/logx_lnyx2.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.00023  41.5109  11.6238
-1.60022  45.2043  14.2724
-2.56011  26.0202  9.14467
-4.0958  11.6507  4.51067
-6.55267  8.09603  3.4236
-10.4833  3.77799  1.73254
-16.7717  2.48174  1.22673
-26.8323  4.80731  2.54794
-42.9276  0.812303  0.459543
-68.6778  0.706791  0.425094
-109.874  2.36216  1.50507
-175.782  0.721841  0.485706
-281.226  0.247376  0.175287
-449.919  0.445098  0.331286
-719.804  0.140122  0.109297
-1151.58  0.0484161  0.0394943
-1842.36  0.174734  0.148775
-2947.49  0.0186205  0.0165192
-4715.55  0.0399786  0.036895
-7544.18  0.0122457  0.0117385
-12069.6  0.0096151  0.00956026
-19309.5  0.00213444  0.00219849
-30892.4  0.00200168  0.00213324
-49423.2  0.05767  0.0635199
-79069.7  0.00529299  0.00601893
-126500  0.0095596  0.0112121
-202381  7.54194e-005  9.11504e-005
-323779  0.000500384  0.000622624
-517999  1.31597e-005  1.68445e-005
-828721  0.00197096  0.00259324
-1.32583e+006  8.6597e-005  0.00011703
-2.12113e+006  0.000192  0.000266333
-3.39349e+006  0.000194696  0.000277026
-5.42908e+006  3.439e-005  5.01604e-005
-8.68573e+006  3.93654e-005  5.88233e-005
-1.38959e+007  4.02119e-007  6.15244e-007
-2.22313e+007  3.8691e-005  6.05793e-005
-3.55668e+007  5.25868e-005  8.42142e-005
-5.69016e+007  1.41025e-005  2.30878e-005
-9.10341e+007  2.14478e-006  3.58793e-006
-1.45641e+008  1.16839e-005  1.99629e-005
-2.33004e+008  4.11365e-007  7.17539e-007
-3.72772e+008  4.0254e-006  7.16521e-006
-5.96379e+008  1.43364e-007  2.60308e-007
-9.54118e+008  2.63313e-006  4.87506e-006
-1.52645e+009  6.51081e-007  1.22868e-006
-2.44209e+009  1.40184e-008  2.69553e-008
-3.90698e+009  3.65661e-007  7.16173e-007
-6.25058e+009  1.31562e-008  2.62373e-008
-1e+010  1.16507e-007  2.36509e-007
Index: itools/data_generator/logx_lnyx4.txt
===================================================================
--- guitools/data_generator/logx_lnyx4.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.00023  41.4917  11.6184
-1.60022  17.6531  5.57363
-2.56011  3.97001  1.39524
-4.0958  0.694503  0.268883
-6.55267  0.188554  0.0797344
-10.4833  0.0343768  0.0157647
-16.7717  0.00882268  0.00436106
-26.8323  0.00667709  0.00353896
-42.9276  0.000440803  0.000249375
-68.6778  0.000149851  9.01265e-005
-109.874  0.000195667  0.000124671
-175.782  2.33609e-005  1.57189e-005
-281.226  3.12786e-006  2.21635e-006
-449.919  2.1988e-006  1.63657e-006
-719.804  2.70445e-007  2.1095e-007
-1151.58  3.65092e-008  2.97815e-008
-1842.36  5.1479e-008  4.38313e-008
-2947.49  2.14331e-009  1.90145e-009
-4715.55  1.79789e-009  1.65921e-009
-7544.18  2.15159e-010  2.06248e-010
-12069.6  6.6004e-011  6.56275e-011
-19309.5  5.72455e-012  5.89634e-012
-30892.4  2.09746e-012  2.23531e-012
-49423.2  2.36096e-011  2.60045e-011
-79069.7  8.46604e-013  9.62718e-013
-126500  5.97393e-013  7.00661e-013
-202381  1.84138e-015  2.22546e-015
-323779  4.77315e-015  5.9392e-015
-517999  4.90442e-017  6.27769e-017
-828721  2.86987e-015  3.77595e-015
-1.32583e+006  4.92637e-017  6.65768e-017
-2.12113e+006  4.26744e-017  5.91957e-017
-3.39349e+006  1.69069e-017  2.40562e-017
-5.42908e+006  1.16675e-018  1.7018e-018
-8.68573e+006  5.21797e-019  7.79717e-019
-1.38959e+007  2.08249e-021  3.18622e-021
-2.22313e+007  7.82852e-020  1.22573e-019
-3.55668e+007  4.15706e-020  6.65726e-020
-5.69016e+007  4.35558e-021  7.13073e-021
-9.10341e+007  2.58807e-022  4.32948e-022
-1.45641e+008  5.50836e-022  9.41144e-022
-2.33004e+008  7.57706e-024  1.32166e-023
-3.72772e+008  2.89683e-023  5.15636e-023
-5.96379e+008  4.03083e-025  7.31885e-025
-9.54118e+008  2.89247e-024  5.35521e-024
-1.52645e+009  2.79429e-025  5.27323e-025
-2.44209e+009  2.35058e-027  4.51983e-027
-3.90698e+009  2.3955e-026  4.69177e-026
-6.25058e+009  3.36737e-028  6.71551e-028
-1e+010  1.16507e-027  2.36509e-027
Index: itools/data_generator/logx_logy.txt
===================================================================
--- guitools/data_generator/logx_logy.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.00023  11568.9  3239.51
-1.15166  10991.9  3195.69
-1.326  19169.7  5778.62
-1.52675  12942  4039.97
-1.75788  19604.1  6329.63
-2.02401  94983.5  31685.3
-2.33042  56263.6  19371.6
-2.68323  895571  317941
-3.08944  49832.3  18225.1
-3.55715  286717  107933
-4.09567  523525  202686
-4.71571  407139  161989
-5.42962  730967  298662
-6.25161  4.67345e+006  1.95957e+006
-7.19804  1.40481e+007  6.04085e+006
-8.28775  7.71026e+006  3.39812e+006
-9.54243  6.32258e+006  2.85427e+006
-10.9871  852706  394082
-12.6504  5.03138e+006  2.37918e+006
-14.5655  856473  414175
-16.7706  2.04023e+007  1.00848e+007
-19.3095  5.38131e+006  2.71761e+006
-22.2328  5.97761e+006  3.0828e+006
-25.5986  3.08404e+007  1.62355e+007
-29.474  2.52421e+006  1.35588e+006
-33.936  5.66935e+007  3.10604e+007
-39.0736  1.49033e+008  8.32466e+007
-44.989  2.66907e+008  1.51948e+008
-51.7999  9.18778e+008  5.32898e+008
-59.6418  3.18862e+008  1.88359e+008
-68.671  1.71659e+009  1.03242e+009
-79.0671  4.10238e+008  2.51127e+008
-91.0371  5.9373e+008  3.69813e+008
-104.819  9.27018e+009  5.87337e+009
-120.688  9.8428e+009  6.34163e+009
-138.959  1.717e+009  1.12464e+009
-159.996  1.34847e+008  8.97702e+007
-184.217  7.55562e+009  5.11087e+009
-212.106  5.29858e+009  3.6409e+009
-244.217  1.07073e+010  7.47221e+009
-281.189  4.51769e+010  3.20112e+010
-323.758  8.97057e+009  6.45243e+009
-372.772  4.35086e+010  3.17614e+010
-429.206  2.60213e+011  1.92744e+011
-494.183  1.82173e+011  1.3689e+011
-568.997  3.11414e+010  2.37343e+010
-655.138  1.73602e+011  1.3417e+011
-754.319  3.02498e+011  2.37029e+011
-868.515  3.68716e+011  2.92866e+011
-1000  2.62964e+011  2.11686e+011
Index: itools/data_generator/logx_y.txt
===================================================================
--- guitools/data_generator/logx_y.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.02329  3.86403  0.28175
-1.17766  4.37831  0.292429
-1.35532  4.56683  0.303107
-1.55977  4.20409  0.313786
-1.79507  4.08485  0.324464
-2.06587  4.51021  0.335143
-2.37751  5.26311  0.345821
-2.73617  5.38814  0.3565
-3.14893  5.07423  0.367179
-3.62396  5.32327  0.377857
-4.17065  5.86822  0.388536
-4.79981  5.96217  0.399214
-5.52389  5.75645  0.409893
-6.35719  5.84155  0.420571
-7.3162  6.40591  0.43125
-8.41988  6.56081  0.441929
-9.69006  6.31241  0.452607
-11.1519  6.93106  0.463286
-12.8342  6.41109  0.473964
-14.7702  6.79778  0.484643
-16.9984  6.78927  0.495321
-19.5627  7.75899  0.506
-22.5138  7.25194  0.516679
-25.9101  7.12548  0.527357
-29.8188  7.29804  0.538036
-34.3171  7.94993  0.548714
-39.494  7.50539  0.559393
-45.4518  8.18646  0.570071
-52.3084  8.49378  0.58075
-60.1994  7.96805  0.591429
-69.2807  7.95047  0.602107
-79.732  8.2302  0.612786
-91.7599  8.8321  0.623464
-105.602  8.62806  0.634143
-121.533  9.66039  0.644821
-139.867  8.40869  0.6555
-160.966  8.65932  0.666179
-185.249  9.26069  0.676857
-213.194  9.42869  0.687536
-245.356  11.4209  0.698214
-282.369  9.56875  0.708893
-324.965  11.4512  0.719571
-373.988  11.2271  0.73025
-430.405  10.6835  0.740929
-495.334  10.7465  0.751607
-570.057  11.605  0.762286
-656.053  11.2032  0.772964
-755.021  11.3974  0.783643
-868.92  10.708  0.794321
-1000  12.5551  0.805
Index: itools/data_generator/logx_y2.txt
===================================================================
--- guitools/data_generator/logx_y2.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-1.02329  1.96571  0.0716661
-1.17766  2.09244  0.0698773
-1.35532  2.13701  0.0709184
-1.55977  2.05039  0.0765187
-1.79507  2.0211  0.0802692
-2.06587  2.12373  0.0789045
-2.37751  2.29415  0.0753704
-2.73617  2.32124  0.0767909
-3.14893  2.2526  0.0815009
-3.62396  2.30722  0.0818858
-4.17065  2.42244  0.0801951
-4.79981  2.44176  0.0817474
-5.52389  2.39926  0.0854207
-6.35719  2.41693  0.0870053
-7.3162  2.53099  0.0851939
-8.41988  2.56141  0.0862668
-9.69006  2.51245  0.0900729
-11.1519  2.63269  0.0879871
-12.8342  2.53201  0.0935944
-14.7702  2.60726  0.0929412
-16.9984  2.60562  0.0950486
-19.5627  2.7855  0.0908276
-22.5138  2.69294  0.095932
-25.9101  2.66936  0.0987797
-29.8188  2.70149  0.0995813
-34.3171  2.81956  0.0973049
-39.494  2.7396  0.102094
-45.4518  2.8612  0.0996211
-52.3084  2.91441  0.0996343
-60.1994  2.82277  0.10476
-69.2807  2.81966  0.10677
-79.732  2.86883  0.106801
-91.7599  2.97189  0.104894
-105.602  2.93736  0.107945
-121.533  3.10812  0.103732
-139.867  2.89977  0.113026
-160.966  2.94267  0.113193
-185.249  3.04314  0.11121
-213.194  3.07062  0.111954
-245.356  3.37948  0.103302
-282.369  3.09334  0.114584
-324.965  3.38396  0.106321
-373.988  3.35068  0.10897
-430.405  3.26857  0.113341
-495.334  3.27819  0.114637
-570.057  3.40662  0.111883
-656.053  3.34711  0.115467
-755.021  3.376  0.116061
-868.92  3.27231  0.12137
-1000  3.54332  0.113594
Index: itools/data_generator/logx_y_err.txt
===================================================================
--- guitools/data_generator/logx_y_err.txt	(revision 3755d77dd1f4e2ab6dee7b2d899e977bc89c828b)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
--0.05	 4.0      0.4
-1.02329  3.86403  0.28175
-1.17766  4.37831  0.292429
-1.35532  4.56683  0.303107
-1.55977  4.20409  0.313786
-1.79507  4.08485  0.324464
-2.06587  4.51021  0.335143
-2.37751  5.26311  0.345821
-2.73617  5.38814  0.3565
-3.14893  5.07423  0.367179
-3.62396  5.32327  0.377857
-4.17065  5.86822  0.388536
-4.79981  5.96217  0.399214
-5.52389  5.75645  0.409893
-6.35719  5.84155  0.420571
-7.3162  6.40591  0.43125
-8.41988  6.56081  0.441929
-9.69006  6.31241  0.452607
-11.1519  6.93106  0.463286
-12.8342  6.41109  0.473964
-14.7702  6.79778  0.484643
-16.9984  6.78927  0.495321
-19.5627  7.75899  0.506
-22.5138  7.25194  0.516679
-25.9101  7.12548  0.527357
-29.8188  7.29804  0.538036
-34.3171  7.94993  0.548714
-39.494  7.50539  0.559393
-45.4518  8.18646  0.570071
-52.3084  8.49378  0.58075
-60.1994  7.96805  0.591429
-69.2807  7.95047  0.602107
-79.732  8.2302  0.612786
-91.7599  8.8321  0.623464
-105.602  8.62806  0.634143
-121.533  9.66039  0.644821
-139.867  8.40869  0.6555
-160.966  8.65932  0.666179
-185.249  9.26069  0.676857
-213.194  9.42869  0.687536
-245.356  11.4209  0.698214
-282.369  9.56875  0.708893
-324.965  11.4512  0.719571
-373.988  11.2271  0.73025
-430.405  10.6835  0.740929
-495.334  10.7465  0.751607
-570.057  11.605  0.762286
-656.053  11.2032  0.772964
-755.021  11.3974  0.783643
-868.92  10.708  0.794321
-1000  12.5551  0.805
Index: itools/data_generator/test_transfo.py
===================================================================
--- guitools/data_generator/test_transfo.py	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,50 +1,0 @@
-import math
-
-# log(x) 
-def from_log10(x, y=0):
-    return math.pow(10.0, x)
-def err_log10(x, y, dx, dy):
-    return math.pow(10.0, x)*dx
-
-# ln(x) 
-def from_lnx(x, y=0):
-    return math.exp(x)
-def err_lnx(x, y, dx, dy):
-    return math.exp(x)*dx
-
-# x^2
-def from_x2(x, y=0):
-    return math.sqrt(x)
-def err_x2(x, y, dx, dy):
-    return 0.5*dx/math.sqrt(x)
-
-# 1/x
-def from_inv_x(x, y=0):
-    return 1.0/x
-def err_inv_x(x, y, dx, dy):
-    return 1.0/(x**2)*dx
-
-# 1/sqrt(y)
-def from_inv_sqrtx(x, y=0):
-    return 1.0/x**2
-def err_inv_sqrtx(x, y, dx, dy):
-    return 2.0*math.pow(x,-3.0)*dx
-
-# ln(xy)
-def from_lnxy(x, y):
-    return math.exp(x)/y
-def err_lnxy(x, y, dx, dy):
-    return math.exp(x)/y*dx
-
-# ln(xy2)
-def from_lnx2y(x, y):
-    return math.exp(x)/y**2
-def err_lnx2y(x, y, dx, dy):
-    return math.exp(x)/y**2*dx
-
-# ln(xy4)
-def from_lnx4y(x, y):
-    return math.exp(x)/y**4
-def err_lnx4y(x, y, dx, dy):
-    return math.exp(x)/y**4*dx
-
Index: itools/data_generator/testdata_generator.py
===================================================================
--- guitools/data_generator/testdata_generator.py	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,97 +1,0 @@
-"""
-    Generate two correlated sets of data
-        1- A line: y = ax + b
-        2- A constant equal to a of set #1
-        
-"""
-
-def get_x(x, y=0, dx=0, dy=0):
-    return x
-
-def get_err_x(x, y=0, dx=0, dy=0):
-    return dx
-
-
-class Generator:
-    ## Parameter A
-    constant_a = 2.5
-    ## Parameter B
-    constant_b = 4.0
-    ## Randomness factor
-    randomness = 0.07
-    
-    def __init__(self):
-        pass
-    
-    def create(self, filename, xmin=0.01, xmax=10.0, npts=50, 
-               xfunc=get_x, yfunc=get_x, errfunc=get_err_x):
-        """
-            Create files with the generate data
-            The file names will be:
-                - Set #1: [filename]_line.txt
-                - Set #2: [filename]_cst.txt
-                
-            @param filename: string to prepend to the file name
-            @param xmin: minimum x-value
-            @param xmax: maximum x-value
-            @param npts: number of points to generate
-        """
-        import random, time
-        random.seed(time.time())
-        
-        # Write line data set
-        fd = open(filename, 'w')
-        print "Creating ", filename
-        fd.write("#y=A*x+B\n#A=%g\n#B=%g\n" % (self.constant_a, self.constant_b))
-        
-        for i in range(npts):
-            x = xmin+(xmax-xmin)/(npts-1)*i
-            mu = self.constant_a*x+self.constant_b
-            err = self.randomness*mu
-            y = random.gauss(mu, err)
-            fd.write("%g  %g  %g\n" % (xfunc(x, y), yfunc(y, xfunc(x, 0)), errfunc(y, xfunc(x,y), err, 0)))
-            
-        fd.close()
-        
-        
-        
-
-if __name__ == "__main__": 
-    from test_transfo import *
-    gen = Generator()
-    
-    # Linear x series
-    gen.create("linear.txt")
-    gen.create("x_y2.txt", yfunc=from_x2, errfunc=err_x2)
-    gen.create("x_inv_y.txt", yfunc=from_inv_x, errfunc=err_inv_x)
-    gen.create("x_inv_sqrty.txt", yfunc=from_inv_sqrtx, errfunc=err_inv_sqrtx)
-    gen.create("x_lny.txt", xmin=0.0001, xmax=3.0, yfunc=from_lnx, errfunc=err_lnx)
-    gen.create("x_logy.txt", xmin=0.0001, xmax=3.0, yfunc=from_log10, errfunc=err_log10)
-    gen.create("x_lnxy.txt", yfunc=from_lnxy, errfunc=err_lnxy)
-    gen.create("x_lnyx2.txt", xmin=0.0001, xmax=10.0, yfunc=from_lnx2y, errfunc=err_lnx2y)
-    gen.create("x_lnyx4.txt", xmin=0.0001, xmax=10.0, yfunc=from_lnx4y, errfunc=err_lnx4y)
-    
-    # Log10(x)
-    gen.create("logx_y.txt", xmax=3.0, xfunc=from_log10)
-    gen.create("logx_y2.txt", xmax=3.0, xfunc=from_log10, yfunc=from_x2, errfunc=err_x2)
-    gen.create("logx_inv_y.txt", xmax=3.0, xfunc=from_log10, yfunc=from_inv_x, errfunc=err_inv_x)
-    gen.create("logx_inv_sqrty.txt", xmax=3.0, xfunc=from_log10, yfunc=from_inv_sqrtx, errfunc=err_inv_sqrtx)
-    gen.create("logx_lny.txt", xfunc=from_log10, xmin=0.0001, xmax=3.0, yfunc=from_lnx, errfunc=err_lnx)
-    gen.create("logx_logy.txt", xfunc=from_log10, xmin=0.0001, xmax=3.0, yfunc=from_log10, errfunc=err_log10)
-    gen.create("logx_lnxy.txt", xfunc=from_log10, yfunc=from_lnxy, errfunc=err_lnxy)
-    gen.create("logx_lnyx2.txt", xfunc=from_log10, xmin=0.0001, xmax=10.0, yfunc=from_lnx2y, errfunc=err_lnx2y)
-    gen.create("logx_lnyx4.txt", xfunc=from_log10, xmin=0.0001, xmax=10.0, yfunc=from_lnx4y, errfunc=err_lnx4y)
-    
-    # x^2
-    gen.create("x2_y.txt", xfunc=from_x2)
-    gen.create("x2_y2.txt", xfunc=from_x2, yfunc=from_x2, errfunc=err_x2)
-    gen.create("x2_inv_y.txt", xfunc=from_x2, yfunc=from_inv_x, errfunc=err_inv_x)
-    gen.create("x2_inv_sqrty.txt", xfunc=from_x2, yfunc=from_inv_sqrtx, errfunc=err_inv_sqrtx)
-    gen.create("x2_lny.txt", xfunc=from_x2, xmin=0.0001, xmax=3.0, yfunc=from_lnx, errfunc=err_lnx)
-    gen.create("x2_logy.txt", xfunc=from_x2, xmin=0.0001, xmax=3.0, yfunc=from_log10, errfunc=err_log10)
-    gen.create("x2_lnxy.txt", xfunc=from_x2, yfunc=from_lnxy, errfunc=err_lnxy)
-    gen.create("x2_lnyx2.txt", xfunc=from_x2, xmin=0.0001, xmax=10.0, yfunc=from_lnx2y, errfunc=err_lnx2y)
-    gen.create("x2_lnyx4.txt", xfunc=from_x2, xmin=0.0001, xmax=10.0, yfunc=from_lnx4y, errfunc=err_lnx4y)
-
-            
-            
Index: itools/data_generator/x2_inv_sqrty.txt
===================================================================
--- guitools/data_generator/x2_inv_sqrty.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.1  0.0640921  0.00914324
-0.462469  0.0465568  0.00637749
-0.64634  0.0425178  0.00619146
-0.788437  0.0310669  0.00425782
-0.908576  0.0308127  0.00459161
-1.01459  0.0222981  0.00306425
-1.11052  0.0164438  0.00209103
-1.19881  0.019836  0.00296972
-1.28102  0.0169165  0.00249584
-1.35827  0.0114441  0.00147611
-1.43135  0.0138224  0.00207535
-1.50088  0.0109595  0.00154709
-1.56733  0.00817996  0.00105039
-1.63108  0.00782907  0.00103296
-1.69242  0.00830754  0.00118312
-1.75162  0.00657296  0.000870673
-1.80888  0.00653015  0.000899836
-1.86438  0.00655201  0.000942203
-1.91828  0.00563895  0.000782497
-1.9707  0.00457361  0.000593647
-2.02177  0.00497287  0.000698078
-2.07158  0.00535072  0.000807062
-2.12021  0.00415776  0.000571943
-2.16776  0.00390816  0.000538655
-2.21429  0.00394316  0.000563576
-2.25985  0.0027017  0.000329646
-2.30452  0.00290774  0.000379255
-2.34834  0.00348843  0.000513062
-2.39135  0.00279465  0.000378431
-2.43361  0.00235959  0.000301774
-2.47514  0.00307869  0.000461945
-2.51599  0.00218433  0.000283354
-2.55618  0.00212903  0.000279672
-2.59576  0.00241043  0.000345358
-2.63474  0.00194559  0.000256564
-2.67315  0.00205411  0.00028497
-2.71101  0.00201888  0.000284144
-2.74836  0.00150482  0.000187016
-2.7852  0.00173826  0.000237351
-2.82156  0.00159716  0.000213601
-2.85746  0.00175752  0.000251823
-2.89292  0.00138408  0.000179663
-2.92794  0.0016607  0.000240962
-2.96256  0.00130598  0.000171409
-2.99677  0.00134301  0.000182262
-3.03059  0.00200188  0.000338084
-3.06404  0.00108143  0.000136773
-3.09713  0.0012962  0.000182807
-3.12988  0.0013013  0.000187237
-3.16228  0.0011197  0.000152117
Index: itools/data_generator/x2_inv_y.txt
===================================================================
--- guitools/data_generator/x2_inv_y.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.1  0.257817  0.0187278
-0.462469  0.21367  0.0144922
-0.64634  0.203106  0.0145663
-0.788437  0.196412  0.0149985
-0.908576  0.157005  0.0104633
-1.01459  0.150888  0.0104762
-1.11052  0.124174  0.0076451
-1.19881  0.129771  0.00895067
-1.28102  0.127346  0.00919795
-1.35827  0.117808  0.00836683
-1.43135  0.102897  0.00676074
-1.50088  0.101456  0.00693992
-1.56733  0.0974175  0.006737
-1.63108  0.0865919  0.00559041
-1.69242  0.0995262  0.00773864
-1.75162  0.0953254  0.00742337
-1.80888  0.0856544  0.0062553
-1.86438  0.0748504  0.00497669
-1.91828  0.0699938  0.00452663
-1.9707  0.0709515  0.00483096
-2.02177  0.0641913  0.00410124
-2.07158  0.0660896  0.00450324
-2.12021  0.0721786  0.00555713
-2.16776  0.0611673  0.0041244
-2.21429  0.0647312  0.00476852
-2.25985  0.0592975  0.00412701
-2.30452  0.0566881  0.00388644
-2.34834  0.0544716  0.00369432
-2.39135  0.0551881  0.00390081
-2.43361  0.054823  0.0039566
-2.47514  0.0494633  0.00330809
-2.51599  0.0494831  0.0033981
-2.55618  0.0515244  0.00377896
-2.59576  0.0454559  0.00301494
-2.63474  0.0475547  0.00338047
-2.67315  0.0461111  0.0032542
-2.71101  0.0435341  0.00296825
-2.74836  0.0418916  0.00281111
-2.7852  0.0441715  0.00319504
-2.82156  0.0390154  0.00254697
-2.85746  0.0460639  0.00362607
-2.89292  0.0422103  0.00310833
-2.92794  0.0396383  0.00279712
-2.96256  0.0418229  0.00317635
-2.99677  0.0438449  0.00355948
-3.03059  0.0390553  0.00287871
-3.06404  0.0335367  0.00216277
-3.09713  0.0338227  0.00224064
-3.12988  0.0335821  0.00224911
-3.16228  0.0330747  0.00222069
Index: itools/data_generator/x2_lnxy.txt
===================================================================
--- guitools/data_generator/x2_lnxy.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.1  717.064  202.033
-0.462469  260.053  82.5482
-0.64634  194.278  68.601
-0.788437  255.195  99.216
-0.908576  559.1  237.318
-1.01459  632.789  291.174
-1.11052  1405.13  696.693
-1.19881  1514.26  804.831
-1.28102  2748.36  1558.81
-1.35827  1831.86  1104.35
-1.43135  8502.23  5428.98
-1.50088  8487.13  5722.14
-1.56733  13688.6  9717.45
-1.63108  17703.3  13199.1
-1.69242  65417.9  51107.7
-1.75162  129843  106072
-1.80888  45440.5  38742.9
-1.86438  63421.3  56336.2
-1.91828  171642  158591
-1.9707  806843  774281
-2.02177  414930  412989
-2.07158  243831  251390
-2.12021  367819  392344
-2.16776  5.00342e+006  5.51556e+006
-2.21429  1.91923e+006  2.18415e+006
-2.25985  1.96993e+007  2.31214e+007
-2.30452  1.06512e+007  1.28815e+007
-2.34834  7.98655e+006  9.94382e+006
-2.39135  1.55501e+008  1.99158e+008
-2.43361  6.31954e+007  8.31922e+007
-2.47514  1.54331e+008  2.08672e+008
-2.51599  2.18122e+008  3.02707e+008
-2.55618  1.24528e+008  1.77262e+008
-2.59576  2.7996e+008  4.08502e+008
-2.63474  1.42804e+010  2.13466e+010
-2.67315  2.79533e+009  4.27826e+009
-2.71101  1.70947e+009  2.67733e+009
-2.74836  7.34525e+009  1.1766e+010
-2.7852  1.87034e+009  3.06275e+009
-2.82156  1.57976e+011  2.64327e+011
-2.85746  3.59831e+011  6.14913e+011
-2.89292  5.07921e+011  8.86104e+011
-2.92794  6.0265e+010  1.07287e+011
-2.96256  3.42233e+012  6.2147e+012
-2.99677  5.04978e+010  9.35021e+010
-3.03059  4.34071e+009  8.19215e+009
-3.06404  2.22691e+011  4.28226e+011
-3.09713  2.43697e+011  4.77315e+011
-3.12988  2.08515e+011  4.15845e+011
-3.16228  1.47765e+014  2.99963e+014
Index: itools/data_generator/x2_lny.txt
===================================================================
--- guitools/data_generator/x2_lny.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  50.6895  14.1939
-0.247634  69.74  20.2756
-0.350064  62.8126  18.9346
-0.428681  95.1353  29.6974
-0.494964  76.201  24.6033
-0.553364  128.371  42.823
-0.606164  224.789  77.395
-0.654719  114.732  40.7314
-0.699914  142.272  52.0331
-0.742362  342.767  129.032
-0.782512  173.668  67.2367
-0.820699  280.62  111.651
-0.857187  580.423  237.152
-0.892184  575.896  241.472
-0.925859  419.413  180.353
-0.958351  776.141  342.066
-0.989777  700.814  316.376
-1.02024  618.671  285.921
-1.04981  911.702  431.115
-1.07858  1722.07  832.762
-1.10659  1144.12  565.535
-1.13392  809.41  408.76
-1.1606  1804.69  930.724
-1.18668  2077.74  1093.8
-1.2122  1838.22  987.405
-1.2372  7945.42  4353.03
-1.2617  5246.12  2930.38
-1.28573  2301.99  1310.51
-1.30932  5252.9  3046.72
-1.3325  10278.1  6071.51
-1.35528  3031.1  1823.01
-1.37768  12555.5  7685.85
-1.39972  13137.3  8182.73
-1.42142  6933.46  4392.88
-1.4428  17529.4  11294
-1.46386  12616.6  8263.94
-1.48462  12836.6  8545.59
-1.5051  53410.5  36128.6
-1.5253  23499.3  16147.4
-1.54524  34071.9  23777.5
-1.56493  19743  13989.4
-1.58437  65017.3  46766.2
-1.60357  23442.5  17113.1
-1.62255  79790.5  59102.1
-1.64131  64466.3  48442
-1.65985  8313.99  6336.46
-1.67819  203133  156993
-1.69634  66962.5  52470
-1.71429  62356.1  49528.6
-1.73205  140202  112862
Index: itools/data_generator/x2_lnyx2.txt
===================================================================
--- guitools/data_generator/x2_lnyx2.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  698471  195584
-0.451862  574.13  181.271
-0.638952  300.657  105.665
-0.782521  321.373  124.423
-0.903559  607.848  257.043
-1.0102  615.523  282.271
-1.10661  1245.85  615.826
-1.19526  1244.28  659.486
-1.27779  2111.78  1194.7
-1.35529  1329.98  799.908
-1.4286  5843.02  3722.92
-1.49832  5568.21  3746.69
-1.56495  8600.82  6094.41
-1.62884  10694.4  7959.79
-1.69033  38042.8  29673.8
-1.74966  72957.4  59513.3
-1.80703  24785.3  21103.2
-1.86265  33577.4  29788.4
-1.91665  88288.7  81478.8
-1.96917  403637  386920
-2.02032  202658  201502
-2.07021  116382  119874
-2.11893  171596  182874
-2.16655  2.27968e+006  2.51093e+006
-2.21314  857417  975013
-2.25878  8.61498e+006  1.01042e+007
-2.30351  4.57331e+006  5.52721e+006
-2.34739  3.36825e+006  4.19109e+006
-2.39047  6.43345e+007  8.23487e+007
-2.43278  2.57237e+007  3.38452e+007
-2.47437  6.17818e+007  8.34941e+007
-2.51527  8.59474e+007  1.19222e+008
-2.55551  4.83408e+007  6.87824e+007
-2.59514  1.07055e+008  1.56147e+008
-2.63416  5.37577e+009  8.03296e+009
-2.67262  1.03846e+009  1.58885e+009
-2.71053  6.26683e+008  9.81209e+008
-2.74792  2.65671e+009  4.25453e+009
-2.7848  6.68161e+008  1.09388e+009
-2.82121  5.56864e+010  9.31556e+010
-2.85715  1.25308e+011  2.14098e+011
-2.89264  1.74812e+011  3.04922e+011
-2.9277  2.05121e+010  3.65116e+010
-2.96235  1.15132e+012  2.09047e+012
-2.9966  1.68113e+010  3.11249e+010
-3.03046  1.42992e+009  2.69847e+009
-3.06395  7.25742e+010  1.3955e+011
-3.09707  7.86103e+010  1.53964e+011
-3.12984  6.659e+010  1.32799e+011
-3.16228  4.67274e+013  9.48566e+013
Index: itools/data_generator/x2_lnyx4.txt
===================================================================
--- guitools/data_generator/x2_lnyx4.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  4.80815e+009  1.34637e+009
-0.451862  2932.98  926.034
-0.638952  710.855  249.827
-0.782521  344.537  133.391
-0.903559  571.778  241.79
-1.0102  496.339  227.615
-1.10661  853.173  421.724
-1.19526  805.029  426.677
-1.27779  1679.02  949.872
-1.35529  1034.2  622.011
-1.4286  1088.15  693.32
-1.49832  1792.52  1206.13
-1.56495  6601.73  4677.88
-1.62884  2513.99  1871.16
-1.69033  10052.1  7840.8
-1.74966  25439.2  20751.5
-1.80703  9755.6  8306.32
-1.86265  27369.2  24280.7
-1.91665  21147.6  19516.4
-1.96917  87455.3  83833.1
-2.02032  1.10967e+006  1.10334e+006
-2.07021  471606  485759
-2.11893  64128.1  68342.9
-2.16655  261381  287895
-2.21314  148142  168460
-2.25878  233472  273831
-2.30351  572925  692425
-2.34739  366639  456206
-2.39047  5.03839e+007  6.44917e+007
-2.43278  238383  313645
-2.47437  1.28151e+007  1.73188e+007
-2.51527  6.36178e+006  8.82473e+006
-2.55551  657992  936233
-2.59514  2.38654e+007  3.48095e+007
-2.63416  9.37844e+006  1.40141e+007
-2.67262  2.25067e+007  3.44353e+007
-2.71053  3.0357e+008  4.75306e+008
-2.74792  1.62467e+008  2.60179e+008
-2.7848  5.58822e+007  9.14873e+007
-2.82121  1.9348e+009  3.23665e+009
-2.85715  3.8188e+008  6.5247e+008
-2.89264  9.84079e+008  1.71652e+009
-2.9277  1.19327e+009  2.12403e+009
-2.96235  1.26594e+011  2.29858e+011
-2.9966  1.7845e+009  3.30387e+009
-3.03046  4.79268e+009  9.04448e+009
-3.06395  9.45614e+008  1.81828e+009
-3.09707  3.83136e+010  7.504e+010
-3.12984  3.26979e+011  6.5209e+011
-3.16228  1.47833e+010  3.00102e+010
Index: itools/data_generator/x2_logy.txt
===================================================================
--- guitools/data_generator/x2_logy.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  8427.88  2359.95
-0.247634  17570.1  5108.18
-0.350064  13808.8  4162.59
-0.428681  35917  11211.8
-0.494964  21546.4  6956.75
-0.553364  71602.4  23885.6
-0.606164  260113  89557
-0.654719  55283.5  19626.5
-0.699914  90728.2  33181.9
-0.742362  687151  258673
-0.782512  143597  55594.5
-0.820699  433513  172482
-0.857187  2.31077e+006  944144
-0.892184  2.26949e+006  951592
-0.925859  1.0936e+006  470260
-0.958351  4.51164e+006  1.9884e+006
-0.989777  3.5665e+006  1.61006e+006
-1.02024  2.67654e+006  1.23697e+006
-1.04981  6.53602e+006  3.09067e+006
-1.07858  2.82672e+007  1.36695e+007
-1.10659  1.10254e+007  5.44979e+006
-1.13392  4.96942e+006  2.50961e+006
-1.1606  3.14881e+007  1.62392e+007
-1.18668  4.35549e+007  2.29289e+007
-1.2122  3.28514e+007  1.76462e+007
-1.2372  9.55766e+008  5.23631e+008
-1.2617  3.67489e+008  2.05272e+008
-1.28573  5.51479e+007  3.13953e+007
-1.30932  3.68583e+008  2.13781e+008
-1.3325  1.72891e+009  1.02131e+009
-1.35528  1.03916e+008  6.24987e+007
-1.37768  2.74104e+009  1.67792e+009
-1.39972  3.04235e+009  1.89497e+009
-1.42142  6.98416e+008  4.42501e+008
-1.4428  5.91064e+009  3.80817e+009
-1.46386  2.77184e+009  1.81557e+009
-1.48462  2.88442e+009  1.92021e+009
-1.5051  7.68711e+010  5.19982e+010
-1.5253  1.16071e+010  7.97579e+009
-1.54524  2.73042e+010  1.90545e+010
-1.56493  7.77242e+009  5.50734e+009
-1.58437  1.20895e+011  8.69584e+010
-1.60357  1.15427e+010  8.42619e+009
-1.62255  1.93713e+011  1.43487e+011
-1.64131  1.18549e+011  8.90814e+010
-1.65985  1.06095e+009  8.08596e+008
-1.67819  1.66577e+012  1.2874e+012
-1.69634  1.29386e+011  1.01384e+011
-1.71429  1.09804e+011  8.72155e+010
-1.73205  7.0931e+011  5.70995e+011
Index: itools/data_generator/x2_y.txt
===================================================================
--- guitools/data_generator/x2_y.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.1  3.87872  0.28175
-0.462469  4.68011  0.317429
-0.64634  4.92355  0.353107
-0.788437  5.09133  0.388786
-0.908576  6.36921  0.424464
-1.01459  6.62741  0.460143
-1.11052  8.05325  0.495821
-1.19881  7.70591  0.5315
-1.28102  7.85262  0.567179
-1.35827  8.48842  0.602857
-1.43135  9.71841  0.638536
-1.50088  9.85648  0.674214
-1.56733  10.2651  0.709893
-1.63108  11.5484  0.745571
-1.69242  10.0476  0.78125
-1.75162  10.4904  0.816929
-1.80888  11.6748  0.852607
-1.86438  13.36  0.888286
-1.91828  14.287  0.923964
-1.9707  14.0941  0.959643
-2.02177  15.5784  0.995321
-2.07158  15.131  1.031
-2.12021  13.8545  1.06668
-2.16776  16.3486  1.10236
-2.21429  15.4485  1.13804
-2.25985  16.8641  1.17371
-2.30452  17.6404  1.20939
-2.34834  18.3582  1.24507
-2.39135  18.1199  1.28075
-2.43361  18.2405  1.31643
-2.47514  20.217  1.35211
-2.51599  20.2089  1.38779
-2.55618  19.4083  1.42346
-2.59576  21.9993  1.45914
-2.63474  21.0284  1.49482
-2.67315  21.6868  1.5305
-2.71101  22.9705  1.56618
-2.74836  23.8711  1.60186
-2.7852  22.639  1.63754
-2.82156  25.6309  1.67321
-2.85746  21.709  1.70889
-2.89292  23.6909  1.74457
-2.92794  25.2281  1.78025
-2.96256  23.9103  1.81593
-2.99677  22.8077  1.85161
-3.03059  25.6047  1.88729
-3.06404  29.8181  1.92296
-3.09713  29.5659  1.95864
-3.12988  29.7778  1.99432
-3.16228  30.2346  2.03
Index: itools/data_generator/x2_y2.txt
===================================================================
--- guitools/data_generator/x2_y2.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.1  1.96945  0.0715302
-0.462469  2.16336  0.0733648
-0.64634  2.21891  0.0795678
-0.788437  2.2564  0.0861519
-0.908576  2.52373  0.0840946
-1.01459  2.57438  0.0893698
-1.11052  2.83782  0.0873594
-1.19881  2.77595  0.0957329
-1.28102  2.80225  0.1012
-1.35827  2.91349  0.10346
-1.43135  3.11744  0.102414
-1.50088  3.1395  0.107376
-1.56733  3.20392  0.110785
-1.63108  3.3983  0.109698
-1.69242  3.1698  0.123233
-1.75162  3.23889  0.126113
-1.80888  3.41684  0.124765
-1.86438  3.65513  0.121512
-1.91828  3.77981  0.122224
-1.9707  3.75422  0.127809
-2.02177  3.94695  0.126087
-2.07158  3.88985  0.132524
-2.12021  3.72217  0.143287
-2.16776  4.04334  0.136318
-2.21429  3.93046  0.144771
-2.25985  4.10659  0.142906
-2.30452  4.20004  0.143974
-2.34834  4.28465  0.145295
-2.39135  4.25674  0.150438
-2.43361  4.27089  0.154116
-2.47514  4.49633  0.150357
-2.51599  4.49543  0.154355
-2.55618  4.40548  0.161556
-2.59576  4.69034  0.155548
-2.63474  4.58567  0.162988
-2.67315  4.6569  0.164326
-2.71101  4.79276  0.16339
-2.74836  4.88581  0.16393
-2.7852  4.75805  0.172081
-2.82156  5.0627  0.165249
-2.85746  4.65929  0.183386
-2.89292  4.86733  0.179212
-2.92794  5.02276  0.177218
-2.96256  4.88982  0.185685
-2.99677  4.77574  0.193856
-3.03059  5.06011  0.186487
-3.06404  5.4606  0.176076
-3.09713  5.43745  0.180107
-3.12988  5.4569  0.182734
-3.16228  5.4986  0.184592
Index: itools/data_generator/x_inv_sqrty.txt
===================================================================
--- guitools/data_generator/x_inv_sqrty.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  0.056516  0.00757096
-0.213878  0.0539565  0.00795686
-0.417755  0.0364092  0.0049063
-0.621633  0.0302784  0.00409674
-0.82551  0.0228817  0.00293834
-1.02939  0.0356705  0.00619992
-1.23327  0.0223705  0.00331795
-1.43714  0.0185942  0.00269526
-1.64102  0.0151925  0.0021242
-1.8449  0.0108431  0.00136137
-2.04878  0.0116484  0.00160552
-2.25265  0.00967345  0.00128292
-2.45653  0.00857064  0.00112653
-2.66041  0.00746449  0.000961654
-2.86429  0.00761302  0.0010379
-3.06816  0.00722421  0.00100323
-3.27204  0.00666177  0.000927178
-3.47592  0.00706423  0.00105482
-3.6798  0.00558893  0.000772109
-3.88367  0.00597068  0.000885473
-4.08755  0.00529125  0.00076618
-4.29143  0.00573769  0.000896177
-4.49531  0.00406424  0.000552754
-4.69918  0.00335899  0.000429205
-4.90306  0.00347651  0.000466554
-5.10694  0.00371547  0.000531635
-5.31082  0.00322108  0.000442181
-5.51469  0.00345872  0.00050652
-5.71857  0.00221072  0.000266252
-5.92245  0.00359538  0.000567602
-6.12633  0.00306369  0.000458573
-6.3302  0.00288888  0.00043097
-6.53408  0.00207936  0.000269942
-6.73796  0.00261399  0.000390017
-6.94184  0.00197271  0.000261947
-7.14571  0.00201477  0.000276823
-7.34959  0.00218923  0.000320855
-7.55347  0.00209852  0.000307981
-7.75735  0.00143787  0.000178566
-7.96122  0.00164422  0.000223112
-8.1651  0.00188802  0.000280386
-8.36898  0.00222925  0.000367246
-8.57286  0.00142943  0.000192423
-8.77673  0.00162061  0.000236945
-8.98061  0.00129156  0.000171889
-9.18449  0.00153314  0.00022659
-9.38837  0.00114931  0.00014985
-9.59224  0.0014855  0.000224282
-9.79612  0.00127084  0.000180702
-10  0.00108634  0.00014537
Index: itools/data_generator/x_inv_y.txt
===================================================================
--- guitools/data_generator/x_inv_y.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  0.237468  0.0158882
-0.213878  0.227331  0.0164045
-0.417755  0.184651  0.0120395
-0.621633  0.173743  0.0117361
-0.82551  0.187287  0.0148887
-1.02939  0.154876  0.0110372
-1.23327  0.147231  0.0107479
-1.43714  0.125966  0.00843351
-1.64102  0.129006  0.00943923
-1.8449  0.125714  0.00952755
-2.04878  0.122345  0.00955778
-2.25265  0.107539  0.00779708
-2.45653  0.104792  0.0077956
-2.66041  0.0906443  0.00612591
-2.86429  0.0839357  0.00550406
-3.06816  0.0847036  0.00586122
-3.27204  0.0751184  0.00481107
-3.47592  0.0885813  0.00697006
-3.6798  0.0749761  0.00519398
-3.88367  0.0826283  0.0065519
-4.08755  0.0698672  0.00485858
-4.29143  0.0717424  0.00530653
-4.49531  0.0621046  0.00411416
-4.69918  0.0591785  0.00386056
-4.90306  0.0652991  0.00485256
-5.10694  0.0633837  0.0047154
-5.31082  0.0527955  0.00337102
-5.51469  0.0549044  0.00375325
-5.71857  0.0515332  0.00340125
-5.92245  0.0591914  0.00461226
-6.12633  0.0538414  0.00391962
-6.3302  0.046168  0.00295805
-6.53408  0.0455558  0.00295416
-6.73796  0.0484254  0.00342171
-6.94184  0.0453207  0.00307031
-7.14571  0.0471671  0.00340496
-7.34959  0.0435993  0.00297714
-7.55347  0.0501559  0.00402965
-7.75735  0.0456078  0.00340619
-7.96122  0.0457602  0.0035037
-8.1651  0.0413145  0.00291689
-8.36898  0.0419763  0.00307396
-8.57286  0.0404311  0.00291013
-8.77673  0.0413316  0.00310215
-8.98061  0.0364028  0.00245368
-9.18449  0.0367777  0.00255275
-9.38837  0.038456  0.00284381
-9.59224  0.0360665  0.00254779
-9.79612  0.0370729  0.00274099
-10  0.0325213  0.002147
Index: itools/data_generator/x_lnxy.txt
===================================================================
--- guitools/data_generator/x_lnxy.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  7544.69  2125.72
-0.213878  413.804  131.353
-0.417755  516.16  182.26
-0.621633  718.01  279.152
-0.82551  389.52  165.337
-1.02939  506.865  233.23
-1.23327  1224.19  606.978
-1.43714  2217.82  1178.77
-1.64102  2748.58  1558.94
-1.8449  5291.35  3189.93
-2.04878  1955.92  1248.92
-2.25265  12513.5  8436.79
-2.45653  10221.9  7256.46
-2.66041  22749.1  16961.1
-2.86429  16810.3  13133
-3.06816  175570  143428
-3.27204  40486.7  34519.2
-3.47592  75594.2  67149.2
-3.6798  101856  94111.8
-3.88367  1.09072e+006  1.0467e+006
-4.08755  465882  463702
-4.29143  384269  396182
-4.49531  4.38565e+006  4.67808e+006
-4.69918  411662  453798
-4.90306  5.44567e+006  6.19737e+006
-5.10694  999800  1.17348e+006
-5.31082  1.33401e+007  1.61335e+007
-5.51469  1.34236e+007  1.67133e+007
-5.71857  5.05057e+006  6.46852e+006
-5.92245  5.59449e+006  7.36474e+006
-6.12633  5.00883e+007  6.77248e+007
-6.3302  9.1298e+007  1.26702e+008
-6.53408  3.0613e+009  4.35765e+009
-6.73796  1.42392e+008  2.0777e+008
-6.94184  8.56623e+008  1.2805e+009
-7.14571  3.98011e+008  6.09156e+008
-7.34959  2.12457e+009  3.32746e+009
-7.55347  6.18086e+008  9.90086e+008
-7.75735  5.81863e+008  9.52822e+008
-7.96122  6.74359e+008  1.12835e+009
-8.1651  4.57064e+009  7.81073e+009
-8.36898  4.84184e+009  8.44693e+009
-8.57286  2.44299e+011  4.34914e+011
-8.77673  9.12161e+010  1.65642e+011
-8.98061  1.75826e+011  3.25561e+011
-9.18449  6.82569e+009  1.2882e+010
-9.38837  3.42819e+011  6.5923e+011
-9.59224  2.63279e+011  5.15669e+011
-9.79612  7.16351e+010  1.42863e+011
-10  2.28151e+013  4.63146e+013
Index: itools/data_generator/x_lny.txt
===================================================================
--- guitools/data_generator/x_lny.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.0001  65.4032  18.314
-0.0613224  51.5718  14.9935
-0.122545  87.7071  26.4389
-0.183767  100.911  31.5002
-0.24499  152.719  49.3088
-0.306212  46.456  15.4971
-0.367435  103.829  35.7485
-0.428657  134.075  47.5987
-0.48988  187.069  68.4165
-0.551102  402.071  151.357
-0.612324  275.289  106.58
-0.673547  403.44  160.517
-0.734769  501.209  204.786
-0.795992  671.355  281.498
-0.857214  549.111  236.125
-0.918437  570.955  251.635
-0.979659  656.677  296.45
-1.04088  487.924  225.496
-1.1021  939.87  444.435
-1.16333  679.609  328.647
-1.22455  922.634  456.054
-1.28577  643.263  324.854
-1.34699  1966.34  1014.09
-1.40822  3789.07  1994.71
-1.46944  2996.33  1609.49
-1.53066  2117.11  1159.89
-1.59188  3422.01  1911.46
-1.65311  2379.66  1354.73
-1.71433  15240.3  8839.48
-1.77555  1778.72  1050.73
-1.83677  3091.12  1859.11
-1.898  3665.52  2243.85
-1.95922  14703.1  9157.99
-2.02044  4879.41  3091.48
-2.08166  16386.8  10557.9
-2.14289  13828.8  9057.94
-2.20411  8818.07  5870.36
-2.26533  10078.5  6817.44
-2.32655  63973  43958.9
-2.38778  29312.4  20456
-2.449  13941.3  9878.43
-2.51022  6200.78  4460.15
-2.57144  51318.2  37462.4
-2.63267  25145.5  18625.7
-2.69389  80203.8  60267.5
-2.75511  30138.4  22969.8
-2.81633  140820  108834
-2.87756  32201.1  25231.9
-2.93878  71120.8  56490.2
-3  167950  135200
Index: itools/data_generator/x_lnyx2.txt
===================================================================
--- guitools/data_generator/x_lnyx2.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.0001  7.34676e+009  2.05722e+009
-0.20418  2072.65  654.401
-0.408259  1261.4  443.312
-0.612339  1160.37  449.248
-0.816418  472.094  199.636
-1.0205  490.523  224.947
-1.22458  984.427  486.603
-1.42866  1526.8  809.226
-1.63274  1655.96  936.827
-1.83682  2831.7  1703.11
-2.0409  944.98  602.101
-2.24498  5480.02  3687.35
-2.44906  4109.12  2911.66
-2.65313  8437.81  6280.25
-2.85721  5798.14  4522.63
-3.06129  56374.8  45986.4
-3.26537  12225.2  10409
-3.46945  21484.9  19060.4
-3.67353  27354.7  25244.8
-3.87761  277015  265542
-4.08169  112613  111971
-4.28577  88554.3  91211.8
-4.48985  963388  1.02671e+006
-4.69393  86745.5  95544.8
-4.89801  1.09828e+006  1.24891e+006
-5.10209  193967  227497
-5.30617  2.48588e+006  3.00439e+006
-5.51025  2.41063e+006  2.99953e+006
-5.71433  875734  1.12095e+006
-5.91841  937156  1.23304e+006
-6.12249  8.10707e+006  1.09562e+007
-6.32657  1.43062e+007  1.98448e+007
-6.53065  4.64332e+008  6.60681e+008
-6.73473  2.09842e+007  3.0607e+007
-6.93881  1.22526e+008  1.83089e+008
-7.14289  5.53523e+007  8.46893e+007
-7.34697  2.87294e+008  4.49822e+008
-7.55104  8.13993e+007  1.30355e+008
-7.75512  7.46558e+007  1.22223e+008
-7.9592  8.43482e+007  1.41103e+008
-8.16328  5.57494e+008  9.5252e+008
-8.36736  5.76482e+008  1.00555e+009
-8.57144  2.8394e+010  5.05415e+010
-8.77552  1.03626e+010  1.88155e+010
-8.9796  1.95304e+010  3.61591e+010
-9.18368  7.41923e+008  1.40012e+009
-9.38776  3.64621e+010  7.01114e+010
-9.59184  2.74211e+010  5.37062e+010
-9.79592  7.30937e+009  1.4577e+010
-10  2.28151e+012  4.63146e+012
Index: itools/data_generator/x_lnyx4.txt
===================================================================
--- guitools/data_generator/x_lnyx4.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.0001  7.34676e+017  2.05722e+017
-0.20418  49716.6  15697.1
-0.408259  7567.97  2659.73
-0.612339  3094.66  1198.13
-0.816418  708.277  299.511
-1.0205  471.015  216.001
-1.22458  656.464  324.491
-1.42866  748.041  396.473
-1.63274  621.182  351.42
-1.83682  839.298  504.79
-2.0409  226.872  144.553
-2.24498  1087.32  731.629
-2.44906  685.096  485.449
-2.65313  1198.7  892.192
-2.85721  710.237  553.994
-3.06129  6015.54  4907.04
-3.26537  1146.54  976.212
-3.46945  1784.89  1583.47
-3.67353  2027.05  1870.7
-3.87761  18423.6  17660.5
-4.08169  6759.41  6720.86
-4.28577  4821.16  4965.85
-4.48985  47790  50931
-4.69393  3937.08  4336.45
-4.89801  45779.6  52058.3
-5.10209  7451.29  8739.36
-5.30617  88291.5  106707
-5.51025  79394  98789.4
-5.71433  26818.9  34328.5
-5.91841  26754.8  35201.9
-6.12249  216276  292283
-6.32657  357428  495806
-6.53065  1.08872e+007  1.5491e+007
-6.73473  462649  674810
-6.93881  2.54482e+006  3.8027e+006
-7.14289  1.0849e+006  1.6599e+006
-7.34697  5.32244e+006  8.33345e+006
-7.55104  1.4276e+006  2.2862e+006
-7.75512  1.24133e+006  2.03223e+006
-7.9592  1.33149e+006  2.22739e+006
-8.16328  8.36585e+006  1.42937e+007
-8.36736  8.23395e+006  1.43624e+007
-8.57144  3.86473e+008  6.87923e+008
-8.77552  1.34562e+008  2.44326e+008
-8.9796  2.42212e+008  4.48439e+008
-9.18368  8.79681e+006  1.66008e+007
-9.38776  4.1373e+008  7.95545e+008
-9.59184  2.98044e+008  5.83741e+008
-9.79592  7.61709e+007  1.51907e+008
-10  2.28151e+010  4.63146e+010
Index: itools/data_generator/x_logy.txt
===================================================================
--- guitools/data_generator/x_logy.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.0001  15155.5  4243.81
-0.0613224  8769.5  2549.57
-0.122545  29785.4  8978.66
-0.183767  41137.3  12841.4
-0.24499  106807  34485.1
-0.306212  6894.54  2299.93
-0.367435  43928.6  15124.7
-0.428657  79140.9  28096.2
-0.48988  170403  62321.2
-0.551102  992269  373532
-0.612324  414783  160586
-0.673547  1.00007e+006  397897
-0.734769  1.64825e+006  673450
-0.795992  3.23072e+006  1.35463e+006
-0.857214  2.03377e+006  874545
-0.918437  2.2249e+006  980571
-0.979659  3.07038e+006  1.38609e+006
-1.04088  1.54938e+006  716054
-1.1021  7.01038e+006  3.31499e+006
-1.16333  3.32291e+006  1.6069e+006
-1.22455  6.71788e+006  3.32062e+006
-1.28577  2.92788e+006  1.47861e+006
-1.34699  3.83643e+007  1.97854e+007
-1.40822  1.7373e+008  9.1458e+007
-1.46944  1.01192e+008  5.43553e+007
-1.53066  4.54789e+007  2.49163e+007
-1.59188  1.37399e+008  7.67481e+007
-1.65311  5.95271e+007  3.38884e+007
-1.71433  4.2825e+009  2.48388e+009
-1.77555  3.04542e+007  1.799e+007
-1.83677  1.08715e+008  6.53848e+007
-1.898  1.60963e+008  9.85335e+007
-1.95922  3.94285e+009  2.45586e+009
-2.02044  3.11014e+008  1.97051e+008
-2.08166  5.06097e+009  3.26074e+009
-2.14289  3.4238e+009  2.24261e+009
-2.20411  1.21495e+009  8.08815e+008
-2.26533  1.65257e+009  1.11786e+009
-2.32655  1.16471e+011  8.00325e+010
-2.38778  1.93093e+010  1.34752e+010
-2.449  3.48826e+009  2.47169e+009
-2.51022  5.40046e+008  3.88449e+008
-2.57144  7.01133e+010  5.11829e+010
-2.63267  1.35654e+010  1.00481e+010
-2.69389  1.96031e+011  1.47304e+011
-2.75511  2.05852e+010  1.56889e+010
-2.81633  7.16535e+011  5.5378e+011
-2.87756  2.39749e+010  1.87861e+010
-2.93878  1.4864e+011  1.18062e+011
-3  1.07504e+012  8.65404e+011
Index: itools/data_generator/x_y2.txt
===================================================================
--- guitools/data_generator/x_y2.txt	(revision be0ea2a46069827593004887d62c623613118ad8)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0.01  2.05209  0.0686494
-0.213878  2.09735  0.0756738
-0.417755  2.32715  0.0758669
-0.621633  2.39909  0.0810278
-0.82551  2.31071  0.091847
-1.02939  2.54102  0.090543
-1.23327  2.60616  0.095125
-1.43714  2.81756  0.0943191
-1.64102  2.78417  0.101858
-1.8449  2.82038  0.106875
-2.04878  2.85895  0.111673
-2.25265  3.04941  0.110548
-2.45653  3.08913  0.114902
-2.66041  3.32147  0.112235
-2.86429  3.45165  0.113171
-3.06816  3.43597  0.118879
-3.27204  3.6486  0.11684
-3.47592  3.35992  0.132189
-3.6798  3.65207  0.126499
-3.88367  3.47885  0.137925
-4.08755  3.78324  0.131544
-4.29143  3.73346  0.138076
-4.49531  4.01271  0.132912
-4.69918  4.11072  0.134083
-4.90306  3.91333  0.145405
-5.10694  3.97202  0.147748
-5.31082  4.35213  0.138943
-5.51469  4.26773  0.145871
-5.71857  4.40511  0.145371
-5.92245  4.11027  0.160139
-6.12633  4.30965  0.15687
-6.3302  4.65403  0.149095
-6.53408  4.6852  0.151911
-6.73796  4.54426  0.160548
-6.94184  4.69734  0.159114
-7.14571  4.60448  0.166197
-7.34959  4.78917  0.163512
-7.55347  4.46518  0.179372
-7.75735  4.68253  0.174856
-7.96122  4.67472  0.178964
-8.1651  4.91982  0.173674
-8.36898  4.88088  0.178715
-8.57286  4.97327  0.178982
-8.77673  4.9188  0.184591
-8.98061  5.24122  0.176639
-9.18449  5.21444  0.180967
-9.38837  5.09938  0.188549
-9.59224  5.2656  0.185985
-9.79612  5.19364  0.191997
-10  5.54518  0.183042
Index: itools/fitDialog.py
===================================================================
--- guitools/fitDialog.py	(revision 3755d77dd1f4e2ab6dee7b2d899e977bc89c828b)
+++ 	(revision )
@@ -1,519 +1,0 @@
-#!/usr/bin/python
-
-# fitDialog.py
-
-import wx
-from PlotPanel import PlotPanel
-from plottables import Theory1D
-import math,pylab,fittings
-import transform
-
-def format_number(value, high=False):
-    """
-        Return a float in a standardized, human-readable formatted string 
-    """
-    try: 
-        value = float(value)
-    except:
-        print "returning 0"
-        return "0"
-    
-    if high:
-        return "%-6.4g" % value
-    else:
-        return "%-5.3g" % value
-
-
-class LinearFit(wx.Dialog):
-    def __init__(self, parent, plottable, push_data,transform, id, title):
-        wx.Dialog.__init__(self, parent, id, title, size=(400, 350))
-
-        """
-            Dialog window pops- up when select Linear fit on Context menu
-            Displays fitting parameters
-        """
-        self.parent = parent
-        self.transform = transform
-        
-        # Registered owner for close event
-        self._registered_close = None
-        
-        #dialog panel self call function to plot the fitting function
-        self.push_data = push_data
-        #dialog self plottable
-        self.plottable = plottable
-        
-        # Receive transformations of x and y
-        self.xLabel,self.yLabel,self.Avalue,self.Bvalue,\
-        self.ErrAvalue,self.ErrBvalue,self.Chivalue= self.transform()
-        
-        #Dialog interface
-        vbox  = wx.BoxSizer(wx.VERTICAL)
-        sizer = wx.GridBagSizer(5,5)
-       
-        _BOX_WIDTH = 100
- 
-        self.tcA      = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
-        self.tcA.SetToolTipString("Fit value for the slope parameter.")
-        self.tcErrA   = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
-        self.tcErrA.SetToolTipString("Error on the slope parameter.")
-        self.tcB      = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
-        self.tcA.SetToolTipString("Fit value for the constant parameter.")
-        self.tcErrB   = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
-        self.tcErrB.SetToolTipString("Error on the constant parameter.")
-        self.tcChi    = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
-        self.tcChi.SetToolTipString("Chi^2 over degrees of freedom.")
-        self.xminFit  = wx.TextCtrl(self,-1,size=(_BOX_WIDTH,20))
-        self.xminFit.SetToolTipString("Enter the minimum value on the x-axis to be included in the fit.")
-        self.xmaxFit  = wx.TextCtrl(self,-1,size=(_BOX_WIDTH,20))
-        self.xmaxFit.SetToolTipString("Enter the maximum value on the x-axis to be included in the fit.")
-        self.initXmin = wx.TextCtrl(self,-1,size=(_BOX_WIDTH,20))
-        self.initXmin.SetToolTipString("Minimum value on the x-axis for the plotted data.")
-        self.initXmax = wx.TextCtrl(self,-1,size=(_BOX_WIDTH,20))
-        self.initXmax.SetToolTipString("Maximum value on the x-axis for the plotted data.")
-
-        # Make the info box not editable
-        #_BACKGROUND_COLOR = '#ffdf85'
-        _BACKGROUND_COLOR = self.GetBackgroundColour()
-        self.initXmin.SetEditable(False)
-        self.initXmin.SetBackgroundColour(_BACKGROUND_COLOR)
-        self.initXmax.SetEditable(False)
-        self.initXmax.SetBackgroundColour(_BACKGROUND_COLOR)
-        
-        
-        # Buttons on the bottom
-        self.static_line_1 = wx.StaticLine(self, -1)
-        self.btFit =wx.Button(self,-1,'Fit')
-        self.btFit.Bind(wx.EVT_BUTTON, self._onFit)
-        self.btFit.SetToolTipString("Perform fit.")
-        self.btClose =wx.Button(self, wx.ID_CANCEL,'Close')
-        self.btClose.Bind(wx.EVT_BUTTON, self._on_close)
-        
-        # Intro
-        explanation  = "Perform fit for y(x) = Ax + B"
-        
-        vbox.Add(sizer)
-        
-        ix = 0
-        iy = 1
-        sizer.Add(wx.StaticText(self, -1, explanation),(iy, ix),\
-                 (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        iy += 2
-        sizer.Add(wx.StaticText(self, -1, 'Parameter A'),(iy, ix),\
-                 (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        ix += 1
-        sizer.Add(self.tcA,(iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 1
-        sizer.Add(wx.StaticText(self, -1, '+/-'),(iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 1
-        sizer.Add(self.tcErrA, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        ix = 0
-        sizer.Add(wx.StaticText(self, -1, 'Parameter B'),(iy, ix),(1,1),\
-                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        ix += 1
-        sizer.Add(self.tcB, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 1
-        sizer.Add(wx.StaticText(self, -1, '+/-'),(iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 1
-        sizer.Add(self.tcErrB, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        ix = 0
-        sizer.Add(wx.StaticText(self, -1, 'Chi2/dof'),(iy, ix),(1,1),\
-                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        ix += 1
-        sizer.Add(self.tcChi, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 2
-        ix = 1
-        sizer.Add(wx.StaticText(self, -1, 'Min'),(iy, ix),(1,1),\
-                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 2
-        sizer.Add(wx.StaticText(self, -1, 'Max'),(iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        ix = 0
-        sizer.Add(wx.StaticText(self, -1, 'Maximum range (linear scale)'),(iy, ix),(1,1),\
-                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        ix +=1
-        sizer.Add(self.initXmin, (iy, ix),(1,1),\
-                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 2
-        sizer.Add(self.initXmax, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-       
-        iy += 1
-        ix = 0
-        sizer.Add(wx.StaticText(self, -1, 'Fit range of '+self.xLabel),(iy, ix),(1,1),\
-                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        ix += 1
-        sizer.Add(self.xminFit, (iy, ix),(1,1),\
-                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix += 2
-        sizer.Add(self.xmaxFit, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy += 1
-        ix = 1
-        
-        vbox.Add(self.static_line_1, 0, wx.EXPAND, 0)
-        
-        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_button.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        sizer_button.Add(self.btFit, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)
-        sizer_button.Add(self.btClose, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)        
-        vbox.Add(sizer_button, 0, wx.EXPAND|wx.BOTTOM|wx.TOP, 10)
-        
-        
-        
-        sizer.Add(self.btFit, (iy, ix),(1,1), wx.LEFT|wx.ADJUST_MINSIZE, 0)
-        
-        
-        #panel.SetSizer(sizer)
-        self.SetSizer(vbox)
-        self.Centre()
-        
-        # Receives the type of model for the fitting
-        from LineModel import LineModel
-        self.model  = LineModel()
-          
-        #Display the fittings values
-        self.default_A = self.model.getParam('A') 
-        self.default_B = self.model.getParam('B') 
-        self.cstA = fittings.Parameter(self.model, 'A', self.default_A)
-        self.cstB  = fittings.Parameter(self.model, 'B', self.default_B)
-        
-        # Set default value of parameter in fit dialog
-        
-        if self.Avalue==None:
-            self.tcA.SetLabel(format_number(self.default_A))
-        else :
-            self.tcA.SetLabel(format_number(self.Avalue))
-        if self.Bvalue==None:
-            self.tcB.SetLabel(format_number(self.default_B))
-        else:
-            self.tcB.SetLabel(format_number(self.Bvalue))
-        if self.ErrAvalue==None:
-            self.tcErrA.SetLabel(format_number(0.0))
-        else:
-            self.tcErrA.SetLabel(format_number(self.ErrAvalue))
-        if self.ErrBvalue==None:
-            self.tcErrB.SetLabel(format_number(0.0))
-        else:
-            self.tcErrB.SetLabel(format_number(self.ErrBvalue))
-        if self.Chivalue==None:
-            self.tcChi.SetLabel(format_number(0.0))
-        else:
-            self.tcChi.SetLabel(format_number(self.Chivalue))
-        if self.plottable.x !=[]:
-            #store the values of View in self.x,self.y,self.dx,self.dy
-            self.x,self.y,self.dx,self.dy= self.plottable.returnValuesOfView()
-            
-            #self.mini =min(self.x)
-            #self.maxi =max(self.x)
-            
-            try:
-                self.mini = self.floatForwardTransform(min(self.x))
-            except:
-                self.mini = "Invalid"
-            try:
-                self.maxi = self.floatForwardTransform(max(self.x))
-            except:
-                self.maxi = "Invalid"
-            
-            self.initXmin.SetValue(format_number(min(self.plottable.x)))
-            self.initXmax.SetValue(format_number(max(self.plottable.x)))
-            
-            self.xminFit.SetLabel(format_number(self.mini))
-            self.xmaxFit.SetLabel(format_number(self.maxi))
-        
-      
-    def register_close(self, owner):
-        """
-            Method to register the close event to a parent
-            window that needs notification when the dialog
-            is closed
-            @param owner: parent window
-        """
-        self._registered_close = owner
-        
-    def _on_close(self, event):
-        """
-            Close event. 
-            Notify registered owner if available.
-        """
-        event.Skip()
-        if self._registered_close is not None:
-            self._registered_close()
-        
-    def _onFit(self ,event):
-        """
-            Performs the fit. Receive an event when clicking on the button Fit.Computes chisqr ,
-            A and B parameters of the best linear fit y=Ax +B
-            Push a plottable to 
-        """
-        tempx=[]
-        tempy=[]
-        tempdy = []
-       
-       
-        
-        
-        # Check if View contains a x array .we online fit when x exits
-        # makes transformation for y as a line to fit
-        if self.x != []: 
-            
-                
-            if(self.checkFitValues(self.xminFit) == True):
-                #Check if the field of Fit Dialog contain values and use the x max and min of the user
-                xminView,xmaxView = self._checkVal(self.xminFit.GetValue(),self.xmaxFit.GetValue())
-                xmin = self.floatInvTransform(xminView)
-                xmax = self.floatInvTransform(xmaxView)
-                
-                
-                # Store the transformed values of view x, y,dy in variables  before the fit
-                if  self.yLabel.lower() == "log10(y)":
-                    if (self.xLabel.lower() == "log10(x)"):
-                        for i in range(len(self.x)):
-                            if self.x[i]>= math.log10(xmin):
-                                tempy.append(math.log10(self.y[i])) 
-                                tempdy.append(transform.errToLogX(self.y[i],0,self.dy[i],0))
-                    else:
-                        for i in range(len(self.y)):
-                            tempy.append(math.log10(self.y[i])) 
-                            tempdy.append(transform.errToLogX(self.y[i],0,self.dy[i],0))
-                else:
-                    tempy = self.y
-                    tempdy = self.dy
-               
-                if (self.xLabel.lower() == "log10(x)"):
-                    for x_i in self.x:
-                        if x_i >= math.log10(xmin):
-                            tempx.append(math.log10(x_i)) 
-                else:
-                    tempx = self.x
-              
-                #Find the fitting parameters
-                # Always use the same defaults, so that fit history doesn't play a role! 
-                self.cstA = fittings.Parameter(self.model, 'A', self.default_A)
-                self.cstB  = fittings.Parameter(self.model, 'B', self.default_B)
-                
-                if (self.xLabel.lower() == "log10(x)"):
-                    chisqr, out, cov = fittings.sansfit(self.model, [self.cstA, self.cstB],
-                    tempx, tempy,tempdy,math.log10(xmin),math.log10(xmax))
-                else:
-                    chisqr, out, cov = fittings.sansfit(self.model, 
-                                [self.cstA, self.cstB],tempx, tempy,tempdy,xminView,xmaxView)
-                
-                # Use chi2/dof
-                if len(tempx)>0:
-                    chisqr = chisqr/len(tempx)
-                
-                #Check that cov and out are iterable before displaying them
-                if cov ==None:
-                    errA =0.0
-                    errB =0.0
-                else:
-                    errA= math.sqrt(cov[0][0])
-                    errB= math.sqrt(cov[1][1])
-                if out==None:
-                    cstA=0.0
-                    cstB=0.0
-                else:
-                    cstA=out[0]
-                    cstB=out[1]
-                # Reset model with the right values of A and B 
-                self.model.setParam('A', float(cstA))
-                self.model.setParam('B', float(cstB))
-                
-                tempx = []
-                tempy = []
-                y_model = 0.0
-                # load tempy with the minimum transformation
-               
-                if self.xLabel == "log10(x)":
-                    y_model = self.model.run(math.log10(xmin))
-                    tempx.append(xmin)
-                else:
-                    y_model = self.model.run(xminView)
-                    tempx.append(xminView)
-                    
-                if self.yLabel == "log10(y)":
-                    tempy.append(math.pow(10,y_model))
-                    print "tempy",tempy
-                else:
-                    tempy.append(y_model)
-                    
-                # load tempy with the maximum transformation
-                if self.xLabel == "log10(x)":
-                    y_model = self.model.run(math.log10(xmax))
-                    tempx.append(xmax)
-                else:
-                    y_model = self.model.run(xmaxView)
-                    tempx.append(xmaxView)
-                    
-                if self.yLabel == "log10(y)":
-                    tempy.append(math.pow(10,y_model))
-                else: 
-                    tempy.append(y_model)
-                #Set the fit parameter display when  FitDialog is opened again
-                self.Avalue=cstB
-                self.Bvalue=cstA
-                self.ErrAvalue=errA
-                self.ErrBvalue=errB
-                self.Chivalue=chisqr
-                self.push_data(tempx,tempy,xminView,xmaxView,xmin,xmax,self._ongetValues())
-                
-                # Display the fitting value on the Fit Dialog
-                self._onsetValues(cstB, cstA, errA,errB,chisqr)
-               
-               
-            
-    def _onsetValues(self,cstA,cstB,errA,errB,Chi):
-         """
-              Display  the value on fit Dialog 
-         """
-         self.tcA.SetValue(format_number(cstA))
-         self.tcB.SetValue(format_number(cstB))
-         self.tcErrA.SetValue(format_number(errA))
-         self.tcErrB.SetValue(format_number(errB))
-         self.tcChi.SetValue(format_number(Chi))
-        
-    def _ongetValues(self):
-         """
-              Display  the value on fit Dialog 
-         """
-         return self.Avalue, self.Bvalue,self.ErrAvalue,self.ErrBvalue,self.Chivalue
-         
-    
-    def _checkVal(self,usermin, usermax):
-        """
-                Ensure that fields parameter contains a min and a max value 
-                within x min and x max range
-        """
-        if float(usermin) < float(usermax):
-            if float(usermin) >= float(self.mini) and float(usermin) < float(self.maxi):
-                self.xminFit.SetValue(format_number(float(usermin)))
-            else:
-                self.xminFit.SetValue(format_number(float(self.mini)))
-                
-            if float(usermax) > float(self.mini) and float(usermax) <= float(self.maxi):
-                self.xmaxFit.SetLabel(format_number(float(usermax)))
-            else:
-                self.xmaxFit.SetLabel(format_number(float(self.maxi)))
-                
-            mini =float(self.xminFit.GetValue())
-            maxi =float(self.xmaxFit.GetValue())
-            
-            return mini, maxi
-        
-    def floatForwardTransform(self,x):
-        """
-             transform a float.
-        """
-        #TODO: refactor this with proper object-oriented design
-        # This code stinks.
-        
-        if ( self.xLabel=="x" ):
-            return transform.toX(x)
-        
-        if ( self.xLabel=="x^(2)" ): 
-            return transform.toX2(x)
-        
-        if (self.xLabel=="log10(x)" ):
-            return math.log10(x)
-            
-    def floatTransform(self,x):
-        """
-             transform a float.It is use to determine the x.View min and x.View max for values
-             not in x
-        """
-        #TODO: refactor this with proper object-oriented design
-        # This code stinks.
-        
-        if ( self.xLabel=="x" ):
-            return transform.toX(x)
-        
-        if ( self.xLabel=="x^(2)" ): 
-            return transform.toX2(x)
-        
-        if (self.xLabel=="log10(x)" ):
-            if x >0:
-                return x
-            else:
-                raise ValueError,"cannot compute log of a negative number"
-            
-    def floatInvTransform(self,x):
-        """
-             transform a float.It is use to determine the x.View min and x.View max for values
-             not in x
-        """
-        #TODO: refactor this. This is just a hack to make the
-        # functionality work without rewritting the whole code
-        # with good design (which really should be done...).
-        
-        if ( self.xLabel=="x^(2)" ): 
-            return math.sqrt(x)
-        
-        elif (self.xLabel=="log10(x)" ):
-            return math.pow(10, x)
-        
-        return x
-            
-    def checkFitValues(self,item):
-        """
-            Check the validity of input values
-        """
-        flag = True
-        value = item.GetValue()
-        # Check for possible values entered
-        if (self.xLabel=="log10(x)"):
-            if (float(value) > 0):
-                item.SetBackgroundColour(wx.WHITE)
-                item.Refresh()
-            else:
-                flag = False
-                item.SetBackgroundColour("pink")
-                item.Refresh()
-      
-        return flag
-       
-    def setFitRange(self,xmin,xmax,xminTrans,xmaxTrans):
-        """
-            Set fit parameters
-        """
-        self.xminFit.SetValue(format_number(xmin))
-        self.xmaxFit.SetValue(format_number(xmax))
-        
-    def set_fit_region(self, xmin, xmax):
-        """
-            Set the fit region
-            @param xmin: minimum x-value to be included in fit
-            @param xmax: maximum x-value to be included in fit 
-        """
-        # Check values
-        try:
-            float(xmin)
-            float(xmax)
-        except:
-            raise ValueError, "LinearFit.set_fit_region: fit range must be floats"
-        self.xminFit.SetValue(format_number(xmin))
-        self.xmaxFit.SetValue(format_number(xmax))
-  
-class MyApp(wx.App):
-    def OnInit(self):
-        wx.InitAllImageHandlers()
-        plot = Theory1D([],[])
-        dialog = LinearFit(None, plot, self.onFitDisplay,self.returnTrans, -1, 'Linear Fit')
-        if dialog.ShowModal() == wx.ID_OK:
-            pass
-        dialog.Destroy()
-        
-        return 1
-    
-    def onFitDisplay(self, tempx,tempy,xminView,xmaxView,xmin,xmax,func):
-        pass
-        
-    def returnTrans(self):
-        return '','',0,0,0,0,0
-
-# end of class MyApp
-
-if __name__ == "__main__":
-    app = MyApp(0)
-    app.MainLoop()
Index: itools/fittings.py
===================================================================
--- guitools/fittings.py	(revision 1c94a9f14dc2f6ecbfee384ec605d5ba088ee2ef)
+++ 	(revision )
@@ -1,97 +1,0 @@
-from scipy import optimize
-#from numpy import *
-
-
-
-class Parameter:
-    """
-        Class to handle model parameters
-    """
-    def __init__(self, model, name, value=None):
-            self.model = model
-            self.name = name
-            if not value==None:
-                self.model.setParam(self.name, value)
-           
-    def set(self, value):
-        """
-            Set the value of the parameter
-        """
-        self.model.setParam(self.name, value)
-
-    def __call__(self):
-        """ 
-            Return the current value of the parameter
-        """
-        return self.model.getParam(self.name)
-    
-def sansfit(model, pars, x, y, err_y ,qmin=None, qmax=None):
-    """
-        Fit function
-        @param model: sans model object
-        @param pars: list of parameters
-        @param x: vector of x data
-        @param y: vector of y data
-        @param err_y: vector of y errors 
-    """
-    def f(params):
-        """
-            Calculates the vector of residuals for each point 
-            in y for a given set of input parameters.
-            @param params: list of parameter values
-            @return: vector of residuals
-        """
-        i = 0
-        for p in pars:
-            p.set(params[i])
-            i += 1
-        
-        residuals = []
-        for j in range(len(x)):
-            if x[j]>qmin and x[j]<qmax:
-                residuals.append( ( y[j] - model.runXY(x[j]) ) / err_y[j] )
-       
-        return residuals
-        
-    def chi2(params):
-        """
-            Calculates chi^2
-            @param params: list of parameter values
-            @return: chi^2
-        """
-        sum = 0
-        res = f(params)
-        for item in res:
-            sum += item*item
-        return sum
-        
-    p = [param() for param in pars]
-    out, cov_x, info, mesg, success = optimize.leastsq(f, p, full_output=1, warning=True)
-    # Calculate chi squared
-    if len(pars)>1:
-        chisqr = chi2(out)
-    elif len(pars)==1:
-        chisqr = chi2([out])
-        
-    return chisqr, out, cov_x    
-
-
-def calcCommandline(self,event):
-    """
-        Testing implementation
-    """
-  
-    # Fit a Line model
-    from LineModel import Line
-    line    = Line()
-    cstA = Parameter(line, 'A', event.cstA)
-    cstB  = Parameter(line, 'B', event.cstB)        
-    y = line.run()
-    chisqr, out, cov = sansfit(line, [cstA, cstB],  event.x, y, 0) 
-    # print "Output parameters:", out
-    print "The right answer is [70.0, 1.0]"
-    print chisqr, out, cov
-
-if __name__ == "__main__": 
-    
-    calcCommandline()
Index: itools/plottable_interactor.py
===================================================================
--- guitools/plottable_interactor.py	(revision a17ffdfe0f514c60553b596d93faab3540f2898c)
+++ 	(revision )
@@ -1,146 +1,0 @@
-import plottables
-from BaseInteractor import _BaseInteractor
-
-class PointInteractor(_BaseInteractor):
-    
-    def __init__(self,base,axes,color='black', zorder=3, id=''):
-        _BaseInteractor.__init__(self, base, axes, color=color)
-        self.zorder = zorder
-        self.id = id
-        self.color=color
-        self.colorlist = ['b','g','r','c','m','y']
-        self.symbollist = ['o','x','^','v','<','>','+','s','d','D','h','H','p']
-        self.marker = None
-        self.marker2 = None
-        self._button_down = False
-        self._context_menu = False
-        self._dragged = False
-        self.connect_markers([self.axes])
-        
-        
-    def _color(self,c):
-        """Return a particular colour"""
-        return self.colorlist[c%len(self.colorlist)]
-    
-    def _symbol(self,s):
-        """Return a particular symbol"""
-        return self.symbollist[s%len(self.symbollist)]
-
-
-    def points(self,x,y,dx=None,dy=None,color=0,symbol=0,label=None):
-        
-        if not self.marker==None:
-            self.base.connect.clear([self.marker])
-        
-        self.color = self._color(color)
-        
-        # Convert tuple (lo,hi) to array [(x-lo),(hi-x)]
-        if dx != None and type(dx) == type(()):
-            dx = nx.vstack((x-dx[0],dx[1]-x)).transpose()
-        if dy != None and type(dy) == type(()):
-            dy = nx.vstack((y-dy[0],dy[1]-y)).transpose()
-        
-        if dx==None and dy==None:
-            self.marker = self.axes.plot(x,y,color=self.color,
-                                   marker=self._symbol(symbol),linestyle='',label=label,
-                                   zorder=self.zorder)[0]
-        else:
-            self.marker = self.axes.errorbar(x, y, yerr=dy, xerr=None,
-             ecolor=self.color, 
-             color=self.color,
-             capsize=2,linestyle='', barsabove=False,
-             #mec=self.color, mfc=self.color,
-             marker=self._symbol(symbol),
-             lolims=False, uplims=False,
-             xlolims=False, xuplims=False,label=label,
-             zorder=self.zorder)[0]
-            
-        self.connect_markers([self.marker])
-        self.update()
-        
-    def curve(self, x, y, dy=None, color=0, symbol=0, label=None):
-        
-        if not self.marker==None:
-            self.base.connect.clear([self.marker])
-        
-        self.color = self._color(color)
-        
-        self.marker = self.axes.plot(x,y,color=self.color,marker='',linestyle='-',label=label)[0]
-            
-        self.connect_markers([self.marker])
-        self.update()
-        
-    def connect_markers(self,markers):
-        """
-        Connect markers to callbacks
-        """
-        for h in markers:
-            connect = self.base.connect
-            connect('enter', h, self._on_enter)
-            connect('leave', h, self._on_leave)
-            connect('click', h, self._on_click)
-            connect('release', h, self._on_release)
-            #connect('drag', h, self._on_drag)
-            connect('key', h, self.onKey)
-
-    def clear(self):
-        print "plottable_interactor.clear()"
-        
-    def _on_click(self, evt):
-        """
-            Called when a mouse button is clicked
-            from within the boundaries of an artist.
-        """
-        if self._context_menu==True:
-            self._context_menu = False
-            evt.artist = self.marker
-            self._on_leave(evt)
-        
-        
-    def _on_release(self, evt): 
-        """
-            Called when a mouse button is released
-            within the boundaries of an artist
-        """
-        # Check to see whether we are about to pop 
-        # the context menu up
-        if evt.button==3:
-            self._context_menu = True
-        
-    def _on_enter(self, evt):
-        """
-            Called when we are entering the boundaries
-            of an artist.
-        """
-        if not evt.artist.__class__.__name__=="Subplot":
-        
-            self.base.plottable_selected(self.id)
-            evt.artist.set_color('y')
-            if hasattr(evt.artist, "set_facecolor"):
-                evt.artist.set_facecolor('y')
-            if hasattr(evt.artist, "set_edgecolor"):
-                evt.artist.set_edgecolor('y')
-            self.axes.figure.canvas.draw_idle()
-        
-    def _on_leave(self, evt):
-        """
-            Called when we are leaving the boundaries
-            of an artist.
-        """
-        if not evt.artist.__class__.__name__=="Subplot":
-            if self._context_menu==False:
-                self.base.plottable_selected(None)
-                evt.artist.set_color(self.color)
-                if hasattr(evt.artist, "set_facecolor"):
-                    evt.artist.set_facecolor(self.color)
-                if hasattr(evt.artist, "set_edgecolor"):            
-                    evt.artist.set_edgecolor(self.color)
-                self.axes.figure.canvas.draw_idle()
-    
-    def update(self):
-        """
-            Update
-        """
-        pass
-     
-     
Index: itools/plottables.py
===================================================================
--- guitools/plottables.py	(revision 08b9e5866d389fac2cb0c63fae5353ffbffb969f)
+++ 	(revision )
@@ -1,983 +1,0 @@
-"""Prototype plottable object support.
-
-The main point of this prototype is to provide a clean separation between
-the style (plotter details: color, grids, widgets, etc.) and substance
-(application details: which information to plot).  Programmers should not be
-dictating line colours and plotting symbols.
-
-Unlike the problem of style in CSS or Word, where most paragraphs look
-the same, each line on a graph has to be distinguishable from its neighbours.
-Our solution is to provide parametric styles, in which a number of
-different classes of object (e.g., reflectometry data, reflectometry
-theory) representing multiple graph primitives cycle through a colour
-palette provided by the underlying plotter.
-
-A full treatment would provide perceptual dimensions of prominence and
-distinctiveness rather than a simple colour number.
-"""
-
-# Design question: who owns the color?
-# Is it a property of the plottable?
-# Or of the plottable as it exists on the graph?
-# Or if the graph?
-# If a plottable can appear on multiple graphs, in some case the
-# color should be the same on each graph in which it appears, and
-# in other cases (where multiple plottables from different graphs
-# coexist), the color should be assigned by the graph.  In any case
-# once a plottable is placed on the graph its color should not
-# depend on the other plottables on the graph.  Furthermore, if
-# a plottable is added and removed from a graph and added again,
-# it may be nice, but not necessary, to have the color persist.
-#
-# The safest approach seems to be to give ownership of color
-# to the graph, which will allocate the colors along with the
-# plottable.  The plottable will need to return the number of
-# colors that are needed.
-#
-# The situation is less clear for symbols.  It is less clear
-# how much the application requires that symbols be unique across
-# all plots on the graph.
-
-# Support for ancient python versions
-import copy
-import numpy
-import math
-import sys
-
-if 'any' not in dir(__builtins__):
-    def any(L):
-        for cond in L:
-            if cond: return True
-        return False
-    def all(L):
-        for cond in L:
-            if not cond: return False
-        return True
-
-# Graph structure for holding multiple plottables
-class Graph:
-    """
-    Generic plottables graph structure.
-    
-    Plot styles are based on color/symbol lists.  The user gets to select
-    the list of colors/symbols/sizes to choose from, not the application
-    developer.  The programmer only gets to add/remove lines from the
-    plot and move to the next symbol/color.
-
-    Another dimension is prominence, which refers to line sizes/point sizes.
-
-    Axis transformations allow the user to select the coordinate view
-    which provides clarity to the data.  There is no way we can provide
-    every possible transformation for every application generically, so
-    the plottable objects themselves will need to provide the transformations.
-    Here are some examples from reflectometry:
-       independent: x -> f(x)
-          monitor scaling: y -> M*y
-          log:  y -> log(y if y > min else min)
-          cos:  y -> cos(y*pi/180)
-       dependent:   x -> f(x,y)
-          Q4:      y -> y*x^4
-          fresnel: y -> y*fresnel(x)
-       coordinated: x,y = f(x,y)
-          Q:    x -> 2*pi/L (cos(x*pi/180) - cos(y*pi/180))
-                y -> 2*pi/L (sin(x*pi/180) + sin(y*pi/180))
-       reducing: x,y = f(x1,x2,y1,y2)
-          spin asymmetry: x -> x1, y -> (y1 - y2)/(y1 + y2)
-          vector net: x -> x1, y -> y1*cos(y2*pi/180)
-    Multiple transformations are possible, such as Q4 spin asymmetry
-
-    Axes have further complications in that the units of what are being
-    plotted should correspond to the units on the axes.  Plotting multiple
-    types on the same graph should be handled gracefully, e.g., by creating
-    a separate tab for each available axis type, breaking into subplots,
-    showing multiple axes on the same plot, or generating inset plots.
-    Ultimately the decision should be left to the user.
-
-    Graph properties such as grids/crosshairs should be under user control,
-    as should the sizes of items such as axis fonts, etc.  No direct
-    access will be provided to the application.
-
-    Axis limits are mostly under user control.  If the user has zoomed or
-    panned then those limits are preserved even if new data is plotted.
-    The exception is when, e.g., scanning through a set of related lines
-    in which the user may want to fix the limits so that user can compare
-    the values directly.  Another exception is when creating multiple
-    graphs sharing the same limits, though this case may be important
-    enough that it is handled by the graph widget itself.  Axis limits
-    will of course have to understand the effects of axis transformations.
-
-    High level plottable objects may be composed of low level primitives.
-    Operations such as legend/hide/show copy/paste, etc. need to operate
-    on these primitives as a group.  E.g., allowing the user to have a
-    working canvas where they can drag lines they want to save and annotate
-    them.
-
-    Graphs need to be printable.  A page layout program for entire plots
-    would be nice.
-    """
-    def _xaxis_transformed(self, name, units):
-        """
-            Change the property of the x axis
-            according to an axis transformation
-            (as opposed to changing the basic properties)
-        """
-        self.prop["xlabel"] = "%s (%s)"%(name,units)
-        self.prop["xunit"] = units
-        
-    def _yaxis_transformed(self, name, units):
-        """
-            Change the property of the y axis
-            according to an axis transformation
-            (as opposed to changing the basic properties)
-        """
-        self.prop["ylabel"] = "%s (%s)"%(name,units)
-        self.prop["yunit"] = units
-        
-    def xaxis(self,name,units):
-        """Properties of the x axis.
-        """
-        self.prop["xlabel"] = "%s (%s)"%(name,units)
-        self.prop["xunit"] = units
-        self.prop["xlabel_base"] = "%s (%s)"%(name,units)
-        self.prop["xunit_base"] = units
-
-    def yaxis(self,name,units):
-        """Properties of the y axis.
-        """
-        self.prop["ylabel"] = "%s (%s)"%(name,units)
-        self.prop["yunit"] = units
-        self.prop["ylabel_base"] = "%s (%s)"%(name,units)
-        self.prop["yunit_base"] = units
-        
-    def title(self,name):
-        """Graph title
-        """
-        self.prop["title"] = name
-        
-    def get(self,key):
-        """Get the graph properties"""
-        if key=="color":
-            return self.color
-        elif key == "symbol":
-            return self.symbol
-        else:
-            return self.prop[key]
-
-    def set(self,**kw):
-        """Set the graph properties"""
-        for key in kw:
-            if key == "color":
-                self.color = kw[key]%len(self.colorlist)
-            elif key == "symbol":
-                self.symbol = kw[key]%len(self.symbollist)
-            else:
-                self.prop[key] = kw[key]
-
-    def isPlotted(self, plottable):
-        """Return True is the plottable is already on the graph"""
-        if plottable in self.plottables:
-            return True
-        return False  
-        
-    def add(self,plottable):
-        """Add a new plottable to the graph"""
-        # record the colour associated with the plottable
-        if not plottable in self.plottables:          
-            self.plottables[plottable]=self.color
-            self.color += plottable.colors()
-        
-    def changed(self):
-        """Detect if any graphed plottables have changed"""
-        return any([p.changed() for p in self.plottables])
-    
-    def get_range(self):
-        """
-            Return the range of all displayed plottables
-        """
-        min = None
-        max = None
-        
-        for p in self.plottables:
-            if p.hidden==True:
-                continue
-            
-            if not p.x==None:
-                for x_i in p.x:
-                    if min==None or x_i<min:
-                        min = x_i
-                    if max==None or x_i>max:
-                        max = x_i
-                        
-        return min, max
-
-    def delete(self,plottable):
-        """Remove an existing plottable from the graph"""
-        if plottable in self.plottables:
-            del self.plottables[plottable]
-            if self.color > 0:
-                self.color =  self.color -1
-            else:
-                self.color =0 
-            
-    def reset_scale(self):
-        """
-            Resets the scale transformation data to the underlying data
-        """
-        for p in self.plottables:
-            p.reset_view()
-
-    def reset(self):
-        """Reset the graph."""
-        self.color = 0
-        self.symbol = 0
-        self.prop = {"xlabel":"", "xunit":None,
-                     "ylabel":"","yunit":None,
-                     "title":""}
-        self.plottables = {}
-        
-        
-    def _make_labels(self):
-        # Find groups of related plottables
-        sets = {}
-        for p in self.plottables:
-            if p.__class__ in sets:
-                sets[p.__class__].append(p)
-            else:
-                sets[p.__class__] = [p]
-                
-        # Ask each plottable class for a set of unique labels
-        labels = {}
-        for c in sets:
-            labels.update(c.labels(sets[c]))
-        
-        return labels
-    
-    def get_plottable(self, name):
-        """
-            Return the plottable with the given
-            name if it exists. Otherwise return None
-        """
-        for item in self.plottables:
-            if item.name==name:
-                return item
-        return None
-    
-    def returnPlottable(self):
-        """
-            This method returns a dictionary of plottables contained in graph
-            It is just by Plotpanel to interact with the complete list of plottables 
-            inside the graph.
-        """
-        return self.plottables
-
-    def render(self,plot):
-        """Redraw the graph"""
-        plot.connect.clearall()
-        
-        plot.clear()
-        plot.properties(self.prop)
-        labels = self._make_labels()
-        for p in self.plottables:
-            p.render(plot,color=self.plottables[p],symbol=0,label=labels[p])
-        plot.render()
-   
-   
-
-    def __init__(self,**kw):
-        self.reset()
-        self.set(**kw)
-        
-        # Name of selected plottable, if any
-        self.selected_plottable = None
-
-
-# Transform interface definition
-# No need to inherit from this class, just need to provide
-# the same methods.
-class Transform:
-    """Define a transform plugin to the plottable architecture.
-    
-    Transforms operate on axes.  The plottable defines the
-    set of transforms available for it, and the axes on which
-    they operate.  These transforms can operate on the x axis
-    only, the y axis only or on the x and y axes together.
-    
-    This infrastructure is not able to support transformations
-    such as log and polar plots as these require full control
-    over the drawing of axes and grids.
-    
-    A transform has a number of attributes.
-    
-    name: user visible name for the transform.  This will
-        appear in the context menu for the axis and the transform
-        menu for the graph.
-    type: operational axis.  This determines whether the 
-        transform should appear on x,y or z axis context
-        menus, or if it should appear in the context menu for
-        the graph.
-    inventory: (not implemented) 
-        a dictionary of user settable parameter names and
-        their associated types.  These should appear as keyword 
-        arguments to the transform call.  For example, Fresnel 
-        reflectivity requires the substrate density:
-             { 'rho': type.Value(10e-6/units.angstrom**2) }
-        Supply reasonable defaults in the callback so that 
-        limited plotting clients work even though they cannot 
-        set the inventory.
-    """
-        
-    def __call__(self,plottable,**kwargs):
-        """Transform the data.  Whenever a plottable is added
-        to the axes, the infrastructure will apply all required
-        transforms.  When the user selects a different representation
-        for the axes (via menu, script, or context menu), all
-        plottables on the axes will be transformed.  The
-        plottable should store the underlying data but set
-        the standard x,dx,y,dy,z,dz attributes appropriately.
-        
-        If the call raises a NotImplemented error the dataline 
-        will not be plotted.  The associated string will usually
-        be 'Not a valid transform', though other strings are possible.
-        The application may or may not display the message to the
-        user, along with an indication of which plottable was at fault.
-        """
-        raise NotImplemented,"Not a valid transform"
-
-    # Related issues
-    # ==============
-    #
-    # log scale:
-    #    All axes have implicit log/linear scaling options.
-    # 
-    # normalization:
-    #    Want to display raw counts vs detector efficiency correction
-    #    Want to normalize by time/monitor/proton current/intensity.
-    #    Want to display by eg. counts per 3 sec or counts per 10000 monitor.
-    #    Want to divide by footprint (ab initio, fitted or measured).
-    #    Want to scale by attenuator values.
-    #
-    # compare/contrast:
-    #    Want to average all visible lines with the same tag, and
-    #    display difference from one particular line.  Not a transform
-    #    issue?
-    #
-    # multiline graph:
-    #    How do we show/hide data parts.  E.g., data or theory, or 
-    #    different polarization cross sections?  One way is with
-    #    tags: each plottable has a set of tags and the tags are
-    #    listed as check boxes above the plotting area.  Click a
-    #    tag and all plottables with that tag are hidden on the
-    #    plot and on the legend.
-    #
-    # nonconformant y-axes:
-    #    What do we do with temperature vs. Q and reflectivity vs. Q
-    #    on the same graph?
-    #
-    # 2D -> 1D:
-    #    Want various slices through the data.  Do transforms apply
-    #    to the sliced data as well?
-
-
-class Plottable(object):
-    
-    # Short ascii name to refer to the plottable in a menu 
-    short_name = None
-    
-    # Fancy name
-    name = None
-    
-    # Data
-    x  = None
-    y  = None
-    dx = None
-    dy = None
-    
-    # Parameter to allow a plot to be part of the list without being displayed
-    hidden = False
-    
-    # Flag to set whether a plottable has an interactor or not
-    interactive = True
-
-    def __setattr__(self, name, value):
-        """
-            Take care of changes in View when data is changed.
-            This method is provided for backward compatibility.
-        """
-        object.__setattr__(self, name, value)
-        
-        if name in ['x', 'y', 'dx', 'dy']:
-            self.reset_view()
-            #print "self.%s has been called" % name
-
-    def set_data(self, x, y, dx=None, dy=None):
-        self.x = x
-        self.y = y
-        self.dy = dy
-        self.dx = dx
-        self.transformView()
-    
-    def xaxis(self, name, units):
-        """
-            Set the name and unit of x_axis
-            @param name: the name of x-axis
-            @param units : the units of x_axis
-        """
-        self._xaxis = name
-        self._xunit = units
-
-    def yaxis(self, name, units):
-        """
-            Set the name and unit of y_axis
-            @param name: the name of y-axis
-            @param units : the units of y_axis
-        """
-        self._yaxis = name
-        self._yunit = units
-        
-    def get_xaxis(self):
-        """ Return the units and name of x-axis"""
-        return self._xaxis, self._xunit
-    
-    def get_yaxis(self):
-        """ Return the units and name of y- axis"""
-        return self._yaxis, self._yunit
-
-    @classmethod
-    def labels(cls,collection):
-        """
-        Construct a set of unique labels for a collection of plottables of 
-        the same type.
-        
-        Returns a map from plottable to name.
-        """
-        n = len(collection)
-        map = {}
-        if n > 0:
-            basename = str(cls).split('.')[-1]
-            if n == 1:
-                map[collection[0]] = basename
-            else:
-                for i in xrange(len(collection)):
-                    map[collection[i]] = "%s %d"%(basename,i)
-        return map
-    ##Use the following if @classmethod doesn't work
-    # labels = classmethod(labels)
-    def setLabel(self,labelx,labely):
-        """
-            It takes a label of the x and y transformation and set View parameters
-            @param transx: The label of x transformation is sent by Properties Dialog
-            @param transy: The label of y transformation is sent Properties Dialog
-        """
-        self.view.xLabel= labelx
-        self.view.yLabel = labely
-        
-    def __init__(self):
-        self.view = View()
-        self._xaxis = ""
-        self._xunit = ""
-        self._yaxis = ""
-        self._yunit = "" 
-        
-        
-    def set_View(self,x,y):
-        """ Load View  """
-        self.x= x
-        self.y = y
-        self.reset_view()
-        
-    def reset_view(self):
-        """ Reload view with new value to plot"""
-        self.view = self.View(self.x, self.y, self.dx, self.dy)
-        self.view.Xreel = self.view.x
-        self.view.Yreel = self.view.y
-        self.view.DXreel = self.view.dx
-        self.view.DYreel = self.view.dy
-    def render(self,plot):
-        """The base class makes sure the correct units are being used for
-        subsequent plottable.  
-        
-        For now it is assumed that the graphs are commensurate, and if you 
-        put a Qx object on a Temperature graph then you had better hope 
-        that it makes sense.
-        """
-       
-        plot.xaxis(self._xaxis, self._xunit)
-        plot.yaxis(self._yaxis, self._yunit)
-        
-    def is_empty(self):
-        """
-            Returns True if there is no data stored in the plottable
-        """
-        if not self.x==None and len(self.x)==0 \
-            and not self.y==None and len(self.y)==0:
-            return True
-        return False
-        
-        
-    def colors(self):
-        """Return the number of colors need to render the object"""
-        return 1
-    
-    def transformView(self):
-        """
-            It transforms x, y before displaying
-        """
-        self.view.transform( self.x, self.y, self.dx,self.dy)
-        
-    def returnValuesOfView(self):
-        """
-            Return View parameters and it is used by Fit Dialog
-        """
-        return self.view.returnXview()
-    
-    def check_data_PlottableX(self): 
-        """
-            Since no transformation is made for log10(x), check that 
-            no negative values is plot in log scale
-        """
-        self.view.check_data_logX()
-        
-    def check_data_PlottableY(self): 
-        """
-            Since no transformation is made for log10(y), check that 
-            no negative values is plot in log scale
-        """
-        self.view.check_data_logY() 
-        
-    def transformX(self,transx,transdx):
-        """
-            Receive pointers to function that transform x and dx 
-            and set corresponding View pointers
-            @param transx: pointer to function that transforms x
-            @param transdx: pointer to function that transforms dx
-        """
-        self.view.setTransformX(transx,transdx)
-        
-    def transformY(self,transy,transdy):
-        """
-            Receive pointers to function that transform y and dy 
-            and set corresponding View pointers
-            @param transy: pointer to function that transforms y
-            @param transdy: pointer to function that transforms dy
-        """
-        self.view.setTransformY(transy,transdy)
-        
-    def onReset(self):
-        """
-            Reset x, y, dx, dy view with its parameters
-        """
-        self.view.onResetView()
-        
-    def onFitRange(self,xmin=None,xmax=None):
-        """
-            It limits View data range to plot from min to max
-            @param xmin: the minimum value of x to plot.
-            @param xmax: the maximum value of x to plot
-        """
-        self.view.onFitRangeView(xmin,xmax)
-        
-    class View:
-        """
-            Representation of the data that might include a transformation
-        """
-        x = None
-        y = None
-        dx = None
-        dy = None
-
-        
-        def __init__(self, x=None, y=None, dx=None, dy=None):
-            self.x = x
-            self.y = y
-            self.dx = dx
-            self.dy = dy
-            # To change x range to the reel range
-            self.Xreel = self.x
-            self.Yreel = self.y
-            self.DXreel = self.dx
-            self.DYreel = self.dy
-            # Labels of x and y received from Properties Dialog
-            self.xLabel =""
-            self.yLabel =""
-            # Function to transform x, y, dx and dy
-            self.funcx= None
-            self.funcy= None
-            self.funcdx= None
-            self.funcdy= None
-
-        def transform(self, x=None,y=None,dx=None, dy=None):
-            """
-                Transforms the x,y,dx and dy vectors and stores the output in View parameters
-        
-                @param x: array of x values
-                @param y: array of y values
-                @param dx: array of  errors values on x 
-                @param dy: array of error values on y
-            """
-            
-            # Sanity check
-            # Do the transofrmation only when x and y are empty
-            has_err_x = not (dx==None or len(dx)==0)
-            has_err_y = not (dy==None or len(dy)==0)
-            
-            if (x!=None) and (y!=None): 
-                if not dx==None and not len(dx)==0 and not len(x)==len(dx):
-                        raise ValueError, "Plottable.View: Given x and dx are not of the same length" 
-                # Check length of y array
-                if not len(y)==len(x):
-                    raise ValueError, "Plottable.View: Given y and x are not of the same length"
-            
-                if not dy==None and not len(dy)==0 and not len(y)==len(dy):
-                    message = "Plottable.View: Given y and dy are not of the same length: len(y)=%s, len(dy)=%s" %(len(y), len(dy))
-                    raise ValueError, message
-                
-                
-                self.x = []
-                self.y = []
-                if has_err_x:
-                    self.dx = []
-                else:
-                    self.dx = None
-                if has_err_y:
-                    self.dy = []
-                else:
-                    self.dy = None
-                tempx=[]
-                tempy=[]
-                
-                if not has_err_x:
-                    dx=numpy.zeros(len(x))
-                if not has_err_y:
-                    dy=numpy.zeros(len(y))
-              
-                for i in range(len(x)):
-                    try:
-                         tempx =self.funcx(x[i],y[i])
-                         tempy =self.funcy(y[i],x[i])
-                         if has_err_x:
-                             tempdx = self.funcdx(x[i], y[i], dx[i], dy[i])
-                         if has_err_y:
-                             tempdy = self.funcdy(y[i], x[i], dy[i], dx[i])
-                        
-                         self.x.append(tempx)
-                         self.y.append(tempy)
-                         if has_err_x:
-                             self.dx.append(tempdx)
-                         if has_err_y:
-                             self.dy.append(tempdy)
-                    except:
-                         tempx=x[i]
-                         tempy=y[i]
-                         print "View.transform: skipping point x=%g y=%g" % (x[i], y[i])
-                         
-                         print sys.exc_value  
-               
-                # Sanity check
-                if not len(self.x)==len(self.y):
-                    raise ValueError, "Plottable.View: transformed x and y are not of the same length" 
-                if has_err_x and not (len(self.x) and len(self.dx)):
-                    raise ValueError, "Plottable.View: transformed x and dx are not of the same length" 
-                if has_err_y and not (len(self.y) and len(self.dy)):
-                    raise ValueError, "Plottable.View: transformed y and dy are not of the same length" 
-                
-                # Check that negative values are not plot on x and y axis for log10 transformation
-                self.check_data_logX()
-                self.check_data_logY()
-                # Store x ,y dx,and dy in their full range for reset
-                self.Xreel = self.x
-                self.Yreel = self.y
-                self.DXreel = self.dx
-                self.DYreel = self.dy
-                
-                
-        def onResetView(self):
-            """
-                Reset x,y,dx and y in their full range  and in the initial scale
-                in case their previous range has changed  
-            """
-            self.x = self.Xreel
-            self.y = self.Yreel
-            self.dx = self.DXreel
-            self.dy = self.DYreel
-            
-        def setTransformX(self,funcx,funcdx):  
-            """
-                Receive pointers to function that transform x and dx 
-                and set corresponding View pointers
-                @param transx: pointer to function that transforms x
-                @param transdx: pointer to function that transforms dx
-            """
-            self.funcx= funcx
-            self.funcdx= funcdx
-            
-        def setTransformY(self,funcy,funcdy):
-            """
-                Receive pointers to function that transform y and dy 
-                and set corresponding View pointers
-                @param transx: pointer to function that transforms y
-                @param transdx: pointer to function that transforms dy
-            """    
-            self.funcy= funcy
-            self.funcdy= funcdy
-       
-        def returnXview(self):
-            """
-                Return View  x,y,dx,dy
-            """
-            return self.x,self.y,self.dx,self.dy
-        
-     
-        def check_data_logX(self): 
-            """
-                 Remove negative value in x vector 
-                 to avoid plotting negative value of Log10
-            """
-            tempx=[]
-            tempdx=[]
-            tempy=[]
-            tempdy=[]
-            if self.dx==None:
-                self.dx=numpy.zeros(len(self.x))
-            if self.dy==None:
-                self.dy=numpy.zeros(len(self.y))
-            if self.xLabel=="log10(x)" :
-                for i in range(len(self.x)):
-                    try:
-                        if (self.x[i]> 0):
-                           
-                            tempx.append(self.x[i])
-                            tempdx.append(self.dx[i])
-                            tempy.append(self.y[i])
-                            tempdy.append(self.dy[i])
-                    except:
-                        print "check_data_logX: skipping point x %g" %self.x[i]
-                        print sys.exc_value  
-                        pass 
-           
-                self.x = tempx
-                self.y = tempy
-                self.dx = tempdx
-                self.dy = tempdy
-            
-        def check_data_logY(self): 
-            """
-                 Remove negative value in y vector 
-                 to avoid plotting negative value of Log10
-            """
-            tempx=[]
-            tempdx=[]
-            tempy=[]
-            tempdy=[]
-            if self.dx==None:
-                self.dx=numpy.zeros(len(self.x))
-            if self.dy==None:
-                self.dy=numpy.zeros(len(self.y))
-            if (self.yLabel == "log10(y)" ):
-                for i in range(len(self.x)):
-                     try:
-                        if (self.y[i]> 0):
-                            tempx.append(self.x[i])
-                            tempdx.append(self.dx[i])
-                            tempy.append(self.y[i])
-                            tempdy.append(self.dy[i])
-                     except:
-                        print "check_data_logY: skipping point %g" %self.y[i]
-                        print sys.exc_value  
-                        pass
-              
-                self.x = tempx
-                self.y = tempy
-                self.dx = tempdx
-                self.dy = tempdy
-                
-        def onFitRangeView(self,xmin=None,xmax=None):
-            """
-                It limits View data range to plot from min to max
-                @param xmin: the minimum value of x to plot.
-                @param xmax: the maximum value of x to plot
-            """
-            tempx=[]
-            tempdx=[]
-            tempy=[]
-            tempdy=[]
-            if self.dx==None:
-                self.dx=numpy.zeros(len(self.x))
-            if self.dy==None:
-                self.dy=numpy.zeros(len(self.y))
-            if ( xmin != None ) and ( xmax != None ):
-                for i in range(len(self.x)):
-                    if ( self.x[i] >= xmin ) and ( self.x[i] <= xmax ):
-                        tempx.append(self.x[i])
-                        tempdx.append(self.dx[i])
-                        tempy.append(self.y[i])
-                        tempdy.append(self.dy[i])
-                self.x=tempx
-                self.y=tempy
-                self.dx=tempdx
-                self.dy=tempdy        
-
-class Data1D(Plottable):
-    """Data plottable: scatter plot of x,y with errors in x and y.
-    """
-    
-    def __init__(self,x,y,dx=None,dy=None):
-        """Draw points specified by x[i],y[i] in the current color/symbol.
-        Uncertainty in x is given by dx[i], or by (xlo[i],xhi[i]) if the
-        uncertainty is asymmetric.  Similarly for y uncertainty.
-
-        The title appears on the legend.
-        The label, if it is different, appears on the status bar.
-        """
-        self.name = "data"
-        self.x = x
-        self.y = y
-        self.dx = dx
-        self.dy = dy
-        self.xaxis( '', '')
-        self.yaxis( '', '')
-        self.view = self.View(self.x, self.y, self.dx, self.dy)
-        
-    def render(self,plot,**kw):
-        """
-            Renders the plottable on the graph
-        """
-        if self.interactive==True:
-            plot.interactive_points(self.view.x,self.view.y,
-                                    dx=self.view.dx,dy=self.view.dy,
-                                    name=self.name, **kw)            
-        else:
-            plot.points(self.view.x,self.view.y,dx=self.view.dx,dy=self.view.dy,**kw)
-   
-    def changed(self):
-        return False
-
-    @classmethod
-    def labels(cls, collection):
-        """Build a label mostly unique within a collection"""
-        map = {}
-        for item in collection:
-            #map[item] = label(item, collection)
-            #map[item] = r"$\rm{%s}$" % item.name
-            map[item] = item.name
-        return map
-    
-class Theory1D(Plottable):
-    """Theory plottable: line plot of x,y with confidence interval y.
-    """
-    def __init__(self,x,y,dy=None):
-        """Draw lines specified in x[i],y[i] in the current color/symbol.
-        Confidence intervals in x are given by dx[i] or by (xlo[i],xhi[i])
-        if the limits are asymmetric.
-        
-        The title is the name that will show up on the legend.
-        """
-        self.name= "theory"
-        self.x = x
-        self.y = y
-        self.dy = dy
-        self.xaxis( '', '')
-        self.yaxis( '', '')
-        self.view = self.View(self.x, self.y, None, self.dy)
-        
-    def render(self,plot,**kw):
-        if self.interactive==True:
-            plot.interactive_curve(self.view.x,self.view.y,
-                                   dy=self.view.dy,
-                                   name=self.name,**kw)
-        else:
-            plot.curve(self.view.x,self.view.y,dy=self.view.dy,**kw)
-            
-
-    def changed(self):
-        return False
-    
-    @classmethod
-    def labels(cls, collection):
-        """Build a label mostly unique within a collection"""
-        map = {}
-        for item in collection:
-            #map[item] = label(item, collection)
-            #map[item] = r"$\rm{%s}$" % item.name
-            map[item] = item.name
-        return map
-   
-   
-class Fit1D(Plottable):
-    """Fit plottable: composed of a data line plus a theory line.  This
-    is treated like a single object from the perspective of the graph,
-    except that it will have two legend entries, one for the data and
-    one for the theory.
-
-    The color of the data and theory will be shared."""
-
-    def __init__(self,data=None,theory=None):
-        self.data=data
-        self.theory=theory
-
-    def render(self,plot,**kw):
-        self.data.render(plot,**kw)
-        self.theory.render(plot,**kw)
-
-    def changed(self):
-        return self.data.changed() or self.theory.changed()
-
-######################################################
-
-def sample_graph():
-    import numpy as nx
-    
-    # Construct a simple graph
-    if False:
-        x = nx.array([1,2,3,4,5,6],'d')
-        y = nx.array([4,5,6,5,4,5],'d')
-        dy = nx.array([0.2, 0.3, 0.1, 0.2, 0.9, 0.3])
-    else:
-        x = nx.linspace(0,1.,10000)
-        y = nx.sin(2*nx.pi*x*2.8)
-        dy = nx.sqrt(100*nx.abs(y))/100
-    data = Data1D(x,y,dy=dy)
-    data.xaxis('distance', 'm')
-    data.yaxis('time', 's')
-    graph = Graph()
-    graph.title('Walking Results')
-    graph.add(data)
-    graph.add(Theory1D(x,y,dy=dy))
-
-    return graph 
-
-def demo_plotter(graph):
-    import wx
-    #from pylab_plottables import Plotter
-    from mplplotter import Plotter
-
-    # Make a frame to show it
-    app = wx.PySimpleApp()
-    frame = wx.Frame(None,-1,'Plottables')
-    plotter = Plotter(frame)
-    frame.Show()
-
-    # render the graph to the pylab plotter
-    graph.render(plotter)
-    
-    class GraphUpdate:
-        callnum=0
-        def __init__(self,graph,plotter):
-            self.graph,self.plotter = graph,plotter
-        def __call__(self):
-            if self.graph.changed(): 
-                self.graph.render(self.plotter)
-                return True
-            return False
-        def onIdle(self,event):
-            #print "On Idle checker %d"%(self.callnum)
-            self.callnum = self.callnum+1
-            if self.__call__(): 
-                pass # event.RequestMore()
-    update = GraphUpdate(graph,plotter)
-    frame.Bind(wx.EVT_IDLE,update.onIdle)
-    app.MainLoop()
-
-import sys; print sys.version
-if __name__ == "__main__":
-    demo_plotter(sample_graph())
-    
Index: itools/requirements.txt
===================================================================
--- guitools/requirements.txt	(revision 05da1f8994b512c6a943f61974e1f83b0508cfab)
+++ 	(revision )
@@ -1,118 +1,0 @@
-- BUGS
-
-  1- [DONE] After fitting, the fit panel is not updated with the output values of the fit. 
-  
-  2- [DONE] Do this:
-      a) load the file line_in_x2_y.txt
-      b) fit a straight line, close the Fit Dialog
-      c) change the scale using the "Properties" menu to x vs y (linear vs linear)
-      You will see an exception that should be fixed.
-
-  3-  [DONE] Load the file line_in_x2_y.txt in miniView. Select x^2 and y for the scales. Fit it. 
-      a) The fit range is wrong, it's not update for the X^2 view.
-      b) the fit result is wrong
-      c) Even if you update the range, the fit and the plots are wrong.
-      
-  4- [DONE]At the python command prompt, try:
-       from sans.guitools.PlotPanel import PlotPanel
-       
-       You will get an exception: ImportError: No module named fittings
-       
-     Guitools should not depend on your miniView code.
-     
-  5- [QUESTION] Each time you open and close the Fit Dialog, a new label "Theory1D" is created in the
-     legend. There should always be only one, for the _last_ fit, and the name should be "Fit".
-     [alina] is it fine if I delete the fit line from the graph
-      and remove  it when I close the Fit Dialog window?
-     [Mathieu] That might work. I kind of like it. Let's do it like that and see what the users
-      need. 
-     
-  6-[QUESTION ] Do this:
-  		a) Load the file 'line_in_logy_x.txt'
-  		b) Fit a straight line
-  		c) The fit shown does not start from the first point and it's not a straight line. 
-  	[ALINA] then for transformation to log Do I have to transform x to log and set x linear?
-  	[Mathieu] No. That would confuse the user, who expects a log scale. The answer here is to fit 
-  	 y = A * log(x) + B, which is a straight line in the y vs log(x) representation.
-  	 
---> [ALINA] woring better...I am concerned how to fit a straight line when x is changing too?
-  	 
-      
-- NOTES that might help for bugs
-  1- Make sure you are fitting the View data, not the underlying data
-  2- Since you are using the log scale from matplotlib, the fit for when one of 
-  		the axis is in log will NOT be a straight line
-  3- Make sure that you are filling the View of the fit result correctly.
-  [ALINA] not using the log of matplotlib anymore but the axis are never in the log scale by the value are in log10 x
-  [Mathieu] See my comment to point 6. The right answer is to go back to using the log scale of matplotlib.
-
-- NEEDED IMPROVEMENTS
-  1-[DONE] After loading a new file or changing the scale using the "Properties" menu, remove any previously displayed fit from the graph.
-  
-  2- There are additional y scales we need: y, y^2, log(y), 1/y, 1/sqrt(y), log(y * x), log(y * x^2)
-  [QUESTION] when plottong y=log(y*x) is the user allowed to do transformation on x at the same time 
-  for example x---> log X with  y=log(x*y)
-  [PROBLEM]WITH  log(y * x), log(y * x^2)
-  	
-  3-[DONE] You should change the label according to what the user chose, and not hard-code them.
-     For example, in PlotPanel._onEVT_FUNC_PROPERTY, replace
-          
-            self.graph.xaxis('\\rm{q^{2}} ', 'A^{-2}')
-         
-         with
-            name, units = self.some_plottable.get_xaxis()
-            self.graph.xaxis("(%s)^2" % name,  "(%s)^2" % units)
-    
-     That way it still works even if the user is not plotting Intensity versus Q.
-     
-  4- [DONE] In the fit dialog, put the "fit" and "Close" button in the bottom right corner, like in a standard file dialog.
-  
-  5- The layout of the Fit Dialog should be improved.
-  
-  6- The code should be well documented and clean-up (no print statements).
-  
-  
-  
-  AFTER TALKING WITH STEEVE KLEIN
-  
- This is a list the changes Steeve wants :
- 
-  1- [DONE] Add curves : ln(y) in linear scale, ln(x^(4)*I)
-  
-  2- [DONE]Specify in the fitDialog if natural log or log base 10
-  
-  3- [FIXED]When fitting sphere.txt , logx --logy ,fitting is not correct
-  
-  4- [FIXED]the line to fit always is displayed from x min to max all the time even if xmin is changed
-     or xmax is changed
-     
-  5- [FIXED]The fitting errors are too small (order of 10^(-7))for that case too,certainly wrong
-  
-  6- When to see errors bars appear when loading sphere.txt file. 
-  
-  7- Add zoom in option when xmax and xmin(user) are entered.
-  
-  8-[FIXED] Always want to know the initial value of xmin and xmax when opening the fitDialog.These values
-     should always be independant of the transformation
-     
-  9-[FIXED] the user should be able to add point to fit without knowing the exact range or guessing
-  		a range to fit.
-
-	TO Dr. MATHIEU 
-  1- I probably have to change the interface of the fitdialog, I would like to discuss 
-     it before proceeding
-	ALINA
- 1- Would like to change the y axis label display
- 
- 
-Cleaning up for deployment:
-
- - When zooming, check that the new lower bound is positive if on a log scale [DONE] 
- - Fixed bug with the zooming dependency on scale [DONE]
- - Improved look of Fit dialog [DONE]
- 
- - Improve labels
- 
- - Problem scales:
-     - x vs 1/y
-     
Index: itools/setup.py
===================================================================
--- guitools/setup.py	(revision 0139e91b03d3b3c0eb1ca019653ed34b67cbd7b5)
+++ 	(revision )
@@ -1,26 +1,0 @@
-"""
-     Installation script for SANS gui tools
-"""
-
-
-# Then build and install the modules
-from distutils.core import setup, Extension
-
-
-setup(
-    name="guitools",
-    version = "0.1",
-    description = "Python module for SANS gui tools",
-    author = "University of Tennessee",
-    #author_email = "",
-    url = "http://danse.chem.utk.edu",
-    
-    # Place this module under the sans package
-    #ext_package = "sans",
-    
-    # Use the pure python modules
-    package_dir = {"sans.guitools":"."},
-    
-    packages = ["sans.guitools"]
-    )
-        
Index: itools/test_panel.py
===================================================================
--- guitools/test_panel.py	(revision c87d55a45e57622985ea41022323206eae4cd3da)
+++ 	(revision )
@@ -1,194 +1,0 @@
-import wx
-from PlotPanel import PlotPanel
-from plottables import Plottable, Graph, Data1D, Theory1D
-import  sys
-import numpy
-import random, math
-
-class SANSplotpanel(PlotPanel):
-    
-    def __init__(self, parent, id = -1, color = None,\
-        dpi = None, **kwargs):
-        PlotPanel.__init__(self, parent, id=id, color=color, dpi=dpi, **kwargs)
-        
-        # Keep track of the parent Frame
-        self.parent = parent
-        
-        # Internal list of plottable names (because graph 
-        # doesn't have a dictionary of handles for the plottables)
-        self.plots = {}
-        
-    def add_plottable(self, plot):
-        self.plots[plot.name] = plot
-        
-        self.graph.add(plot)
-        self.graph.xaxis('\\rm{q} ', 'A^{-1}')
-        self.graph.yaxis("\\rm{Intensity} ","cm^{-1}")
-        self.onResetGraph(None)
-                
-    def plottable_selected(self, id):
-        PlotPanel.plottable_selected(self, id)
-        if id is not None:
-            self.parent.SetStatusText("Hovering over %s" % self.graph.selected_plottable)
-        else:
-            self.parent.SetStatusText("")
-   
-                
-    def onContextMenu(self, event):
-        """
-            Default context menu for a plot panel
-        """
-        # Slicer plot popup menu
-        id = wx.NewId()
-        slicerpop = wx.Menu()
-        slicerpop.Append(id,'&Save image', 'Save image as PNG')
-        wx.EVT_MENU(self, id, self.onSaveImage)
-        
-        slicerpop.AppendSeparator()
-        id = wx.NewId()
-        slicerpop.Append(id, '&Change scale')
-        wx.EVT_MENU(self, id, self._onProperties)
-        
-        id = wx.NewId()
-        slicerpop.Append(id, '&Reset Graph')
-        wx.EVT_MENU(self, id, self.onResetGraph)
- 
-        if self.graph.selected_plottable in self.plots:
-            # Careful here: Message to status bar
-            self.parent.SetStatusText("Fit a line to %s" % self.graph.selected_plottable)
-            id = wx.NewId()
-            slicerpop.AppendSeparator()
-            slicerpop.Append(id, '&Linear Fit to %s' % self.graph.selected_plottable )
-            wx.EVT_MENU(self, id, self.onFitting)
-       
-        pos = event.GetPosition()
-        pos = self.ScreenToClient(pos)
-        self.PopupMenu(slicerpop, pos)
-       
-    def onFitting(self, event):
-        if self.graph.selected_plottable is not None:
-            if self.plots[self.graph.selected_plottable].__class__.__name__ == 'Data1D':
-                PlotPanel.onFitting(self, event)     
-            else:
-                self.parent.SetStatusText("Can't fit a theory curve")
-
-class ViewerFrame(wx.Frame):
-    """
-        Add comment
-    """
-    def __init__(self, parent, id, title):
-        """
-            comment
-            @param parent: parent panel/container
-        """
-        # Initialize the Frame object
-        wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(950,850))
-        
-        # Panel for 1D plot
-        self.plotpanel    = SANSplotpanel(self, -1, style=wx.RAISED_BORDER)
-
-        # Set up the menu
-        self._setup_menus()
-      
-        # Set up the layout
-        self._setup_layout()
-                
-        # Register the close event so it calls our own method
-        wx.EVT_CLOSE(self, self._onClose)
-        
-       
-    def _setup_layout(self):
-        """
-            Set up the layout
-        """
-        # Status bar
-        self.sb = self.CreateStatusBar()
-        self.SetStatusText("This is a data viewer")
-        
-        # Two columns of panels
-        sizer = wx.GridBagSizer(0,0)
-        
-        sizer.Add(self.plotpanel, (0,0), (1,1),   flag=wx.EXPAND | wx.ALL, border=0)
-        sizer.AddGrowableRow(0)
-        sizer.AddGrowableCol(0)
-   
-        self.SetSizer(sizer)
-        self.Centre()
-                
-    def _setup_menus(self):
-        """
-            Set up the application menus
-        """
-        
-        # Menu
-        menubar = wx.MenuBar()
-        # File menu
-        filemenu = wx.Menu()
-        
-        # Quit
-        id = wx.NewId()
-        filemenu.Append(id,'&Quit', 'Exit')
-        wx.EVT_MENU(self, id, self.Close)
-        
-        # New plot
-        id = wx.NewId()
-        filemenu.Append(id,'&Add data', 'Add a new curve to the plot')
-        wx.EVT_MENU(self, id, self._add_data)
- 
-        # Add sub menus
-        menubar.Append(filemenu, '&File')
-         
-        self.SetMenuBar(menubar)
-
-    def _onClose(self, event):
-        """
-        """
-        wx.Exit()
-        sys.exit()
-           
-    def _add_data(self, event):
-        data_len = 25
-        x  = numpy.zeros(data_len)
-        y  = numpy.zeros(data_len)
-        x2  = numpy.zeros(data_len)
-        y2  = numpy.zeros(data_len)
-        dy2  = numpy.zeros(data_len)
-        x3  = numpy.zeros(data_len)
-        y3  = numpy.zeros(data_len)
-        dy3  = numpy.zeros(data_len)
-        for i in range(len(x)):
-            x[i] = i
-            x2[i] = i-0.1+0.2*random.random()
-            x3[i] = i-0.1+0.2*random.random()
-            y[i] = 0.5*(i+random.random())
-            y2[i] = i+random.random()
-            dy2[i] = math.sqrt(y2[i]) 
-            y3[i] = 0.3*(i+random.random())
-            dy3[i] = math.sqrt(y3[i]) 
-            
-        newplot = Theory1D(x=x, y=y)
-        newplot.name = "Theory curve"
-        self.plotpanel.add_plottable(newplot)
-        
-        newplot = Data1D(x=x2, y=y2, dy=dy2)
-        newplot.name = "Data set 1"
-        self.plotpanel.add_plottable(newplot)
-        
-        newplot = Data1D(x=x3, y=y3, dy=dy3)
-        newplot.name = "Data set 2"
-        self.plotpanel.add_plottable(newplot)
-            
-  
-class ViewApp(wx.App):
-    def OnInit(self):
-        frame = ViewerFrame(None, -1, 'testView')    
-        frame.Show(True)
-        self.SetTopWindow(frame)
-        
-        return True
-        
-
-if __name__ == "__main__": 
-    app = ViewApp(0)
-    app.MainLoop()        
-            
Index: itools/transform.py
===================================================================
--- guitools/transform.py	(revision ad8bcd6945b6f5a975704dfa5d1fb0894ccc99b2)
+++ 	(revision )
@@ -1,280 +1,0 @@
-import math  
-         
-def toX(x,y=None):
-    """
-    This function is used to load value on Plottable.View
-    @param x: Float value
-    @return x,
-    """
-    return x
-
-def toX_pos(x,y=None):
-    """
-    This function is used to load value on Plottable.View
-    @param x: Float value
-    @return x,
-    """
-    if not x>0:
-        raise ValueError, "Transformation only accepts positive values."
-    else:
-        return x
-
-def toX2(x,y=None):
-    """
-        This function is used to load value on Plottable.View
-        Calculate x^(2)
-        @param x: float value
-    """
-    return x*x
-
-def fromX2(x,y=None):
-     """
-         This function is used to load value on Plottable.View
-        Calculate square root of x
-        @param x: float value
-     """
-     if not x >=0 :
-         raise ValueError, "square root of a negative value "
-     else:
-         return math.sqrt(x)
-     
-def toLogX(x,y=None):
-    """
-        This function is used to load value on Plottable.View
-        calculate log x
-        @param x: float value
-    """
-    if not x > 0:
-        raise ValueError, "Log(x)of a negative value "
-    else:
-        return math.log(x)
-    
-def toOneOverX(x,y=None):
-    if x !=0:
-        return 1/x
-    else:
-        raise ValueError,"cannot divide by zero"
-    
-def toOneOverSqrtX(y , x=None):
-    if y > 0:
-        return 1/math.sqrt(y)
-    else:
-        raise ValueError,"transform.toOneOverSqrtX: cannot be computed"
-    
-    
-def toLogYX2(y,x):
-    if y*(x**2) >0:
-        return math.log(y*(x**2))
-    else:
-         raise ValueError,"transform.toLogYX2: cannot be computed"
-     
-
-def toLogYX4(y, x):
-    if math.pow(x,4)*y > 0:
-        return math.log(math.pow(x,4)*y)
-    else:
-         raise ValueError,"transform.toLogYX4: input error"
-
-def toLogXY(y,x):
-    """
-        This function is used to load value on Plottable.View
-        calculate log x
-        @param x: float value
-    """
-    if not x*y > 0:
-        raise ValueError, "Log(X*Y)of a negative value "
-    else:
-        return math.log(x*y)
-
-
-
-def errToX(x,y=None,dx=None,dy=None):
-    """
-        calculate error of x**2
-        @param x: float value
-        @param dx: float value
-    """
-    if dx==None:
-        dx=0
-    return dx
-
-def errToX_pos(x,y=None,dx=None,dy=None):
-    """
-        calculate error of x**2
-        @param x: float value
-        @param dx: float value
-    """
-    if dx==None:
-        dx=0
-        
-    # Check that the point on the graph is positive
-    # within errors
-    if not x-dx > 0:
-        raise ValueError, "Transformation does not accept point that are consistent with zero."
-    
-    return dx
-
-
-def errToX2(x,y=None,dx=None,dy=None):
-    """
-        calculate error of x**2
-        @param x: float value
-        @param dx: float value
-    """
-    if  dx != None:
-        err = 2*x*dx
-        return math.fabs(err)
-    else:
-        return 0.0
-    
-def errFromX2(x,y=None,dx=None,dy=None):
-    """
-        calculate error of sqrt(x)
-        @param x: float value
-        @param dx: float value
-    """
-    if (x > 0):
-        if(dx != None):
-            err = dx/(2*math.sqrt(x))
-        else:
-            err = 0
-        return math.fabs(err)
-    else:
-        raise ValueError, "transform.errFromX2: can't compute error of negative x"
-    
-def errToLog10X(x,y=None,dx=None,dy=None):
-    """
-        calculate error of Log(x)
-        @param x: float value
-        @param dx: float value
-    """
-    if dx==None:
-        dx = 0
-        
-    # Check that the point on the graph is positive
-    # within errors
-    if not x-dx > 0:
-        raise ValueError, "Transformation does not accept point that are consistent with zero."
-        
-    if x!=0:
-        dx = dx/(x*math.log(10))
-    else:
-        raise ValueError, "errToLogX: divide by zero"
-    
-    return dx
-    
-def errToLogX(x,y=None,dx=None,dy=None):
-    """
-        calculate error of Log(x)
-        @param x: float value
-        @param dx: float value
-    """
-    if dx==None:
-        dx = 0
-            
-    # Check that the point on the graph is positive
-    # within errors
-    if not x-dx > 0:
-        raise ValueError, "Transformation does not accept point that are consistent with zero."
-
-    if x!=0:
-        dx = dx/x
-    else:
-        raise ValueError, "errToLogX: divide by zero"
-    
-    return dx
-
-
-
-def errToYX2(x, y, dx=None, dy=None):
-    if dx==None:
-        dx=0
-    if dy==None:
-        dy=0
-    err =math.sqrt((2*x*y*dx)**2 +((x**2)*dy)**2)
-    return err 
-    
-def errToLogXY(x,y,dx=None, dy=None):
-    """
-        calculate error of Log(xy)
-    """
-    # Check that the point on the graph is positive
-    # within errors
-    if (not x-dx > 0) or (not y-dy > 0):
-        raise ValueError, "Transformation does not accept point that are consistent with zero."
-    
-    if (x!=0) and (y!=0):
-        if dx == None:
-            dx = 0
-        if dy == None:
-            dy = 0
-        err = (dx/x)**2 + (dy/y)**2
-    else:
-        raise ValueError, "cannot compute this error"
-   
-    return math.sqrt(math.fabs(err))
-    
-def errToLogYX2(x,y,dx=None, dy=None):
-    """
-        calculate error of Log(yx**2)
-    """
-    # Check that the point on the graph is positive
-    # within errors
-    if (not x-dx > 0) or (not y-dy > 0):
-        raise ValueError, "Transformation does not accept point that are consistent with zero."
-    
-    if (x > 0) and (y > 0):
-        if (dx == None):
-            dx = 0
-        if (dy == None):
-            dy = 0
-        err = (2.0*dx/x)**2 + (dy/y)**2
-    else:
-         raise ValueError, "cannot compute this error"
-     
-    return math.sqrt(math.fabs(err)) 
-        
-def errOneOverX(x,y=None,dx=None, dy=None):
-    """
-         calculate error on 1/x
-    """
-    if (x != 0):
-        if dx ==None:
-            dx= 0
-        err = dx/x**2
-    else:
-        raise ValueError,"Cannot compute this error"
-    
-    return math.fabs(err)
-
-def errOneOverSqrtX(x,y=None, dx=None,dy=None):
-    """
-        Calculate error on 1/sqrt(x)
-    """
-    if (x >0):
-        if dx==None:
-            dx =0
-        err= -1/2*math.pow(x, -3.0/2.0)* dx
-    else:
-        raise ValueError, "Cannot compute this error"
-    
-    return math.fabs(err)
-
-def errToLogYX4(x,y=None,dx=None,dy=None):
-    """
-        error for ln(y*x^(4))
-        @param x: float value
-    """
-    # Check that the point on the graph is positive
-    # within errors
-    if (not x-dx > 0) or (not y-dy > 0):
-        raise ValueError, "Transformation does not accept point that are consistent with zero."
-    
-    if dx==None:
-        dx=0
-    if dy==None:
-        dy=0
-    err =math.sqrt((4.0*dx/x)**2 +(dy/y)**2)
-    return err 
-
-           
Index: itools/unitConverter.py
===================================================================
--- guitools/unitConverter.py	(revision 43bf807cf42ed0ae5fb04d7b4a0712b915934570)
+++ 	(revision )
@@ -1,70 +1,0 @@
-import re, math,string
-#Input   ->  new scale  ->  Output
-
-unit1= "A^{-1} "#           x                    A^{-1}
-unit2= "A"  #                   x                     A
-unit3="A"  #                  x^2                  A^{2}
-unit4= "A "  #                  1/x                  A^{-1}
-unit5= "A^{0.5} " #        x^2                      A
-unit9= "m^{1/2}" #         x^2               m
-
-#If you don't recognize the pattern, give up and just put some parentheses around the unit and write the transoformation:
-
-unit6= "m/s"  #                x^2               (m/s)^{2}
-unit7= "m/s^{2}" #         1/x                 (m/s^{2})^{-1}
-unit8= "m/s^{4}" #         x^2               (m/s^{4})^{2}
-
-
-def UnitConvertion(pow,unit):
-    if pow!=0:
-        if string.find(unit, "^") !=-1:# if the unit contains a power ^
-            unitSplitted= re.split("\^",unit)
-            if string.find(unitSplitted[0],"/")!=-1 or\
-             string.find(unitSplitted[0],"-")!=-1 : # find slash /
-                if pow==1:
-                    unit = unit
-                else:
-                    unit= "("+unit+")"+"^{"+str(pow)+"}"
-            else:
-                if string.find(unitSplitted[1],"{")!=-1:# if found a {
-                    findPower= re.split("{",unitSplitted[1])
-                    if string.find(findPower[1],"}")!=-1:# found }
-                        unitPower= re.split("}",findPower[1])
-                        if (string.find(unitPower[0],".")!=-1):
-                            power= float(unitPower[0])*pow 
-                        elif (string.find(unitPower[0],"/") !=-1 ): #power is a float
-                            poweSplitted= re.split("/",unitPower[0])
-                            power=pow*int(poweSplitted[0])/int(poweSplitted[1])
-                        else:
-                            power= int(unitPower[0])*pow   
-                       
-                        if power==1.0:
-                           unit = unitSplitted[0]
-                        elif power==0.5:
-                            unit = unitSplitted[0]+"^{1/2}"  
-                        elif power==-0.5:
-                            unit = unitSplitted[0]+"^{-1/2}"  
-                        else:
-                            unit= unitSplitted[0]+"^{"+str(power)+"}"  
-                else:
-                     raise ValueError, "missing } in unit expression" 
-                 
-               
-                 
-        else:#no power
-            if  pow !=1:
-                unit="("+unit+")"+"^{"+str(pow)+"}"
-    else:
-        raise ValueError, "empty unit ,enter a power different from zero"
-    return unit
-if __name__ == "__main__": 
-    print "this unit1 %s ,its power %s , and value %s"%(unit1,1,UnitConvertion(1,unit1))
-    print "this unit2 %s ,its power %s , and value %s"%(unit2,1,UnitConvertion(1,unit2))
-    print "this unit3 %s ,its power %s , and value %s"%(unit3,2,UnitConvertion(2,unit3))
-    print "this unit4 %s ,its power %s , and value %s"%(unit4,-1,UnitConvertion(-1,unit4))
-    print "this unit5 %s ,its power %s , and value %s"%(unit5,2,UnitConvertion(2,unit5))
-    print "this unit6 %s ,its power %s , and value %s"%(unit6,2,UnitConvertion(2,unit6))
-    print "this unit7 %s ,its power %s , and value %s"%(unit7,-1,UnitConvertion(-1,unit7))
-    print "this unit8 %s ,its power %s , and value %s"%(unit8,2,UnitConvertion(2,unit8))
-    print "this unit9 %s ,its power %s , and value %s"%(unit9,2,UnitConvertion(2,unit9))
-    
