Changeset eb62193 in sasview


Ignore:
Timestamp:
Dec 18, 2009 12:47:53 PM (15 years ago)
Author:
Jae Cho <jhjcho@…>
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:
c8c4fa1
Parents:
db27a2c
Message:

correction of sigmas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Invariant/invariant.py

    rdb27a2c reb62193  
    128128 
    129129        # Compute theory data f(x) 
    130         fx = self.data.y[self.idx_unsmeared ]/sigma2 
     130        fx = self.data.y[self.idx_unsmeared ]/sigma 
    131131        ## Smear theory data 
    132132        if self.smearer is not None: 
     
    135135        ##power is given only for function = power_law     
    136136        if power != None: 
    137             a = -math.fabs(power) 
    138             b = (numpy.sum(fx) - a*numpy.sum(self.data.x[self.idx]/sigma2))/numpy.sum(numpy.ones(len(sigma2))/sigma2) 
     137            a = -(power) 
     138            b = (numpy.sum(fx/sigma) - a*numpy.sum(self.data.x[self.idx]/sigma2))/numpy.sum(numpy.ones(len(sigma2))/sigma2) 
    139139            return a, b 
    140140        else: 
    141             A = numpy.vstack([ self.data.x[self.idx]/sigma2, 
    142                                numpy.ones(len(self.data.x[self.idx]))/sigma2]).T 
     141            A = numpy.vstack([ self.data.x[self.idx]/sigma, 
     142                               numpy.ones(len(self.data.x[self.idx]))/sigma]).T 
    143143     
    144144            a, b = numpy.linalg.lstsq(A, fx)[0] 
Note: See TracChangeset for help on using the changeset viewer.