Changeset 8e44d51 in sasview for guitools/fitDialog.py
- Timestamp:
- Apr 16, 2008 10:22:24 AM (16 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:
- 35891ce
- Parents:
- 3aa7074
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/fitDialog.py
r3aa7074 r8e44d51 43 43 self.btClose =wx.Button(panel, wx.ID_CANCEL,'Close',size=(90, 30) ) 44 44 self.static_line_1 = wx.StaticLine(panel, -1) 45 45 46 ix = 0 46 47 iy = 1 47 48 48 sizer.Add(wx.StaticText(panel, -1, 'y = Ax +B'),(iy, ix),(1,1),\ 49 49 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 50 51 50 iy+=1 52 51 sizer.Add(wx.StaticText(panel, -1, 'Param A'),(iy, ix),\ … … 58 57 ix += 1 59 58 sizer.Add(self.tcErrA, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 60 61 59 iy += 1 62 60 ix = 0 … … 108 106 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 109 107 110 111 108 panel.SetSizer(sizer) 112 109 self.SetSizer(vbox) 113 110 self.Centre() 111 114 112 # Receives the type of model for the fitting 115 113 from LineModel import LineModel 116 114 self.model = LineModel() 117 118 115 119 116 #Display the fittings values … … 139 136 self.PXmin.Disable() 140 137 self.PXmax.Disable() 141 142 138 143 139 # new data for the fit 144 140 self.file_data1 = Theory1D(x=[], y=[], dy=None) … … 158 154 #Check if the field of Fit Dialog contain values and use the x max and min of the user 159 155 xmin,xmax = self._checkVal(self.FXmin.GetValue(),self.FXmax.GetValue()) 160 161 156 #store the values of View in x,y, dx,dy 162 157 x,y,dx,dy=self.plottable.returnValuesOfView() … … 167 162 # makes transformation for y as a line to fit 168 163 if x != []: 169 170 164 xminView=self.floatTransform(xmin) 171 165 xmaxView=self.floatTransform(xmax) … … 190 184 191 185 #Find the fitting parameters 192 print "X", tempx193 print "Y", tempy194 186 chisqr, out, cov = fittings.sansfit(self.model, 195 187 [self.cstA, self.cstB],tempx, tempy,tempdy,xminView,xmaxView) … … 211 203 self.model.setParam('A', float(cstA)) 212 204 self.model.setParam('B', float(cstB)) 213 print "this is constant A:",float(cstA)205 214 206 tempx = [] 215 207 tempy = [] … … 241 233 else: 242 234 tempy.append(y_model) 243 244 245 print "this max",xmax 246 print "this view xmax", xmaxView 235 247 236 # Create new data plottable with result 248 237 self.file_data1.x =[] … … 252 241 self.file_data1.dx=None 253 242 self.file_data1.dy=None 254 print "this is the min of data1",min(self.file_data1.x )255 print "this is the max of data1",max(self.file_data1.x )256 243 #Load the view with the new values 257 244 self.file_data1.reset_view()
Note: See TracChangeset
for help on using the changeset viewer.