Changeset b64fa56 in sasview


Ignore:
Timestamp:
Apr 13, 2009 4:04:04 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
b86c920
Parents:
37f487e
Message:

putting 1 to zero value on dy in fitting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • park_integration/AbstractFitEngine.py

    r05f14dd rb64fa56  
    174174        """ 
    175175        return [] 
     176     
     177     
    176178class FitData1D(object): 
    177179    """ Wrapper class  for SANS data """ 
     
    238240            @return residuals 
    239241        """ 
    240         x,y,dy = [numpy.asarray(v) for v in (self.x,self.y,self.dy)] 
    241             
     242        x,y = [numpy.asarray(v) for v in (self.x,self.y)] 
     243        if self.dy ==None or self.dy==[]: 
     244            dy= numpy.zeros(len(y))   
     245        else: 
     246            dy= numpy.asarray(self.dy) 
     247        dy[dy==0]=1 
    242248        idx = (x>=self.qmin) & (x <= self.qmax) 
    243249   
     
    309315        """ 
    310316        res=[] 
     317        if self.err_image== None or self.err_image ==[]: 
     318            self.err_image= numpy.zeros(len(self.x_bins),len(self.y_bins)) 
     319        self.err_image[self.err_image==0]=1 
    311320         
    312321        for i in range(len(self.y_bins)): 
Note: See TracChangeset for help on using the changeset viewer.