Changeset 17fc6f8 in sasview for sansview/perspectives


Ignore:
Timestamp:
Feb 4, 2009 5:54:52 PM (15 years ago)
Author:
Jae Cho <jhjcho@…>
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
Message:

making sure that uid is assigned correctly for 2d fit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitting.py

    r7ce6c72 r17fc6f8  
    332332             
    333333   
    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): 
    335335        """  
    336336            perform fit for the  current page  and return chisqr,out and cov 
     
    346346        #Setting an id to store model and data in fit engine 
    347347        if id==None: 
    348             id=0 
    349         self.id = id 
     348            self.id=0 
     349        else: 
     350            self.id = id 
    350351        page_fitted=None 
    351352        fit_problem=None 
     
    374375                    #Do the single fit 
    375376                    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                     
    378383                    self.fitter.select_problem_for_fit(Uid=self.id,value=value.get_scheduled()) 
    379384                    page_fitted=page 
     
    463468                           
    464469                    self.fitter.set_model(new_model, self.id, pars)  
     470                     
    465471                    self.fitter.set_data(metadata,self.id,qmin,qmax,ymin,ymax) 
    466472                    self.fitter.select_problem_for_fit(Uid=self.id,value=value.get_scheduled()) 
     
    626632                theory.y_bins= data.y_bins 
    627633                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 
    636644                print " q range =",     
    637645                theory.data = numpy.zeros((len(data.y_bins),len(data.x_bins))) 
    638                 for i in range(len(data.y_bins)): 
    639                     if data.y_bins[i]>= ymin and data.y_bins[i]<= ymax: 
    640                         for j in 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)): 
    641649                            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 
    643655                
    644656                #print "fitting : plot_helper:", theory.image 
     
    649661                theory.zmin= data.zmin 
    650662                theory.zmax= data.zmax 
    651                 theory.xmin= qmin 
    652                 theory.xmax= qmax 
     663                theory.xmin= xmin 
     664                theory.xmax= xmax 
    653665                theory.ymin= ymin 
    654666                theory.ymax= ymax 
Note: See TracChangeset for help on using the changeset viewer.