Changeset ad6dd4c in sasview for sansview/perspectives/fitting/fitpage.py
- Timestamp:
- Apr 24, 2009 2:40:05 PM (15 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:
- da26c1a
- Parents:
- 4bd557d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
r813334e rad6dd4c 68 68 if len(self.parameters)==0: 69 69 return 70 if event.type =="park": 71 self.btFit.SetLabel("Fit") 70 72 for item in self.parameters: 71 73 if event.type =="scipy": … … 454 456 Allow to fit 455 457 """ 456 #self.btFit.SetLabel("Stop")457 458 from sans.guiframe.utils import check_value 458 459 flag = check_value( self.qmin, self.qmax) … … 469 470 470 471 # Remove or do not allow fitting on the Q=0 point, especially when y(q=0)=None at x[0]. 471 #ToDo: Fix this. 472 #if float(self.qmin.GetValue())==0.0 and self.data.x[0]==0 and not numpy.isfinite(self.data.y[0]): 473 # self.qmin_x = min(self.data.x[self.data.x!=0]) 474 #else: 472 #ToDo: Fix this. 475 473 self.qmin_x = float(self.qmin.GetValue()) 476 477 474 self.qmax_x =float( self.qmax.GetValue()) 478 475 self.manager._reset_schedule_problem( value=0) 479 476 self.manager.schedule_for_fit( value=1,page=self,fitproblem =None) 480 477 self.manager.set_fit_range(page= self,qmin= self.qmin_x, qmax= self.qmax_x) 478 481 479 #single fit 482 480 self.manager.onFit() 481 ## allow stopping the fit 482 if self.engine_type=="scipy": 483 self.btFit.SetLabel("Stop") 484 self.btFit.Unbind(event=wx.EVT_BUTTON, id= self.btFit.GetId()) 485 self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._StopFit, id=self.btFit.GetId()) 486 else: 487 self.btFit.SetLabel("Fit") 488 self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._onFit, id=self.btFit.GetId()) 483 489 self.btFit.SetFocus() 484 490 self.sizer5.Layout() 485 491 self.SetScrollbars(20,20,55,40) 486 492 487 493 def _StopFit(self, event): 494 """ 495 Stop fit 496 """ 497 self.btFit.SetLabel("Fit") 498 if self.engine_type=="scipy": 499 self.manager.stop_fit() 500 self.btFit.Unbind(event=wx.EVT_BUTTON, id=self.btFit.GetId()) 501 self.btFit.Bind(event=wx.EVT_BUTTON, handler=self._onFit,id=self.btFit.GetId()) 502 else: 503 self.btFit.Unbind(event=wx.EVT_BUTTON, id=self.btFit.GetId()) 504 self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._onFit, id=self.btFit.GetId()) 505 self.btFit.SetFocus() 506 self.sizer5.Layout() 507 self.SetScrollbars(20,20,55,40) 508 488 509 def _on_select_model(self, event): 489 510 """ … … 619 640 except: 620 641 pass 621 if cov[0]==None :642 if cov[0]==None or not numpy.isfinite(cov[0]): 622 643 self.param_toFit[0][3].Hide() 623 644 self.param_toFit[0][4].Clear() … … 658 679 break 659 680 ## unable to compare cov[j]==numpy.nan so switch to None 660 if cov[j]==None :681 if cov[j]==None or not numpy.isfinite(cov[j]): 661 682 item[3].Hide() 662 683 item[4].Refresh()
Note: See TracChangeset
for help on using the changeset viewer.