Changeset 1b07935d in sasview for sansview/perspectives/fitting/fitting.py
- Timestamp:
- Sep 8, 2008 9:10:57 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:
- 6f4b71f
- Parents:
- d89f09b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
rd89f09b r1b07935d 74 74 self.fit_panel.set_model_list(self.menu_mng.get_model_list()) 75 75 owner.Bind(fitpage.EVT_MODEL_BOX,self._on_model_panel) 76 #owner.Bind(modelpage.EVT_MODEL_DRAW,self.draw_model) 76 77 77 78 return [(id, self.menu1, "Fitting"),(id2, menu2, "Model")] … … 154 155 name = 'Fit' 155 156 try: 156 page = self.fit_panel.add_ page(name)157 page = self.fit_panel.add_fit_page(name) 157 158 page.set_data_name(item) 158 159 self.page_finder[page]= FitProblem() … … 219 220 for name in pars: 220 221 if result.pvec.__class__==numpy.float64: 221 model. model.setParam(name,result.pvec)222 model.setParam(name,result.pvec) 222 223 else: 223 model. model.setParam(name,result.pvec[i])224 model.setParam(name,result.pvec[i]) 224 225 #print "fitting: i name out[i]", i,name,float(result.pvec[i]) 225 226 i += 1 … … 255 256 print "fitting: fit in park fitting", p.name, p.value,p.stderr 256 257 model_name,param_name = self.split_string(p.name) 257 print "fitting: simultfit",model. model.name,model_name,param_name ,p.name,param_name,p.value258 if model. model.name == model_name:258 print "fitting: simultfit",model.name,model_name,param_name ,p.name,param_name,p.value 259 if model.name == model_name: 259 260 print "fitting: hello",p.name,param_name,p.value 260 261 small_out.append(p.value ) 261 262 small_cov.append(p.stderr) 262 model. model.setParam(param_name,p.value)263 model.setParam(param_name,p.value) 263 264 #print "fitting: out of each page",page,small_out,small_cov,data.group_id 264 265 page.onsetValues(result.fitness, small_out,small_cov) … … 408 409 #print "fitter",self.fitter 409 410 #print "fitting: model name",model.name 410 self.fitter.set_model( model,model.model.name, self.id, pars)411 self.fitter.set_model(Model(model),model.name, self.id, pars) 411 412 self.fitter.set_data(data,self.id,qmin,qmax) 412 413 else: … … 455 456 self.page_finder[current_pg].set_theory("Fitness") 456 457 #print "on model",model.name 457 self.page_finder[current_pg].set_model( Model(model),M_name)458 self.page_finder[current_pg].set_model(model,M_name) 458 459 self.plot_helper(currpage= current_pg,qmin= None,qmax= None) 459 460 sim_page.add_model(self.page_finder) … … 503 504 try: 504 505 tempx = qmin 505 tempy = model. eval(qmin)506 tempy = model.run(qmin) 506 507 theory.x.append(tempx) 507 508 theory.y.append(tempy) … … 514 515 if data.x[i]> qmin and data.x[i]< qmax: 515 516 tempx = data.x[i] 516 tempy = model. eval(tempx)517 tempy = model.run(tempx) 517 518 518 519 theory.x.append(tempx) … … 523 524 try: 524 525 tempx = qmax 525 tempy = model. eval(qmax)526 tempy = model.run(qmax) 526 527 theory.x.append(tempx) 527 528 theory.y.append(tempy) … … 542 543 Plot a theory from a model selected from the menu 543 544 """ 545 #name = evt.model.__class__.__name__ 546 name="Model View" 547 self.fit_panel.add_model_page(evt.model,name) 548 self.draw_model(evt.model) 549 550 def draw_model(self,model): 544 551 x = pylab.arange(0.001, 0.1, 0.001) 545 552 xlen = len(x) … … 548 555 549 556 for i in range(xlen): 550 y[i] = evt.model.run(x[i])557 y[i] = model.run(x[i]) 551 558 dy[i] = math.sqrt(math.fabs(y[i])) 552 559 try: … … 562 569 print "SimView.complete1D: could not import sans.guicomm.events" 563 570 564 565 571 if __name__ == "__main__": 566 572 i = Plugin()
Note: See TracChangeset
for help on using the changeset viewer.