Index: guitools/LineModel.py
===================================================================
--- guitools/LineModel.py	(revision 6cfe7031360bc5d65e5f82097116559ef04e5349)
+++ guitools/LineModel.py	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
@@ -30,6 +30,6 @@
         ## Define parameters
         self.params = {}
-        self.params['A'] = 10.0
-        self.params['B'] = 10.0
+        self.params['A'] = 1.0
+        self.params['B'] = 1.0
 
         ## Parameter details [units, min, max]
Index: guitools/PlotPanel.py
===================================================================
--- guitools/PlotPanel.py	(revision bceddd673febacbcce892402f91abddc6999b581)
+++ guitools/PlotPanel.py	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
@@ -8,4 +8,5 @@
 import os
 import fittings
+import transform
 from canvas import FigureCanvas
 #TODO: make the plottables interactive
@@ -59,5 +60,5 @@
         #User scale
         self.xscales ="x"
-        self.yscales ="Log(y)"
+        self.yscales ="log10(y)"
         # keep track if the previous transformation of x and y in Property dialog
         self.prevXtrans =" "
@@ -101,93 +102,5 @@
             self._onEVT_FUNC_PROPERTY()
         dial.Destroy()
-            
-    def toX(self,x,y=None):
-        """
-            This function is used to load value on Plottable.View
-            @param x: Float value
-            @return x,
-        """
-        return x
-    
-    def toX2(self,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(self,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(self,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(self,x,y=None):
-        if x !=0:
-            return 1/x
-        else:
-            raise ValueError,"cannot divide by zero"
-    def toOneOverSqrtX(self,x=None,y=None):
-        if y!=None:
-            if y > 0:
-                return 1/math.sqrt(y)
-            else:
-                raise ValueError,"cannot be computed"
-        if x!= None:
-            if x > 0:
-                return 1/math.sqrt(x)
-            else:
-                raise ValueError,"cannot be computed"
-        
-    def toLogYX2(self,x,y):
-        if y*(x**2) >0:
-            return math.log(y*(x**2))
-        else:
-             raise ValueError,"cannot be computed"
-         
-         
-    def toYX2(self,x,y):
-        return (x**2)*y
-    
-    
-    def toXY(self,x,y):
-        return x*y
-    
-    
-    def toLogXY(self,x,y):
-        """
-            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 fromLogXY(self,x):
-        """
-            This function is used to load value on Plottable.View
-            Calculate e^(x)
-            @param x: float value
-        """
-        return math.exp(x*y)
-    
+  
     def set_yscale(self, scale='linear'):
         """
@@ -412,5 +325,5 @@
         for item in list:
             if ( self.xscales=="x" ):
-                item.transform_x(  self.toX, self.errToX )
+                item.transform_x( transform.toX,transform.errToX )
                 self.set_xscale("linear")
                 name, units = item.get_xaxis()
@@ -418,23 +331,29 @@
                 
             if ( self.xscales=="x^(2)" ):
-                item.transform_x(  self.toX2, self.errToX2 )
+                item.transform_x( transform.toX2,transform.errToX2 )
                 self.set_xscale('linear')
                 name, units = item.get_xaxis()
                 self.graph.xaxis("%s^{2}" % name,  "%s^{-2}" % units)
                 
-            if (self.xscales=="Log(x)" ):
-                item.transform_x(  self.toX, self.errToLogX )
+            if (self.xscales=="log10(x)" ):
+                item.transform_x( transform.toX, transform.errToLogX )
                 self.set_xscale("log")
                 name, units = item.get_xaxis()
                 self.graph.xaxis("%s" % name,  "%s^{-1}" % units)
                 
+            if ( self.yscales=="ln(y)" ):
+                item.transform_y( transform.toLogX, transform.errToLogX )
+                self.set_yscale("linear")
+                name, units = item.get_yaxis()
+                self.graph.yaxis("%s" % name,  "%s^{-1}" % units)
+                
             if ( self.yscales=="y" ):
-                item.transform_y(  self.toX, self.errToX )
+                item.transform_y( transform.toX, transform.errToX )
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("%s" % name,  "%s^{-1}" % units)
                 
-            if ( self.yscales=="Log(y)" ): 
-                item.transform_y(  self.toX, self.errToLogX)
+            if ( self.yscales=="log10(y)" ): 
+                item.transform_y( transform.toX, transform.errToLogX)
                 self.set_yscale("log")  
                 name, units = item.get_yaxis()
@@ -442,31 +361,39 @@
                 
             if ( self.yscales=="y^(2)" ):
-                item.transform_y(  self.toX2, self.errToX2 )    
+                item.transform_y( transform.toX2, transform.errToX2 )    
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("%s^2" % name,  "%s^{-2}" % units)
             if ( self.yscales =="1/y"):
-                item.transform_y( self.toOneOverX ,self.errOneOverX )
+                item.transform_y( transform.toOneOverX , transform.errOneOverX )
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("%s" % name,  "%s" % units)
             if ( self.yscales =="1/sqrt(y)" ):
-                item.transform_y( self.toOneOverSqrtX ,self.errOneOverSqrtX )
+                item.transform_y( transform.toOneOverSqrtX ,transform.errOneOverSqrtX )
                 self.set_yscale("linear")
                 name, units = item.get_yaxis()
                 self.graph.yaxis("%s" %name,  "%s" % units)
                 
-            if ( self.yscales =="Log(y*x)"):
-                item.transform_y( self.toLogXY ,self.errToLogXY )
+            if ( self.yscales =="ln(y*x)"):
+                item.transform_y( transform.toLogXY ,transform.errToLogXY )
                 self.set_yscale("linear")
                 yname, yunits = item.get_yaxis()
                 xname, xunits = item.get_xaxis()
                 self.graph.yaxis("%s%s" % (yname,xname),  "%s^{-1}%s^{-1}" % (yunits,xunits))
-            if ( self.yscales =="Log(y*x^(2)"):
-                item.transform_y( self.toYX2 ,self.errToYX2 )
+                
+            if ( self.yscales =="ln(y*x^(2)"):
+                item.transform_y( transform.toYX2 ,transform.ToYX2 )
                 self.set_yscale("linear")
                 yname, yunits = item.get_yaxis()
                 xname, xunits = item.get_xaxis()
                 self.graph.yaxis("%s%s^{2}" % (yname,xname),  "%s^{-1}%s^{-2}" % (yunits,xunits))
+            
+            if ( self.yscales =="ln(y*x^(4))"):
+                item.transform_y( transform.toLogYX4 ,transform.errToLogYX4 )
+                self.set_yscale("linear")
+                yname, yunits = item.get_yaxis()
+                xname, xunits = item.get_xaxis()
+                self.graph.yaxis("%s%s^{4}" % (yname,xname),  "%s^{-1}%s^{-4}" % (yunits,xunits))
    
         self.prevXtrans = self.xscales 
@@ -475,140 +402,4 @@
         self.graph.render(self)
         self.subplot.figure.canvas.draw_idle()
-        
-    def errToX(self,x,y=None,dx=None,dy=None):
-        """
-            calculate error of x**2
-            @param x: float value
-            @param dx: float value
-        """
-        return dx
-    
-    
-    def errToX2(self,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
-            if math.fabs(err) >= math.fabs(x):
-                err = 0.9*x
-            return math.fabs(err)
-        else:
-            return 0.0
-    def errFromX2(self,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
-            if math.fabs(err) >= math.fabs(x):
-                err = 0.9*x    
-        else:
-            err = 0.9*x
-           
-            return math.fabs(err)
-        
-    def errToLogX(self,x,y=None,dx=None,dy=None):
-        """
-            calculate error of Log(x)
-            @param x: float value
-            @param dx: float value
-        """
-        if math.fabs(dx) >= math.fabs(x):
-            return 0.9*x
-        return dx
-    
-    def errToXY(self, x, y, dx=None, dy=None):
-        if dx==None:
-            dx=0
-        if dy==None:
-            dy=0
-        err =math.sqrt((y*dx)**2 +(x*dy)**2)
-        if err >= math.fabs(x):
-            err =0.9*x
-        return err 
-    
-    def errToYX2(self, 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)
-        if err >= math.fabs(x):
-            err =0.9*x
-        return err 
-        
-    def errToLogXY(self,x,y,dx=None, dy=None):
-        """
-            calculate error of Log(xy)
-        """
-        if (x!=0) and (y!=0):
-            if dx == None:
-                dx = 0
-            if dy == None:
-                dy = 0
-            err = (dx/x)**2 + (dy/y)**2
-            if  math.sqrt(math.fabs(err)) >= math.fabs(x):
-                err= 0.9*x
-        else:
-            raise ValueError, "cannot compute this error"
-       
-        return math.sqrt(math.fabs(err))
-        
-    def errToLogYX2(self,x,y,dx=None, dy=None):
-        """
-            calculate error of Log(yx**2)
-        """
-        if (x > 0) and (y > 0):
-            if (dx == None):
-                dx = 0
-            if (dy == None):
-                dy = 0
-            err = 4*(dx**2)/(x**2) + (dy**2)/(y**2)
-            if math.fabs(err) >= math.fabs(x):
-                err =0.9*x
-        else:
-             raise ValueError, "cannot compute this error"
-         
-        return math.sqrt(math.fabs(err)) 
-            
-    def errOneOverX(self,x,y=None,dx=None, dy=None):
-        """
-             calculate error on 1/x
-        """
-        if (x != 0):
-            if dx ==None:
-                dx= 0
-            err = -(dx)**2/x**2
-        else:
-            raise ValueError,"Cannot compute this error"
-        
-        if math.fabs(err)>= math.fabs(x):
-            err= 0.9*x
-        return math.fabs(err)
-    
-    def errOneOverSqrtX(self,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/2)* dx
-            if math.fabs(err)>= math.fabs(x):
-                err=0.9*x
-        else:
-            raise ValueError, "Cannot compute this error"
-        
-        return math.fabs(err)
-    
-                      
     def onFitDisplay(self, plottable):
         """
@@ -624,7 +415,5 @@
         self.graph.delete(plottable)
       
-        
-     
-        
+    
     
 class NoRepaintCanvas(FigureCanvasWxAgg):
Index: guitools/PropertyDialog.py
===================================================================
--- guitools/PropertyDialog.py	(revision 57896544f08828746f936a04451449e4a91450e1)
+++ guitools/PropertyDialog.py	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
@@ -45,16 +45,19 @@
         self.xvalue.SetValue("x")
         self.xvalue.Insert("x",0)
-        self.xvalue.Insert("Log(x)",1)
-        self.xvalue.Insert("x^(2)",2)
+        self.xvalue.Insert("x^(2)",1)
+        self.xvalue.Insert("log10(x)",2)
+        
         
         # scale value for y
-        self.yvalue.SetValue("Log(y)")
+        self.yvalue.SetValue("log10(y)")
         self.yvalue.Insert("y",0)
-        self.yvalue.Insert("Log(y)",1)
-        self.yvalue.Insert("y^(2)",2)
-        self.yvalue.Insert("1/y",3)
+        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("Log(y*x)",5)
-        self.yvalue.Insert("Log(y*x^(2))",6)
+        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)
         
         panel.SetSizer(sizer)
Index: guitools/fitDialog.py
===================================================================
--- guitools/fitDialog.py	(revision 106ef4d3d20cb9d0ff2268f7d5ed56c295026f45)
+++ guitools/fitDialog.py	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
@@ -7,4 +7,7 @@
 from plottables import Theory1D
 import math,pylab,fittings
+import transform
+
+
 class LinearFit(wx.Dialog):
     #def __init__(self, parent, id, title):
@@ -33,6 +36,8 @@
         self.tcErrB = wx.TextCtrl(panel, -1,size=(120,20),style=wx.SIMPLE_BORDER)
         self.tcChi = wx.TextCtrl(panel, -1,size=(120,20),style=wx.SIMPLE_BORDER)
-        self.tcXmin = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
-        self.tcXmax = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
+        self.FXmin = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
+        self.FXmax = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
+        self.PXmin = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
+        self.PXmax = wx.TextCtrl(panel,-1,size=(120,20),style=wx.SIMPLE_BORDER)
         self.btFit =wx.Button(panel,-1,'Fit',size=(120, 30))
         self.btClose =wx.Button(panel, wx.ID_CANCEL,'Close',size=(90, 30) )
@@ -77,9 +82,21 @@
         sizer.Add(wx.StaticText(panel, -1, 'Xmax'),(iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         iy += 1
-        ix = 1
-        sizer.Add(self.tcXmin, (iy, ix),(1,1),\
+        ix = 0
+        sizer.Add(wx.StaticText(panel, -1, 'Plotted Range'),(iy, ix),(1,1),\
+                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer.Add(self.PXmin, (iy, ix),(1,1),\
                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         ix += 2
-        sizer.Add(self.tcXmax, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        sizer.Add(self.PXmax, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        iy += 1
+        ix = 0
+        sizer.Add(wx.StaticText(panel, -1, 'Fit Range'),(iy, ix),(1,1),\
+                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix += 1
+        sizer.Add(self.FXmin, (iy, ix),(1,1),\
+                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix += 2
+        sizer.Add(self.FXmax, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 1
@@ -112,5 +129,14 @@
         self.tcErrB.SetLabel(str(0.0))
         self.tcChi.SetLabel(str(0.0))
-        
+        if self.plottable.x !=[]:
+            self.mini =min(self.plottable.x)
+            self.maxi =max(self.plottable.x)
+            self.FXmin.SetLabel(str(self.mini))
+            self.FXmax.SetLabel(str(self.maxi))
+            
+            self.PXmin.SetValue(str(self.mini))
+            self.PXmax.SetValue(str(self.maxi))
+            self.PXmin.Disable()
+            self.PXmax.Disable()
        
         
@@ -131,7 +157,6 @@
         
         #Check if the field of Fit Dialog contain values and use the x max and min of the user
-        xmin = self._checkVal(self.tcXmin.GetValue())
-        xmax = self._checkVal(self.tcXmax.GetValue())
-        
+        xmin,xmax = self._checkVal(self.FXmin.GetValue(),self.FXmax.GetValue())
+       
         #store the values of View in x,y, dx,dy
         x,y,dx,dy=self.plottable.returnValuesOfView()
@@ -141,18 +166,21 @@
         # Check if View contains a x array .we online fit when x exits
         # makes transformation for y as a line to fit
-        if x != []:                
-            if (xmin ==None)and (xmax == None):
-                #Display the min and the max of x on fit dialog fields
-                self.tcXmin.SetValue(str(min(x)))
-                self.tcXmax.SetValue(str(max(x)))
-          
-            
+        if x != []: 
+            
+            xminView=self.floatTransform(xmin)
+            xmaxView=self.floatTransform(xmax)
+        
             # Store the transformed values of view x, y,dy in variables  before the fit
-            if  self.ytrans == "Log(y)":
+            if  self.ytrans.lower() == "log10(y)":
                 for y_i in y:
-                    tempy.append(math.log(y_i)) 
+                    tempy.append(math.log10(y_i)) 
             else:
                 tempy = y
-                
+            if  self.xtrans.lower() == "log10(x)":
+                for x_i in x:
+                    tempx.append(math.log10(x_i)) 
+            else:
+                tempx = x
+                   
             for y_i in y:
                 dy = 1/y_i
@@ -161,18 +189,9 @@
                 tempdy.append(dy)
                    
-            
-            if  self.xtrans == "Log(x)":
-                for x_i in x:
-                    tempx.append(math.log(x_i)) 
-            else:
-                tempx = x
-                
             #Find the fitting parameters
-            if (xmin !=None and xmin >= min(tempx) ) and (xmax !=None and xmax <= max(tempx)):   
-                chisqr, out, cov = fittings.sansfit(self.model, 
-                            [self.cstA, self.cstB],tempx, tempy,tempdy,xmin,xmax)
-            else:
-                chisqr, out, cov = fittings.sansfit(self.model, 
-                            [self.cstA, self.cstB],tempx, tempy,tempdy,min(tempx),max(tempx))
+            print "X", tempx
+            print "Y", tempy
+            chisqr, out, cov = fittings.sansfit(self.model, 
+                            [self.cstA, self.cstB],tempx, tempy,tempdy,xminView,xmaxView)
             
             #Check that cov and out are iterable before displaying them
@@ -192,26 +211,52 @@
             self.model.setParam('A', float(cstA))
             self.model.setParam('B', float(cstB))
+            print "this is constant A:",float(cstA)
+            tempx = []
             tempy = []
             y_model = 0.0
-            
-            for j in range(len(x)): 
-                    if (xmin !=None)and (xmax != None):
-                        if (x[j] > xmin and x[j] < xmax):
-                            y_model = self.model.run(x[j])
-                    else:
-                        # x has a default value in case the user doesn't load data
-                        if self.xtrans == "Log(x)":
-                            y_model = self.model.run(math.log(x[j]))
-                        else:
-                            y_model = self.model.run(x[j])
+            # load tempy with the minimum transformation
+           
+            if self.xtrans == "log10(x)":
+                y_model = self.model.run(math.log10(xmin))
+
+            else:
+                y_model = self.model.run(xminView)
+            tempx.append(xmin)
+            
+            if self.ytrans == "log10(y)":
+                tempy.append(math.pow(10,y_model))
+            else:
+                tempy.append(y_model)
+            #Load tempy with the value between xView min and xView max
+            #for j in range(len(x)): 
+            #    if (x[j] > xminView and x[j] < xmaxView):
+            #        if self.xtrans == "log10(x)":
+            #            y_model = self.model.run(math.log10(x[j]))
+            #        else:
+            #            y_model = self.model.run(x[j])
+                        
+                        
+            #        if self.ytrans == "log10(y)":
+            #            tempy.append(math.pow(10,y_model))
+            #        else:
+            #            tempy.append(y_model)
+            #        tempx.append(x[j])
                     
-                    if self.ytrans == "Log(y)":
-                        tempy.append(math.exp(y_model))
-                    else:
-                        tempy.append(y_model)
-                        
+            # load tempy with the maximum transformation
+            if self.xtrans == "log10(x)":
+                y_model = self.model.run(math.log10(xmax))
+               
+            else:
+                y_model = self.model.run(xmaxView)
+            tempx.append(xmax)
+                
+            if self.ytrans == "log10(y)":
+                tempy.append(math.pow(10,y_model))
+            else: 
+                tempy.append(y_model)
             # Create new data plottable with result
-            self.file_data1.x =x 
-            self.file_data1.y =[]  
+            self.file_data1.x =[] 
+            self.file_data1.y =[] 
+            self.file_data1.x =tempx  
             self.file_data1.y =tempy     
             self.file_data1.dx=None
@@ -240,14 +285,42 @@
         return self.file_data1
     
-    def _checkVal(self,value):
-        """
-                Ensure that fields parameter contains a value 
-                before sending to fit in Plotter1D
-        """
-        try:
-            param = float(value)
-        except:
-            param = None
-        return param
+    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.FXmin.SetValue(str(usermin))
+            else:
+                self.FXmin.SetValue(str(self.mini))
+                
+            if float(usermax) > float(self.mini) and float(usermax) <= float(self.maxi):
+                self.FXmax.SetLabel(str(usermax))
+            else:
+                self.FXmax.SetLabel(str(self.maxi))
+                
+            mini =float(self.FXmin.GetValue())
+            maxi =float(self.FXmax.GetValue())
+            
+            return mini, maxi
+    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
+        """
+        if ( self.xtrans=="x" ):
+            return transform.toX(x)
+        
+        if ( self.xtrans=="x^(2)" ):
+            return transform.toX2(x)
+        
+        if (self.xtrans=="log10(x)" ):
+            if x >0:
+                return math.log10(x)
+            else:
+                raise ValueError,"cannot compute log of a negative number"
+       
+                
    
 if __name__ == "__main__": 
Index: guitools/plottables.py
===================================================================
--- guitools/plottables.py	(revision 370e58775fffc6eb0c2cb2c48f24ad522487c681)
+++ guitools/plottables.py	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
@@ -409,6 +409,5 @@
         
         return self.view.returnXview()
-        
-        
+   
     class View:
         """
@@ -524,6 +523,11 @@
         def returnXview(self):
             return self.x,self.y,self.dx,self.dy
-           
-     
+        
+        def returnValueOfView(self,i): 
+            print"this is i:",i
+            if i in range(len(self.x)):
+                print self.x[i]
+                return self.x[i]
+
 class Data1D(Plottable):
     """Data plottable: scatter plot of x,y with errors in x and y.
Index: guitools/requirements.txt
===================================================================
--- guitools/requirements.txt	(revision 5aa3bbd0e51b211cfdb564626fa69ea81ce85fd7)
+++ guitools/requirements.txt	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
@@ -78,14 +78,22 @@
  This is a list the changes Steeve wants :
  
-  1- Add curves : ln(y) in linear scale, ln(x^(4)*I)
-  2- Specify in the fitDialog if natural log or log base 10
+  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- When fitting sphere.txt , logx --logy ,fitting is not correct
+  
   4- 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- 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- Always want to know the initial value of xmin and xmax when opening the fitDialog.These values
+  
+  8-[DONE] 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- the user should be able to add point to fit without knowing the exact range or guessing
   		a range to fit.
@@ -94,3 +102,4 @@
   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
Index: guitools/transform.py
===================================================================
--- guitools/transform.py	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
+++ guitools/transform.py	(revision 831149e3d5d221f9048a09e588830a2ed3c9141c)
@@ -0,0 +1,244 @@
+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 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(x=None,y=None):
+    if y!=None:
+        if y > 0:
+            return 1/math.sqrt(y)
+        else:
+            raise ValueError,"cannot be computed"
+    if x!= None:
+        if x > 0:
+            return 1/math.sqrt(x)
+        else:
+            raise ValueError,"cannot be computed"
+    
+def toLogYX2(x,y):
+    if y*(x**2) >0:
+        return math.log(y*(x**2))
+    else:
+         raise ValueError,"cannot be computed"
+     
+     
+def toYX2(x,y):
+    return (x**2)*y
+
+
+def toXY(x,y):
+    return x*y
+
+def toLogYX4(x, y):
+    if math.pow(x,4)*y > 0:
+        return math.log(math.pow(x,4)*y)
+
+def toLogXY(x,y):
+    """
+        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 errToLogYX4(x,y=None,dx=None,dy=None):
+    """
+        error for ln(y*x^(4))
+        @param x: float value
+    """
+    if dx==None:
+        dx=0
+    if dy==None:
+        dy=0
+    err =math.sqrt((4*dx/x)**2 +(dy/y)**2)
+    if err >= math.fabs(x):
+        err =0.9*x
+    return err 
+def fromLogXY(self,x):
+    """
+        This function is used to load value on Plottable.View
+        Calculate e^(x)
+        @param x: float value
+    """
+    return math.exp(x*y)
+
+         
+        
+def errToX(x,y=None,dx=None,dy=None):
+    """
+        calculate error of x**2
+        @param x: float value
+        @param dx: float value
+    """
+    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
+        if math.fabs(err) >= math.fabs(x):
+            err = 0.9*x
+        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
+        if math.fabs(err) >= math.fabs(x):
+            err = 0.9*x    
+    else:
+        err = 0.9*x
+       
+        return math.fabs(err)
+    
+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
+    if math.fabs(dx) >= math.fabs(x):
+        return 0.9*x
+    return dx
+
+def errToXY(x, y, dx=None, dy=None):
+    if dx==None:
+        dx=0
+    if dy==None:
+        dy=0
+    err =math.sqrt((y*dx)**2 +(x*dy)**2)
+    if err >= math.fabs(x):
+        err =0.9*x
+    return err 
+
+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)
+    if err >= math.fabs(x):
+        err =0.9*x
+    return err 
+    
+def errToLogXY(x,y,dx=None, dy=None):
+    """
+        calculate error of Log(xy)
+    """
+    if (x!=0) and (y!=0):
+        if dx == None:
+            dx = 0
+        if dy == None:
+            dy = 0
+        err = (dx/x)**2 + (dy/y)**2
+        if  math.sqrt(math.fabs(err)) >= math.fabs(x):
+            err= 0.9*x
+    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)
+    """
+    if (x > 0) and (y > 0):
+        if (dx == None):
+            dx = 0
+        if (dy == None):
+            dy = 0
+        err = 4*(dx**2)/(x**2) + (dy**2)/(y**2)
+        if math.fabs(err) >= math.fabs(x):
+            err =0.9*x
+    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)**2/x**2
+    else:
+        raise ValueError,"Cannot compute this error"
+    
+    if math.fabs(err)>= math.fabs(x):
+        err= 0.9*x
+    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/2)* dx
+        if math.fabs(err)>= math.fabs(x):
+            err=0.9*x
+    else:
+        raise ValueError, "Cannot compute this error"
+    
+    return math.fabs(err)
+
+           
