Changeset dc5ef15 in sasview for src/sas/qtgui/Plotting/LinearFit.py
- Timestamp:
- May 18, 2017 3:36:57 AM (7 years ago)
- Branches:
- 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
- Children:
- 6066a3f
- Parents:
- 2a432e7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/LinearFit.py
rcd2cc745 rdc5ef15 7 7 from PyQt4 import QtCore 8 8 9 #from sas.sasgui.transform import10 9 from sas.qtgui.Utilities.GuiUtils import formatNumber 11 from sas.sasgui.plottools import fittings 12 from sas. sasgui.plottools import transform13 14 from sas. sasgui.plottools.LineModel import LineModel10 11 from sas.qtgui.Plotting import Fittings 12 from sas.qtgui.Plotting import DataTransform 13 from sas.qtgui.Plotting.LineModel import LineModel 15 14 16 15 # Local UI … … 67 66 self.default_A = self.model.getParam('A') 68 67 self.default_B = self.model.getParam('B') 69 self.cstA = fittings.Parameter(self.model, 'A', self.default_A)70 self.cstB = fittings.Parameter(self.model, 'B', self.default_B)71 self.transform = transform68 self.cstA = Fittings.Parameter(self.model, 'A', self.default_A) 69 self.cstB = Fittings.Parameter(self.model, 'B', self.default_B) 70 self.transform = DataTransform 72 71 73 72 self.setFixedSize(self.minimumSizeHint()) … … 123 122 124 123 # Find the fitting parameters 125 self.cstA = fittings.Parameter(self.model, 'A', self.default_A)126 self.cstB = fittings.Parameter(self.model, 'B', self.default_B)124 self.cstA = Fittings.Parameter(self.model, 'A', self.default_A) 125 self.cstB = Fittings.Parameter(self.model, 'B', self.default_B) 127 126 tempdy = numpy.asarray(tempdy) 128 127 tempdy[tempdy == 0] = 1 … … 132 131 xmax = numpy.log10(xmax) 133 132 134 chisqr, out, cov = fittings.sasfit(self.model,133 chisqr, out, cov = Fittings.sasfit(self.model, 135 134 [self.cstA, self.cstB], 136 135 tempx, tempy, tempdy, … … 193 192 tempy = [numpy.log10(y[i]) 194 193 for i in range(len(x)) if x[i] >= xmin_check] 195 tempdy = [ transform.errToLogX(y[i], 0, dy[i], 0)194 tempdy = [DataTransform.errToLogX(y[i], 0, dy[i], 0) 196 195 for i in range(len(x)) if x[i] >= xmin_check] 197 196 else: 198 197 tempy = map(numpy.log10, y) 199 tempdy = map(lambda t1,t2: transform.errToLogX(t1,0,t2,0),y,dy)198 tempdy = map(lambda t1,t2:DataTransform.errToLogX(t1,0,t2,0),y,dy) 200 199 else: 201 200 tempy = y
Note: See TracChangeset
for help on using the changeset viewer.