Changeset f79b054 in sasview for guitools


Ignore:
Timestamp:
Apr 1, 2008 3:24:24 PM (17 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e2914b1
Parents:
52b1f77
Message:

some changes that will certainly break the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guitools/plottables.py

    r52b1f77 rf79b054  
    401401            """ 
    402402            import copy 
     403            import numpy 
    403404            # Sanity check 
    404405            if dx and not len(x)==len(dx): 
    405406                raise ValueError, "Plottable.View: Given x and dx are not of the same length" 
    406407             
    407             self.x  = copy.deepcopy(x) 
    408             self.dx = copy.deepcopy(dx) 
     408             
     409            self.x = numpy.zeros(len(x)) 
     410            self.dx = numpy.zeros(len(x)) 
    409411             
    410412            for i in range(len(x)): 
    411413                 self.x[i] = func(x[i]) 
    412             for i in range(len(dx)): 
    413                  self.dx[i] = errfunc(dx[i]) 
     414                 self.dx[i] = errfunc(x[i], dx[i]) 
    414415                           
    415416        def transform_y(self, func, errfunc, y, dy): 
     
    427428                raise ValueError, "Plottable.View: Given y and dy are not of the same length" 
    428429             
    429             self.y  = copy.deepcopy(y) 
    430             self.dy = copy.deepcopy(dy) 
    431              
     430            self.y = numpy.zeros(len(y)) 
     431            self.dy = numpy.zeros(len(y)) 
     432            
    432433            for i in range(len(y)): 
    433434                 self.y[i] = func(y[i]) 
    434             for i in range(len(dy)): 
    435                  self.dy[i] = errfunc(dy[i]) 
     435                 self.dy[i] = errfunc(y[i], dy[i]) 
    436436      
    437437class Data1D(Plottable): 
     
    457457    def render(self,plot,**kw): 
    458458        plot.points(self.view.x,self.view.y,dx=self.view.dx,dy=self.view.dy,**kw) 
     459        #plot.points(self.x,self.y,dx=self.dx,dy=self.dy,**kw) 
    459460    
    460461    def changed(self): 
Note: See TracChangeset for help on using the changeset viewer.