Changeset 17fc6f8 in sasview
- Timestamp:
- Feb 4, 2009 3:54:52 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:
- 2caecd5
- Parents:
- 3e8e627
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r7ce6c72 r17fc6f8 332 332 333 333 334 def _on_single_fit(self,id=None,qmin=None,qmax=None ):334 def _on_single_fit(self,id=None,qmin=None,qmax=None,ymin=None, ymax=None): 335 335 """ 336 336 perform fit for the current page and return chisqr,out and cov … … 346 346 #Setting an id to store model and data in fit engine 347 347 if id==None: 348 id=0 349 self.id = id 348 self.id=0 349 else: 350 self.id = id 350 351 page_fitted=None 351 352 fit_problem=None … … 374 375 #Do the single fit 375 376 self.fitter.set_model(Model(model), self.id, pars) 376 377 self.fitter.set_data(metadata,self.id,smearer, qmin,qmax) 377 print "args...:",metadata,self.id,smearer,qmin,qmax,ymin,ymax 378 379 self.fitter.set_data(data=metadata,Uid=self.id, 380 smearer=smearer,qmin= qmin,qmax=qmax, 381 ymin=ymin,ymax=ymax) 382 378 383 self.fitter.select_problem_for_fit(Uid=self.id,value=value.get_scheduled()) 379 384 page_fitted=page … … 463 468 464 469 self.fitter.set_model(new_model, self.id, pars) 470 465 471 self.fitter.set_data(metadata,self.id,qmin,qmax,ymin,ymax) 466 472 self.fitter.select_problem_for_fit(Uid=self.id,value=value.get_scheduled()) … … 626 632 theory.y_bins= data.y_bins 627 633 tempy=[] 628 #if qmin==None: 629 qmin=data.xmin 630 #if qmax==None: 631 qmax=data.xmax 632 #if ymin==None: 633 ymin=data.ymin 634 #if ymax==None: 635 ymax=data.ymax 634 if qmin==None: 635 qmin=data.xmin 636 if qmax==None: 637 qmax=data.xmax 638 if ymin==None: 639 ymin=data.ymin 640 if ymax==None: 641 ymax=data.ymax 642 xmin=data.xmin 643 xmax=data.xmax 636 644 print " q range =", 637 645 theory.data = numpy.zeros((len(data.y_bins),len(data.x_bins))) 638 for iin range(len(data.y_bins)):639 if data.y_bins[ i]>= ymin and data.y_bins[i]<= ymax:640 for jin range(len(data.x_bins)):646 for j in range(len(data.y_bins)): 647 if data.y_bins[j]>= ymin and data.y_bins[j]<= ymax: 648 for i in range(len(data.x_bins)): 641 649 if data.x_bins[i]>= qmin and data.x_bins[i]<= qmax: 642 theory.data[i][j]=model.runXY([data.x_bins[j],data.y_bins[i]]) 650 theory.data[j][i]=model.runXY([data.y_bins[j],data.x_bins[i]]) 651 else: 652 Inf=1e+5000 653 Nan=Inf*0 654 theory.data[j][i]=Nan 643 655 644 656 #print "fitting : plot_helper:", theory.image … … 649 661 theory.zmin= data.zmin 650 662 theory.zmax= data.zmax 651 theory.xmin= qmin652 theory.xmax= qmax663 theory.xmin= xmin 664 theory.xmax= xmax 653 665 theory.ymin= ymin 654 666 theory.ymax= ymax
Note: See TracChangeset
for help on using the changeset viewer.