Changeset cfc68540 in sasview for sansview/perspectives/fitting
- Timestamp:
- Jan 18, 2009 10:34:20 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:
- 3f1af74
- Parents:
- c48a26a
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
rc48a26a rcfc68540 17 17 import park 18 18 DEFAULT_BEAM = 0.005 19 DEFAULT_QMIN = 0.0 20 DEFAULT_QMAX = 0.15 21 DEFAULT_NPTS = 40 19 22 import time 20 23 import thread … … 646 649 self.draw_model(model=model,name=name) 647 650 648 def draw_model(self,model,name ,description=None,enable1D=True, enable2D=False,qmin=None, qmax=None,qstep=None): 651 def draw_model(self,model,name ,description=None,enable1D=True, enable2D=False, 652 qmin=DEFAULT_QMIN, qmax=DEFAULT_QMAX, qstep=DEFAULT_NPTS): 649 653 """ 650 654 draw model with default data value 651 655 """ 652 656 653 self.fit_panel.add_model_page(model=model,description=model.description,page_title=name) 657 self.fit_panel.add_model_page(model=model,description=model.description,page_title=name, 658 qmin=qmin, qmax=qmax, npts=qstep) 654 659 self._draw_model2D(model=model, 655 660 description=model.description, … … 659 664 qstep=qstep) 660 665 self._draw_model1D(model,name,model.description, enable1D,qmin,qmax, qstep) 661 662 def _draw_model1D(self,model,name,description=None, enable1D=True,qmin=None,qmax=None, qstep=None): 666 667 def _draw_model1D(self,model,name,description=None, enable1D=True, 668 qmin=DEFAULT_QMIN, qmax=DEFAULT_QMAX, qstep=DEFAULT_NPTS): 663 669 664 670 if enable1D: 665 if qmin==None:666 qmin= 0.001667 if qmax==None:668 qmax= 1.0669 if qstep ==None:670 qstep =100671 672 #print "x in data1D",qmin,qmax673 #x = numpy.arange(qmin, qmax, qstep)674 671 x= numpy.linspace(start= qmin, 675 672 stop= qmax, … … 749 746 750 747 751 def _draw_model2D(self,model,description=None, enable2D=False,qmin=None,qmax=None, qstep=None): 752 if qmin==None: 753 qmin= 0.0 754 if qmax==None: 755 qmax= 0.05 756 if qstep ==None: 757 qstep =100 748 def _draw_model2D(self,model,description=None, enable2D=False, 749 qmin=DEFAULT_QMIN, qmax=DEFAULT_QMAX, qstep=DEFAULT_NPTS): 758 750 759 751 x= numpy.linspace(start= -1*qmax, -
sansview/perspectives/fitting/modelpage.py
rc48a26a rcfc68540 163 163 self.Centre() 164 164 165 def set_range(self, qmin, qmax, npts): 166 """ 167 Set the range for the plotted models 168 @param qmin: minimum Q 169 @param qmax: maximum Q 170 @param npts: number of Q bins 171 """ 172 # Set the data members 173 self.qmin = qmin 174 self.qmax = qmax 175 self.num_points = npts 176 177 # Set the controls 178 self.xmin.SetValue(format_number(self.qmin)) 179 self.xmax.SetValue(format_number(self.qmax)) 180 self.npts.SetValue(format_number(self.num_points)) 165 181 166 182 def onClose(self,event): … … 191 207 if self.enable2D==False: 192 208 self.enable2D=True 193 self.manager.draw_model(model=self.model, 194 name=self.model.name, 195 description=None, 196 enable2D=self.enable2D, 197 qmin=float(self.qmin), 198 qmax=float(self.qmax), 199 qstep= self.num_points) 200 209 self._draw_model() 201 210 202 211 def populate_box(self, dict): … … 234 243 if name ==event.GetString(): 235 244 model=item() 236 #print "fitpage: _on_select_model model name",name ,event.GetString()237 245 self.model= model 238 246 self.set_panel(model) 239 247 print "name in model page", name,event.GetString() 240 248 self.name= name 241 self.manager.draw_model(model, name)242 249 #self.manager.draw_model(model, name) 250 self._draw_model() 243 251 244 252 … … 407 415 408 416 if is_modified: 409 self.manager.draw_model(self.model, self.model.name, 410 qmin=self.qmin, qmax=self.qmax, 411 qstep= self.num_points, 412 enable2D=self.enable2D) 413 414 417 self._draw_model() 418 419 def _draw_model(self): 420 """ 421 Method to draw or refresh a plotted model. 422 The method will use the data member from the model page 423 to build a call to the fitting perspective manager. 424 425 [Note to coder: This way future changes will be done in only one place.] 426 """ 427 self.manager.draw_model(self.model, self.model.name, 428 qmin=self.qmin, qmax=self.qmax, 429 qstep= self.num_points, 430 enable2D=self.enable2D) 431 415 432 416 433
Note: See TracChangeset
for help on using the changeset viewer.