- Timestamp:
- Oct 17, 2008 1:37:28 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:
- f2f3814
- Parents:
- caa1226
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage2D.py
rcaa1226 re1a310f 88 88 self.sizer4.Add(self.text4_1,(iy, ix),(1,1),\ 89 89 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 90 self.text4_1.Hide()90 #self.text4_1.Hide() 91 91 ix += 2 92 92 self.text4_2 = wx.StaticText(self, -1, 'Max') 93 93 self.sizer4.Add(self.text4_2,(iy, ix),(1,1),\ 94 94 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 95 self.text4_2.Hide()95 #self.text4_2.Hide() 96 96 ix = 0 97 97 iy += 1 … … 100 100 self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\ 101 101 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 102 self.text4_3.Hide()102 #self.text4_3.Hide() 103 103 ix += 1 104 104 self.xmin = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) … … 107 107 self.xmin.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 108 108 self.xmin.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 109 self.xmin.Hide()109 110 110 ix += 2 111 111 self.xmax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) … … 114 114 self.xmax.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 115 115 self.xmax.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 116 self.xmax.Hide() 116 117 iy +=1 118 ix = 1 119 self.ymin = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 120 self.ymin.SetToolTipString("Minimun value of y in linear scale.") 121 self.sizer4.Add(self.ymin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 122 self.ymin.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 123 self.ymin.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 124 125 ix += 2 126 self.ymax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 127 self.ymax.SetToolTipString("Maximum value of y in linear scale.") 128 self.sizer4.Add(self.ymax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 129 self.ymax.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 130 self.ymax.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 131 117 132 #Set chisqr result into TextCtrl 118 133 ix = 0 … … 208 223 res.append( (self.data.image[i][i]- fn([self.data.x_bins[i],self.data.y_bins[i]]))\ 209 224 /self.data.err_image[i][i] ) 210 211 225 else: 212 #idx = (x>=self.qmin) & (x <= self.qmax)213 #fx = numpy.asarray([fn(item)for item in x[idx ]])214 #return (y[idx] - fx)/dy[idx]215 226 for i in range(len(self.data.x_bins)): 216 227 res.append( (self.data.image[i][i]- fn([self.data.x_bins[i],self.data.y_bins[i]]))\ 217 228 /self.data.err_image[i][i] ) 218 219 220 229 sum=0 221 230 for item in res: … … 230 239 def onFit(self,event): 231 240 """ signal for fitting""" 232 233 241 flag=self.checkFitRange() 234 242 self.set_manager(self.manager) … … 240 248 self.manager._on_single_fit(qmin=qmin,qmax=qmax) 241 249 else: 242 250 wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\ 243 251 "Select at least on parameter to fit ")) 244 252 def populate_box(self, dict): … … 337 345 """ 338 346 339 if self.prev_group_id !=dataset.group_id:340 self._DataNameEnter()347 #if self.prev_group_id !=dataset.group_id: 348 # self._DataNameEnter() 341 349 self.data = dataset 342 350 self.prev_group_id=dataset.group_id 343 351 #Displaying Data information 344 352 self.DataSource.SetValue(str(dataset.name)) 345 self._xaxis,self._xunit=dataset.get_xaxis() 346 self.text4_3.SetLabel(self._xaxis+"["+self._xunit+"]") 353 self.text4_3.SetLabel(self.data._xaxis+"["+self.data._xunit+"]") 347 354 self.text4_1.Show() 348 355 self.text4_2.Show() 349 356 self.text4_3.Show() 350 357 351 self.xmin.SetValue(format_number( numpy.min(dataset.image)))352 self.xm in.Show()353 self. xmax.SetValue(format_number(numpy.max(dataset.image)))354 self. xmax.Show()358 self.xmin.SetValue(format_number(dataset.xmin)) 359 self.xmax.SetValue(format_number(dataset.xmax)) 360 self.ymin.SetValue(format_number(dataset.ymin)) 361 self.ymax.SetValue(format_number(dataset.ymax)) 355 362 if ((len(self.param_toFit ) >0) and self.DataSource.GetValue()and \ 356 363 self.modelbox.GetValue() and (self.model_hasChanged ==False)): 357 364 self.xmin.Enable() 358 365 self.xmax.Enable() 366 self.ymin.Enable() 367 self.ymax.Enable() 359 368 else: 360 369 self.xmin.Disable() 361 370 self.xmax.Disable() 371 self.ymin.Disable() 372 self.ymax.Disable() 362 373 363 374 self.vbox.Layout() … … 476 487 self.xmin.Disable() 477 488 self.xmax.Disable() 489 self.ymin.Disable() 490 self.ymax.Disable() 478 491 else: 479 492 self.xmin.Enable() 480 493 self.xmax.Enable() 494 self.ymin.Enable() 495 self.ymax.Enable() 481 496 else: 482 497 self.xmin.Disable() 483 498 self.xmax.Disable() 499 self.ymin.Disable() 500 self.ymax.Disable() 484 501 self.compute_chisqr() 485 502 self.vbox.Layout() … … 527 544 self.xmin.Disable() 528 545 self.xmax.Disable() 546 self.ymin.Disable() 547 self.ymax.Disable() 529 548 else: 530 549 self.xmin.Enable() 531 550 self.xmax.Enable() 551 self.ymin.Enable() 552 self.ymax.Enable() 532 553 else: 533 554 for item in self.parameters: … … 537 558 self.xmin.Disable() 538 559 self.xmax.Disable() 560 self.ymin.Disable() 561 self.ymax.Disable() 539 562 540 563 … … 560 583 self.xmin.Disable() 561 584 self.xmax.Disable() 585 self.ymin.Disable() 586 self.ymax.Disable() 562 587 else: 563 588 self.xmin.Enable() 564 589 self.xmax.Enable() 590 self.ymin.Enable() 591 self.ymax.Enable() 565 592 else: 566 593 self.xmin.Disable() 567 594 self.xmax.Disable() 595 self.ymin.Disable() 596 self.ymax.Disable() 568 597 569 598 -
sansview/perspectives/fitting/fitting.py
rcaa1226 re1a310f 14 14 15 15 import models 16 import fitpage1D 16 import fitpage1D,fitpage2D 17 17 import park 18 18 … … 65 65 self.fit_panel.set_model_list(self.menu_mng.get_model_list()) 66 66 owner.Bind(fitpage1D.EVT_MODEL_BOX,self._on_model_panel) 67 owner.Bind(fitpage2D.EVT_MODEL_BOX,self._on_model_panel) 67 68 #create menubar items 68 69 return [(id, self.menu1, "Fitting"),(id2, menu2, "Model")] … … 426 427 react to model selection on any combo box or model menu.plot the model 427 428 """ 428 429 429 430 model = evt.model 430 431 name = evt.name
Note: See TracChangeset
for help on using the changeset viewer.