Changeset 94999eb in sasview
- Timestamp:
- Feb 3, 2009 12:26:15 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:
- 0690e1d
- Parents:
- 6b44403
- Location:
- sansview/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage1D.py
r6b44403 r94999eb 137 137 #------------------ sizer 4 draw------------------------ 138 138 self.modelbox = wx.ComboBox(self, -1) 139 139 self.tcChi = wx.StaticText(self, -1, str(0), style=wx.ALIGN_LEFT) 140 self.tcChi.Hide() 141 self.text1_1 = wx.StaticText(self, -1, 'Chi2/dof', style=wx.ALIGN_LEFT) 142 self.text1_1.Hide() 140 143 #filling sizer2 141 144 ix = 0 … … 145 148 ix += 1 146 149 self.sizer4.Add(self.modelbox,(iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 147 150 ix += 1 151 self.sizer4.Add(self.text1_1,(iy,ix),(1,1),\ 152 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 153 ix += 1 154 self.sizer4.Add(self.tcChi,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 148 155 #----------sizer6------------------------------------------------- 149 156 self.disable_disp = wx.RadioButton(self, -1, 'No', (10, 10), style=wx.RB_GROUP) … … 165 172 166 173 #---------sizer 9 draw---------------------------------------- 167 self.tcChi = wx.StaticText(self, -1, str(0), style=wx.ALIGN_LEFT) 168 self.tcChi.Hide() 169 self.text1_1 = wx.StaticText(self, -1, 'Chi2/dof', style=wx.ALIGN_LEFT) 170 self.text1_1.Hide() 174 171 175 172 176 id = wx.NewId() … … 235 239 ix += 1 236 240 self.sizer9.Add(self.npts,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 237 ix = 0 238 iy += 1 239 self.sizer9.Add(self.text1_1,(iy,ix),(1,1),\ 240 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 241 ix += 1 242 self.sizer9.Add(self.tcChi,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 243 ix +=2 241 242 ix += 1 244 243 self.sizer9.Add(self.btFit,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 245 244 ix =0 … … 322 321 323 322 flag=self.checkFitRange() 323 print "flag", flag 324 324 if flag== True: 325 325 try: … … 330 330 self.qmin_x = float(self.qmin.GetValue()) 331 331 self.qmax_x = float(self.qmax.GetValue()) 332 print "self.qmin_x, self.qmax_x",self.qmin_x,self.qmax_x 332 333 x,y,dy = [numpy.asarray(v) for v in (self.data.x,self.data.y,self.data.dy)] 333 334 if self.qmin_x==None and self.qmax_x==None: … … 338 339 fx = numpy.asarray([self.model.run(item)for item in x[idx ]]) 339 340 res= (y[idx] - fx)/dy[idx] 340 341 341 342 342 sum=0 … … 372 372 evt = ModelEventbox(model=self.model,name=name) 373 373 wx.PostEvent(self.event_owner, evt) 374 #self.model= item()375 #self.set_panel(self.model)374 self.text1_1.Show() 375 self.tcChi.Show() 376 376 except: 377 377 raise #ValueError,"model.name is not equal to model class name" … … 583 583 set to true or false all checkBox given the main checkbox value cb1 584 584 """ 585 self.param_toFit=[] 586 if self.parameters !=[]: 587 if self.cb1.GetValue()==True: 588 for item in self.parameters: 589 item[0].SetValue(True) 590 list= [item[0],item[1],item[2],item[3]] 591 self.param_toFit.append(list ) 592 if len(self.fittable_param)>0: 593 for item in self.fittable_param: 594 item[0].SetValue(True) 595 list= [item[0],item[1],item[2],item[3]] 596 self.param_toFit.append(list ) 597 598 if not (len(self.param_toFit ) >0): 599 self.qmin.Disable() 600 self.qmax.Disable() 601 else: 602 self.qmin.Enable() 603 self.qmax.Enable() 604 else: 605 for item in self.parameters: 606 item[0].SetValue(False) 607 for item in self.fittable_param: 608 item[0].SetValue(False) 609 self.param_toFit=[] 610 611 self.qmin.Disable() 612 self.qmax.Disable() 585 self.select_all_param_helper() 613 586 614 587 -
sansview/perspectives/fitting/fitpanel.py
r6b44403 r94999eb 23 23 def __init__(self, parent, *args, **kwargs): 24 24 25 wx.aui.AuiNotebook.__init__(self,parent,-1, style=wx.aui.AUI_NB_SCROLL_BUTTONS ) 25 #wx.aui.AuiNotebook.__init__(self,parent,-1, style=wx.aui.AUI_NB_SCROLL_BUTTONS ) 26 wx.aui.AuiNotebook.__init__(self,parent,-1, style=wx.aui.AUI_NB_DEFAULT_STYLE ) 27 26 28 27 29 self.manager=None … … 31 33 pageClosedEvent = wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE 32 34 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.onClosePage) 33 34 #Creating an initial page for simultaneous fitting 35 #Creating the default page --welcomed page 36 from sans.guiframe.welcome_panel import PanelAbout 37 self.about_page = PanelAbout(self, -1) 38 self.AddPage(self.about_page,"welcome!") 39 #self.about_page.Disable() 40 #Creating a page for simultaneous fitting 35 41 from simfitpage import SimultaneousFitPage 36 42 self.sim_page = SimultaneousFitPage(self, -1) 37 43 self.AddPage(self.sim_page,"Simultaneous Fit") 44 38 45 39 46 … … 105 112 else: 106 113 """ 114 #self.about_page.Disable() 107 115 from fitpage1D import FitPage1D 108 116 panel = FitPage1D(self,data, -1) -
sansview/perspectives/fitting/fitting.py
r26bf293 r94999eb 231 231 @note: expecting park used for fit. 232 232 """ 233 sim_page=self.fit_panel.get_page( 0)233 sim_page=self.fit_panel.get_page(1) 234 234 for page, value in self.page_finder.iteritems(): 235 235 if page != sim_page: … … 517 517 name = evt.name 518 518 519 sim_page=self.fit_panel.GetPage( 0)519 sim_page=self.fit_panel.GetPage(1) 520 520 current_pg = self.fit_panel.get_current_page() 521 521 if current_pg != sim_page: … … 639 639 for j in range(len(data.x_bins)): 640 640 if data.x_bins[i]>= qmin and data.x_bins[i]<= qmax: 641 theory.data[ j][i]=model.runXY([data.x_bins[j],data.y_bins[i]])641 theory.data[i][j]=model.runXY([data.x_bins[j],data.y_bins[i]]) 642 642 643 643 #print "fitting : plot_helper:", theory.image -
sansview/perspectives/fitting/modelpage.py
r6b44403 r94999eb 264 264 return 265 265 else: 266 if self.data !=None: # allow to recognize data panel from model panel 267 self.cb1.SetValue(False) 268 self.select_all_param_helper() 266 269 self.fittable_param=[] 267 270 self.fixed_param=[] … … 274 277 self.parent.GetSizer().Layout() 275 278 else: 279 if self.data !=None: 280 if self.cb1.GetValue(): 281 self.select_all_param_helper() 276 282 self.fittable_param=[] 277 283 self.fixed_param=[] … … 448 454 """ 449 455 print "set_panel", model 456 450 457 self.sizer5.Clear(True) 451 458 self.parameters = [] … … 615 622 self.sizer8.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 616 623 ctl2.Hide() 617 self.fittable_param =[cb,ctl1,text2,ctl2]624 self.fittable_param.append([cb,ctl1,text2,ctl2]) 618 625 619 626 … … 725 732 def select_all_param(self,event): 726 733 pass 727 728 734 def select_all_param_helper(self): 735 """ 736 Allows selecting or delecting button 737 """ 738 self.param_toFit=[] 739 if self.parameters !=[]: 740 if self.cb1.GetValue()==True: 741 for item in self.parameters: 742 item[0].SetValue(True) 743 list= [item[0],item[1],item[2],item[3]] 744 self.param_toFit.append(list ) 745 if len(self.fittable_param)>0: 746 for item in self.fittable_param: 747 item[0].SetValue(True) 748 list= [item[0],item[1],item[2],item[3]] 749 self.param_toFit.append(list ) 750 751 if not (len(self.param_toFit ) >0): 752 self.qmin.Disable() 753 self.qmax.Disable() 754 else: 755 self.qmin.Enable() 756 self.qmax.Enable() 757 else: 758 for item in self.parameters: 759 item[0].SetValue(False) 760 for item in self.fittable_param: 761 item[0].SetValue(False) 762 self.param_toFit=[] 763 764 self.qmin.Disable() 765 self.qmax.Disable() 766
Note: See TracChangeset
for help on using the changeset viewer.