Changeset 813334e in sasview for sansview/perspectives
- Timestamp:
- Apr 23, 2009 5:39:33 PM (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:
- 4bd557d
- Parents:
- e473e4f5
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
re473e4f5 r813334e 45 45 ## draw sizer 46 46 self._fill_datainfo_sizer() 47 print "self.qmin, self.qmax====>",self.qmax_x,self.qmin_x 47 48 self._fill_model_sizer( self.sizer1) 48 49 self._fill_range_sizer() … … 53 54 self.enable_smearer.Disable() 54 55 self.disable_smearer.Disable() 55 #try: 56 ##Calculate chi2 57 # self.compute_chisqr(smearer= temp_smearer) 58 #except: 59 # raise 56 60 57 ## to update the panel according to the fit engine type selected 61 58 self.Bind(EVT_FITTER_TYPE,self._on_engine_change) … … 188 185 if not hasattr(self.data,"data"): #Display only for 1D data fit 189 186 # Minimum value of data 190 #data_min = str(format_number(numpy.min(self.data.x))) 191 data_min = str((numpy.min(self.data.x))) 187 data_min = min(self.data.x) 192 188 # Maximum value of data 193 # data_max = str(format_number(numpy.max(self.data.x))) 194 data_max = str((numpy.max(self.data.x))) 189 data_max = max(self.data.x) 195 190 text4_3 = wx.StaticText(self, -1, 'Total Q Range (1/A)', 196 191 style=wx.ALIGN_LEFT) 197 192 sizer_data.Add( text4_3 ) 198 sizer_data.Add(wx.StaticText(self, -1, "Min : %s"%data_min)) 199 200 sizer_data.Add(wx.StaticText(self, -1, "Max : %s"%data_max)) 193 sizer_data.Add(wx.StaticText(self, -1, "Min : %s"%str(data_min))) 194 sizer_data.Add(wx.StaticText(self, -1, "Max : %s"%str(data_max))) 201 195 202 196 else: 203 radius_min= 0 204 x= numpy.max(self.data.xmin, self.data.xmax) 205 y= numpy.max(self.data.ymin, self.data.ymax) 206 radius_max = math.sqrt(x*x + y*y) 207 197 ## Minimum value of data 198 data_min= 0 199 x= max(math.fabs(self.data.xmin), math.fabs(self.data.xmax)) 200 y= max(math.fabs(self.data.ymin), math.fabs(self.data.ymax)) 201 ## Maximum value of data 202 data_max = math.sqrt(x*x + y*y) 203 208 204 #For qmin and qmax, do not use format_number 209 205 #.(If do, qmin and max could be different from what is in the data.) 210 # Minimum value of data211 data_min = str((radius_min))212 # Maximum value of data213 data_max = str((radius_max))214 206 text4_3 = wx.StaticText(self, -1, "Total Q Range (1/A)", 215 207 style=wx.ALIGN_LEFT) 216 208 sizer_data.Add( text4_3 ) 217 sizer_data.Add(wx.StaticText(self, -1, "Min : %s"%data_min)) 218 sizer_data.Add(wx.StaticText(self, -1, "Max : %s"%data_max)) 219 209 sizer_data.Add(wx.StaticText(self, -1, "Min : %s"%str(data_min))) 210 sizer_data.Add(wx.StaticText(self, -1, "Max : %s"%str(data_max))) 211 ## set q range to plot 212 self.qmin_x= data_min 213 self.qmax_x= data_max 214 220 215 boxsizer1.Add(sizer_data) 221 216 #------------------------------------------------------------ 222 217 self.sizer0.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10) 223 218 self.sizer0.Layout() 224 225 self.qmin_x= data_min 226 self.qmax_x= data_max 219 227 220 228 221 -
sansview/perspectives/fitting/fitting.py
r2b63df0 r813334e 635 635 item.is_data=True 636 636 data.is_data=True 637 637 638 ## create anew page 638 639 if item.name == self.panel.graph.selected_plottable or\ … … 649 650 self.page_finder[page].add_plotted_data(item) 650 651 self.page_finder[page].add_fit_data(data) 651 652 652 653 wx.PostEvent(self.parent, StatusEvent(status="Page Created")) 653 654 else: -
sansview/perspectives/fitting/model_thread.py
rfb8daaaf r813334e 106 106 Compute the data given a model function 107 107 """ 108 x = self.x 109 y = self.y 110 output = numpy.zeros((len(x),len(y))) 108 109 output = numpy.zeros((len(self.x),len(self.y))) 111 110 if self.qmin==None: 112 111 self.qmin = 0 … … 116 115 newy= math.pow(max(math.fabs(self.data.ymax),math.fabs(self.data.ymin)),2) 117 116 self.qmax=math.sqrt( newx + newy ) 118 else: 119 self.qmax= max(self.x) 120 117 118 121 119 self.starttime = time.time() 122 120 lx = len(self.x)
Note: See TracChangeset
for help on using the changeset viewer.