Changeset eb62193 in sasview
- Timestamp:
- Dec 18, 2009 12:47:53 PM (15 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Invariant/invariant.py
rdb27a2c reb62193 128 128 129 129 # Compute theory data f(x) 130 fx = self.data.y[self.idx_unsmeared ]/sigma 2130 fx = self.data.y[self.idx_unsmeared ]/sigma 131 131 ## Smear theory data 132 132 if self.smearer is not None: … … 135 135 ##power is given only for function = power_law 136 136 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) 139 139 return a, b 140 140 else: 141 A = numpy.vstack([ self.data.x[self.idx]/sigma 2,142 numpy.ones(len(self.data.x[self.idx]))/sigma 2]).T141 A = numpy.vstack([ self.data.x[self.idx]/sigma, 142 numpy.ones(len(self.data.x[self.idx]))/sigma]).T 143 143 144 144 a, b = numpy.linalg.lstsq(A, fx)[0]
Note: See TracChangeset
for help on using the changeset viewer.