- Timestamp:
- Oct 17, 2008 4:25:40 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:
- d4f7262
- Parents:
- 49815a2
- Location:
- sansview/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage1D.py
rbcd6d51 r9d31a8b 39 39 40 40 41 def __init__(self, parent, *args, **kwargs):41 def __init__(self, parent,data, *args, **kwargs): 42 42 wx.Panel.__init__(self, parent, *args, **kwargs) 43 43 """ … … 55 55 self.DataSource = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 56 56 self.DataSource.SetToolTipString("name of data to fit") 57 self.DataSource.SetValue(str(data.name)) 57 58 self.modelbox = wx.ComboBox(self, -1) 58 59 id = wx.NewId() … … 83 84 ix += 1 84 85 self.sizer3.Add(self.modelbox,(iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 85 ix = 1 86 iy = 1 87 self.text4_1 = wx.StaticText(self, -1, 'Min') 88 self.sizer4.Add(self.text4_1,(iy, ix),(1,1),\ 89 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 90 self.text4_1.Hide() 91 ix += 2 92 self.text4_2 = wx.StaticText(self, -1, 'Max') 93 self.sizer4.Add(self.text4_2,(iy, ix),(1,1),\ 94 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 95 self.text4_2.Hide() 86 96 87 ix = 0 97 88 iy += 1 … … 100 91 self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\ 101 92 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 102 self.text4_3.Hide()93 103 94 ix += 1 95 self.text4_1 = wx.StaticText(self, -1, 'Min') 96 self.sizer4.Add(self.text4_1,(iy, ix),(1,1),\ 97 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 98 99 ix += 2 100 self.text4_2 = wx.StaticText(self, -1, 'Max') 101 self.sizer4.Add(self.text4_2,(iy, ix),(1,1),\ 102 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 103 ix = 0 104 iy += 1 105 self.text4_4 = wx.StaticText(self, -1, 'x range') 106 self.sizer4.Add(self.text4_4,(iy, ix),(1,1),\ 107 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 108 ix += 1 109 104 110 self.xmin = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 111 self.xmin.SetValue(format_number(numpy.min(data.x))) 105 112 self.xmin.SetToolTipString("Minimun value of x in linear scale.") 106 113 self.sizer4.Add(self.xmin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 107 114 self.xmin.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 108 115 self.xmin.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 109 self.xmin.Hide()116 110 117 ix += 2 111 118 self.xmax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 119 self.xmax.SetValue(format_number(numpy.max(data.x))) 112 120 self.xmax.SetToolTipString("Maximum value of x in linear scale.") 113 121 self.sizer4.Add(self.xmax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 114 122 self.xmax.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 115 123 self.xmax.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 116 self.xmax.Hide()124 117 125 #Set chisqr result into TextCtrl 118 126 ix = 0 … … 136 144 # model on which the fit would be performed 137 145 self.model=None 138 # preview selected model name 139 self.prevmodel_name=None 140 # flag to check if the user has selected a new model in the combox box 141 self.model_hasChanged=False 142 146 147 143 148 #dictionary of model name and model class 144 149 self.model_list_box={} 145 # comparison between 2 group_id for checking data changes 146 self.prev_group_id= None 147 148 self.data=None 150 151 self.data=data 149 152 self.vbox.Layout() 153 self.GrandParent.GetSizer().Layout() 150 154 self.vbox.Fit(self) 151 155 self.SetSizer(self.vbox) 152 156 self.Centre() 157 153 158 154 159 … … 168 173 self.manager = manager 169 174 170 171 def _DataNameEnter(self):172 """173 reset the panel when a new data is selected174 """175 if len(self.parameters )>0:176 for item in self.parameters:177 item[0].SetValue(False)178 wx.EVT_CHECKBOX(self, item[0].GetId(), self.select_param)179 item[2].Hide()180 item[3].Clear()181 item[3].Hide()182 self.xmax.Disable()183 self.xmin.Disable()184 self.text1_1.Hide()185 self.tcChi.Clear()186 self.vbox.Layout()187 self.GrandParent.GetSizer().Layout()188 189 190 175 191 176 def onClose(self,event): … … 322 307 return flag 323 308 324 325 326 def set_data_name(self,dataset): 327 """ 328 set data's name.if data has changed reset the panel and xmin and xmax 329 @param name: data 's name 330 @attention: still haven't find a better way to display Q name and unit 331 for xmin and xmax range sizer 332 """ 333 334 if self.prev_group_id !=dataset.group_id: 335 self._DataNameEnter() 336 self.data = dataset 337 self.prev_group_id=dataset.group_id 338 #Displaying Data information 339 self.DataSource.SetValue(str(dataset.name)) 340 self._xaxis,self._xunit=dataset.get_xaxis() 341 self.text4_3.SetLabel(self._xaxis+"["+self._xunit+"]") 342 self.text4_1.Show() 343 self.text4_2.Show() 344 self.text4_3.Show() 345 346 self.xmin.SetValue(format_number(min(dataset.x))) 347 self.xmin.Show() 348 self.xmax.SetValue(format_number(max(dataset.x))) 349 self.xmax.Show() 350 351 if ((len(self.param_toFit ) >0) and self.DataSource.GetValue()and \ 352 self.modelbox.GetValue() and (self.model_hasChanged ==False)): 353 self.xmin.Enable() 354 self.xmax.Enable() 355 else: 356 self.xmin.Disable() 357 self.xmax.Disable() 358 359 self.vbox.Layout() 360 self.GrandParent.GetSizer().Layout() 361 362 363 def set_model_name(self,name): 364 """ 365 set model name. set also self.model_hasChanged to true is the model 366 type has changed or false if it didn't 367 @param name: model 's name 368 """ 369 self.model_hasChanged=False 370 if (name != self.prevmodel_name): 371 self.model_hasChanged=True 372 self.tcChi.Clear() 373 #self.modelbox.SetValue(str(name)) 374 self.prevmodel_name=self.modelbox.GetValue() 375 376 309 377 310 def get_model_box(self): 378 311 """ return reference to combox box self.model""" … … 470 403 self.text2_4.Hide() 471 404 #Disable or enable fit button 472 if (self.modelbox.GetValue() and self.DataSource.GetValue()): 473 if not (len(self.param_toFit ) >0): 474 self.xmin.Disable() 475 self.xmax.Disable() 476 else: 477 self.xmin.Enable() 478 self.xmax.Enable() 479 else: 405 406 if not (len(self.param_toFit ) >0): 480 407 self.xmin.Disable() 481 408 self.xmax.Disable() 482 409 else: 410 self.xmin.Enable() 411 self.xmax.Enable() 412 483 413 self.compute_chisqr() 484 414 self.vbox.Layout() … … 522 452 list= [item[0],item[1],item[2],item[3]] 523 453 self.param_toFit.append(list ) 524 if (self.modelbox.GetValue() and self.DataSource.GetValue()):525 526 527 528 529 530 454 455 if not (len(self.param_toFit ) >0): 456 self.xmin.Disable() 457 self.xmax.Disable() 458 else: 459 self.xmin.Enable() 460 self.xmax.Enable() 531 461 else: 532 462 for item in self.parameters: … … 555 485 else: 556 486 self.cb1.SetValue(False) 557 if (self.modelbox.GetValue() and self.DataSource.GetValue()): 558 if not (len(self.param_toFit ) >0): 559 self.xmin.Disable() 560 self.xmax.Disable() 561 else: 562 self.xmin.Enable() 563 self.xmax.Enable() 564 else: 487 488 if not (len(self.param_toFit ) >0): 565 489 self.xmin.Disable() 566 490 self.xmax.Disable() 491 else: 492 self.xmin.Enable() 493 self.xmax.Enable() 494 567 495 568 496 -
sansview/perspectives/fitting/fitpage2D.py
re1a310f r9d31a8b 39 39 40 40 41 def __init__(self, parent, *args, **kwargs):41 def __init__(self, parent,data, *args, **kwargs): 42 42 wx.Panel.__init__(self, parent, *args, **kwargs) 43 43 """ … … 54 54 self.sizer1 = wx.GridBagSizer(5,5) 55 55 self.DataSource = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 56 self.DataSource.SetValue(str(data.name)) 56 57 self.DataSource.SetToolTipString("name of data to fit") 57 58 self.modelbox = wx.ComboBox(self, -1) … … 83 84 ix += 1 84 85 self.sizer3.Add(self.modelbox,(iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 85 ix = 1 86 87 ix = 0 86 88 iy = 1 89 #set maximum range for x in linear scale 90 self.text4_3 = wx.StaticText(self, -1, 'Maximum Data\n Range (Linear)', style=wx.ALIGN_LEFT) 91 self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\ 92 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 93 ix += 1 87 94 self.text4_1 = wx.StaticText(self, -1, 'Min') 88 95 self.sizer4.Add(self.text4_1,(iy, ix),(1,1),\ … … 94 101 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 95 102 #self.text4_2.Hide() 103 104 #self.text4_3.Hide() 96 105 ix = 0 97 106 iy += 1 98 #set maximum range for x in linear scale 99 self.text4_3 = wx.StaticText(self, -1, 'Maximum Data\n Range (Linear)', style=wx.ALIGN_LEFT) 100 self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\ 101 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 102 #self.text4_3.Hide() 107 self.text4_4 = wx.StaticText(self, -1, 'x range') 108 self.sizer4.Add(self.text4_4,(iy, ix),(1,1),\ 109 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 103 110 ix += 1 104 111 self.xmin = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 112 self.xmin.SetValue(format_number(data.xmin)) 105 113 self.xmin.SetToolTipString("Minimun value of x in linear scale.") 106 114 self.sizer4.Add(self.xmin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 110 118 ix += 2 111 119 self.xmax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 120 self.xmax.SetValue(format_number(data.xmax)) 112 121 self.xmax.SetToolTipString("Maximum value of x in linear scale.") 113 122 self.sizer4.Add(self.xmax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 116 125 117 126 iy +=1 118 ix = 1 127 ix = 0 128 self.text4_5 = wx.StaticText(self, -1, 'y range') 129 self.sizer4.Add(self.text4_5,(iy, ix),(1,1),\ 130 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 131 ix += 1 119 132 self.ymin = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 133 self.ymin.SetValue(format_number(data.ymin)) 120 134 self.ymin.SetToolTipString("Minimun value of y in linear scale.") 121 135 self.sizer4.Add(self.ymin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 125 139 ix += 2 126 140 self.ymax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 141 self.ymax.SetValue(format_number(data.ymax)) 127 142 self.ymax.SetToolTipString("Maximum value of y in linear scale.") 128 143 self.sizer4.Add(self.ymax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 152 167 self.model=None 153 168 # preview selected model name 154 self.prevmodel_name=None 155 # flag to check if the user has selected a new model in the combox box 156 self.model_hasChanged=False 169 157 170 158 171 #dictionary of model name and model class 159 172 self.model_list_box={} 160 # comparison between 2 group_id for checking data changes 161 self.prev_group_id= None 162 163 self.data=None 173 174 self.data = data 164 175 self.vbox.Layout() 165 176 self.vbox.Fit(self) … … 183 194 self.manager = manager 184 195 185 186 def _DataNameEnter(self):187 """188 reset the panel when a new data is selected189 """190 if len(self.parameters )>0:191 for item in self.parameters:192 item[0].SetValue(False)193 wx.EVT_CHECKBOX(self, item[0].GetId(), self.select_param)194 item[2].Hide()195 item[3].Clear()196 item[3].Hide()197 self.xmax.Disable()198 self.xmin.Disable()199 self.text1_1.Hide()200 self.tcChi.Clear()201 self.vbox.Layout()202 self.GrandParent.GetSizer().Layout()203 204 205 196 206 197 def onClose(self,event): … … 214 205 """ 215 206 flag=self.checkFitRange() 207 res=[] 216 208 if flag== True: 217 209 try: 218 qmin = float(self.xmin.GetValue()) 219 qmax = float(self.xmax.GetValue()) 220 res=[] 221 if qmin==None and qmax==None: 222 for i in range(len(self.data.x_bins)): 223 res.append( (self.data.image[i][i]- fn([self.data.x_bins[i],self.data.y_bins[i]]))\ 224 /self.data.err_image[i][i] ) 225 else: 226 for i in range(len(self.data.x_bins)): 227 res.append( (self.data.image[i][i]- fn([self.data.x_bins[i],self.data.y_bins[i]]))\ 228 /self.data.err_image[i][i] ) 210 xmin = float(self.xmin.GetValue()) 211 xmax = float(self.xmax.GetValue()) 212 ymin = float(self.ymin.GetValue()) 213 ymax = float(self.ymax.GetValue()) 214 215 for i in range(len(self.data.y_bins)): 216 if self.data.y_bins[i]>= ymin and self.data.y_bins[i]<= ymax: 217 for j in range(len(self.data.x_bins)): 218 if self.data.x_bins[j]>= xmin and self.data.x_bins[j]<= xmax: 219 res.append( (self.data.image[j][i]- self.model.runXY(\ 220 [self.data.x_bins[j],self.data.y_bins[i]]))\ 221 /self.data.err_image[j][i] ) 229 222 sum=0 223 230 224 for item in res: 231 225 if numpy.isfinite(item): … … 335 329 return flag 336 330 337 338 339 def set_data_name(self,dataset): 340 """ 341 set data's name.if data has changed reset the panel and xmin and xmax 342 @param name: data 's name 343 @attention: still haven't find a better way to display Q name and unit 344 for xmin and xmax range sizer 345 """ 346 347 #if self.prev_group_id !=dataset.group_id: 348 # self._DataNameEnter() 349 self.data = dataset 350 self.prev_group_id=dataset.group_id 351 #Displaying Data information 352 self.DataSource.SetValue(str(dataset.name)) 353 self.text4_3.SetLabel(self.data._xaxis+"["+self.data._xunit+"]") 354 self.text4_1.Show() 355 self.text4_2.Show() 356 self.text4_3.Show() 357 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)) 362 if ((len(self.param_toFit ) >0) and self.DataSource.GetValue()and \ 363 self.modelbox.GetValue() and (self.model_hasChanged ==False)): 364 self.xmin.Enable() 365 self.xmax.Enable() 366 self.ymin.Enable() 367 self.ymax.Enable() 368 else: 369 self.xmin.Disable() 370 self.xmax.Disable() 371 self.ymin.Disable() 372 self.ymax.Disable() 373 374 self.vbox.Layout() 375 self.GrandParent.GetSizer().Layout() 376 377 378 def set_model_name(self,name): 379 """ 380 set model name. set also self.model_hasChanged to true is the model 381 type has changed or false if it didn't 382 @param name: model 's name 383 """ 384 self.model_hasChanged=False 385 if (name != self.prevmodel_name): 386 self.model_hasChanged=True 387 self.tcChi.Clear() 388 #self.modelbox.SetValue(str(name)) 389 self.prevmodel_name=self.modelbox.GetValue() 390 391 331 392 332 def get_model_box(self): 393 333 """ return reference to combox box self.model""" … … 540 480 list= [item[0],item[1],item[2],item[3]] 541 481 self.param_toFit.append(list ) 542 if (self.modelbox.GetValue() and self.DataSource.GetValue()):543 544 545 546 547 548 549 550 551 552 482 483 if not (len(self.param_toFit ) >0): 484 self.xmin.Disable() 485 self.xmax.Disable() 486 self.ymin.Disable() 487 self.ymax.Disable() 488 else: 489 self.xmin.Enable() 490 self.xmax.Enable() 491 self.ymin.Enable() 492 self.ymax.Enable() 553 493 else: 554 494 for item in self.parameters: … … 579 519 else: 580 520 self.cb1.SetValue(False) 581 if (self.modelbox.GetValue() and self.DataSource.GetValue()): 582 if not (len(self.param_toFit ) >0): 583 self.xmin.Disable() 584 self.xmax.Disable() 585 self.ymin.Disable() 586 self.ymax.Disable() 587 else: 588 self.xmin.Enable() 589 self.xmax.Enable() 590 self.ymin.Enable() 591 self.ymax.Enable() 592 else: 521 522 if not (len(self.param_toFit ) >0): 593 523 self.xmin.Disable() 594 524 self.xmax.Disable() 595 525 self.ymin.Disable() 596 526 self.ymax.Disable() 527 else: 528 self.xmin.Enable() 529 self.xmax.Enable() 530 self.ymin.Enable() 531 self.ymax.Enable() 532 597 533 598 534 -
sansview/perspectives/fitting/fitpanel.py
rcaa1226 r9d31a8b 80 80 if data.__class__.__name__=='MetaData2D': 81 81 from fitpage2D import FitPage2D 82 panel = FitPage2D(self.nb, -1)82 panel = FitPage2D(self.nb,data, -1) 83 83 else: 84 84 from fitpage1D import FitPage1D 85 panel = FitPage1D(self.nb, -1)85 panel = FitPage1D(self.nb,data, -1) 86 86 panel.set_manager(self.manager) 87 87 panel.set_owner(self.event_owner) 88 panel.set_data_name(data)88 89 89 self.nb.AddPage(page=panel,text=name,select=True) 90 90 panel.populate_box( self.model_list_box) -
sansview/perspectives/fitting/fitting.py
re1a310f r9d31a8b 212 212 213 213 214 def _single_fit_completed(self,result,pars,cpage,qmin,qmax ):214 def _single_fit_completed(self,result,pars,cpage,qmin,qmax,ymin=None, ymax=None): 215 215 """ 216 216 Display fit result on one page of the notebook. … … 243 243 244 244 cpage.onsetValues(result.fitness, result.pvec,result.stderr) 245 self.plot_helper(currpage=cpage,qmin=qmin,qmax=qmax )245 self.plot_helper(currpage=cpage,qmin=qmin,qmax=qmax,ymin=ymin, ymax=ymax) 246 246 except: 247 247 raise … … 249 249 250 250 251 def _simul_fit_completed(self,result,qmin,qmax ):251 def _simul_fit_completed(self,result,qmin,qmax,ymin=None, ymax=None): 252 252 """ 253 253 Parameter estimation completed, … … 276 276 page.onsetValues(result.fitness, small_out,small_cov) 277 277 #Replot model 278 self.plot_helper(currpage= page,qmin= qmin,qmax= qmax )278 self.plot_helper(currpage= page,qmin= qmin,qmax= qmax,ymin=ymin, ymax=ymax) 279 279 except: 280 280 wx.PostEvent(self.parent, StatusEvent(status="Fitting error: %s" % sys.exc_value)) 281 281 282 282 283 def _on_single_fit(self,id=None,qmin=None,qmax=None ):283 def _on_single_fit(self,id=None,qmin=None,qmax=None,ymin=None,ymax=None): 284 284 """ 285 285 perform fit for the current page and return chisqr,out and cov … … 306 306 for page, value in self.page_finder.iteritems(): 307 307 if value.get_scheduled() ==1 : 308 fitdata = value.get_data()308 metadata = value.get_data() 309 309 list=value.get_model() 310 310 model=list[0] … … 320 320 #Do the single fit 321 321 self.fitter.set_model(Model(model), self.id, pars) 322 self.fitter.set_data( fitdata,self.id,qmin,qmax)322 self.fitter.set_data(metadata,self.id,qmin,qmax) 323 323 self.fitter.select_problem_for_fit(Uid=self.id,value=value.get_scheduled()) 324 324 page_fitted=page … … 335 335 print "single_fit: result",result.fitness,result.pvec,result.stderr 336 336 #self._single_fit_completed(result,pars,page,qmin,qmax) 337 self._single_fit_completed(result,pars,page_fitted,qmin,qmax )337 self._single_fit_completed(result,pars,page_fitted,qmin,qmax,ymin,ymax) 338 338 except: 339 339 raise … … 341 341 return 342 342 343 def _on_simul_fit(self, id=None,qmin=None,qmax=None ):343 def _on_simul_fit(self, id=None,qmin=None,qmax=None, ymin=None, ymax=None): 344 344 """ 345 345 perform fit for all the pages selected on simpage and return chisqr,out and cov … … 362 362 try: 363 363 if value.get_scheduled()==1: 364 fitdata = value.get_data()364 metadata = value.get_data() 365 365 list = value.get_model() 366 366 model= list[0] … … 391 391 392 392 self.fitter.set_model(new_model, self.id, pars) 393 self.fitter.set_data( fitdata,self.id,qmin,qmax)393 self.fitter.set_data(metadata,self.id,qmin,qmax,ymin,ymax) 394 394 self.fitter.select_problem_for_fit(Uid=self.id,value=value.get_scheduled()) 395 395 self.id += 1 … … 400 400 try: 401 401 result=self.fitter.fit() 402 self._simul_fit_completed(result,qmin,qmax )402 self._simul_fit_completed(result,qmin,qmax,ymin,ymax) 403 403 except: 404 404 wx.PostEvent(self.parent, StatusEvent(status="Simultaneous Fitting error: %s" % sys.exc_value)) … … 433 433 current_pg = self.fit_panel.get_current_page() 434 434 if current_pg != sim_page: 435 current_pg.set_model_name(name)436 435 current_pg.set_panel(model) 437 436 … … 461 460 self.plot_helper(currpage=page,qmin= qmin,qmax= qmax) 462 461 463 def plot_helper(self,currpage,qmin=None,qmax=None ):462 def plot_helper(self,currpage,qmin=None,qmax=None,ymin=None,ymax=None): 464 463 """ 465 464 Plot a theory given a model and data … … 521 520 theory.y_bins= data.y_bins 522 521 tempy=[] 523 for i in range(len(data.x_bins)): 524 theory.image= model.runXY([data.x_bins[i],data.y_bins[i]]) 522 if qmin==None: 523 qmin=data.xmin 524 if qmax==None: 525 qmin=data.xmax 526 if ymin==None: 527 ymin=data.ymin 528 if ymax==None: 529 qmin=data.ymax 530 for i in range(len(data.y_bins)): 531 if data.y_bins[i]>= ymin and data.y_bins[i]<= ymax: 532 for j in range(len(data.x_bins)): 533 if data.x_bins[i]>= xmin and data.x_bins[i]<= xmax: 534 theory.image= model.runXY([data.x_bins[j],data.y_bins[i]]) 525 535 #print "fitting : plot_helper:", theory.image 526 536 #print data.image
Note: See TracChangeset
for help on using the changeset viewer.