Changeset 54c21f50 in sasview


Ignore:
Timestamp:
Apr 16, 2009 2:23:52 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:
a8088d7
Parents:
3370922
Message:

deecopy of error data before computing residual

File:
1 edited

Legend:

Unmodified
Added
Removed
  • park_integration/AbstractFitEngine.py

    rfff74cb r54c21f50  
    11 
    2 import park,numpy,math 
     2import park,numpy,math, copy 
    33 
    44class SansParameter(park.Parameter): 
     
    244244            dy= numpy.zeros(len(y))   
    245245        else: 
    246             dy= numpy.asarray(self.dy) 
     246            dy= copy.deepcopy(self.dy) 
     247            dy= numpy.asarray(dy) 
    247248        dy[dy==0]=1 
    248249        idx = (x>=self.qmin) & (x <= self.qmax) 
     
    316317        res=[] 
    317318        if self.err_image== None or self.err_image ==[]: 
    318             self.err_image= numpy.zeros(len(self.y_bins),len(self.x_bins)) 
    319         self.err_image[self.err_image==0]=1 
    320          
     319            err_image= numpy.zeros(len(self.y_bins),len(self.x_bins)) 
     320        else: 
     321            err_image = copy.deepcopy(self.err_image) 
     322             
     323        err_image[err_image==0]=1 
    321324        for i in range(len(self.x_bins)): 
    322325            for j in range(len(self.y_bins)): 
     
    325328                if self.qmin <= radius and radius <= self.qmax: 
    326329                    res.append( (self.image[j][i]- fn([self.x_bins[i],self.y_bins[j]]))\ 
    327                             /self.err_image[j][i] ) 
     330                            /err_image[j][i] ) 
    328331         
    329332        return numpy.array(res) 
Note: See TracChangeset for help on using the changeset viewer.