Changeset 52611f5 in sasview for sansview


Ignore:
Timestamp:
Apr 27, 2009 2:19:11 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:
43d00c4
Parents:
15ff344
Message:

singular point handler for compute chisqr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/gui_thread.py

    r15ff344 r52611f5  
    5252        """ 
    5353        self.starttime = time.time() 
     54        
    5455        x,y = [numpy.asarray(v) for v in (self.x,self.y)] 
    5556        if self.dy==None or self.dy==[]: 
    5657            self.dy= numpy.zeros(len(self.y)) 
    5758        self.dy[self.dy==0]=1 
     59        
    5860        if self.qmin==None: 
    59             self.qmin= min(self.x) 
     61            if min (self.x) ==0.0 and self.x[0]==0 and not numpy.isfinite(self.y[0]): 
     62                self.qmin = min(self.x[sel.x!=0]) 
     63            else: 
     64                self.qmin= min(self.x) 
    6065         
    6166        if self.qmax==None: 
     
    7176                
    7277                # Check whether we need to bail out 
    73                 self.isquit()    
     78                self.isquit()   
     79                
    7480                fx[i_x]=self.model.run(self.x[i_x]) 
    7581                 
    7682            if self.smearer!=None: 
    7783                fx= self.smearer(fx) 
     84                 
    7885            for i_y in range(len(fx)): 
    7986                # Check whether we need to bail out 
    8087                self.isquit()    
     88                
    8189                temp=(self.y[i_y] - fx[i_y])/self.dy[i_y] 
    8290                res.append(temp*temp) 
    83              
    84              
    8591            #sum of residuals 
    8692            sum=0 
Note: See TracChangeset for help on using the changeset viewer.