Changeset 3e8e627 in sasview for sansview/perspectives


Ignore:
Timestamp:
Feb 4, 2009 5:51:37 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:
17fc6f8
Parents:
a320904
Message:

Malfunctioning of 2D fit partly fixed

File:
1 edited

Legend:

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

    rc4550b0 r3e8e627  
    179179        self.btFit.SetToolTipString("Perform fit.") 
    180180         ## Q range 
    181         print "self.data fitpage1D" , self.data,hasattr(self.data,"data") 
     181        #print "self.data fitpage1D" , self.data,hasattr(self.data,"data") 
    182182        # Reversed to the codes; Need to think  carefully about consistency in q between 2D plot and fitting 
    183183        if not hasattr(self.data,"data"): 
    184184            self.qmin_x= numpy.min(self.data.x) 
    185185            self.qmax_x= numpy.max(self.data.x) 
     186            self.num_points= len(self.data.x) 
    186187        else: 
    187188            # Reversed to the codes; Need to think  carefully about consistency in q between 2D plot and fitting 
     
    190191            radius3= math.sqrt(math.pow(self.data.xmin, 2)+ math.pow(self.data.ymax, 2)) 
    191192            radius4= math.sqrt(math.pow(self.data.xmax, 2)+ math.pow(self.data.ymax, 2)) 
    192             self.qmin_x =0 
    193             self.qmax_x= max(radius1, radius2, radius3, radius4) 
    194             #self.qmin_x= self.data.xmin 
    195             #self.qmax_x= self.data.xmax            
    196             print "data2D range",self.qmax_x 
    197          
    198         self.num_points= 100 
     193            #self.qmin_x = 0 
     194            #self.qmax_x = max(radius1, radius2, radius3, radius4) 
     195            self.qmin_x= self.data.xmin 
     196            self.qmax_x= self.data.xmax            
     197            #print "data2D range",self.qmax_x 
     198         
     199            self.num_points= 100 
    199200          
    200201         
     
    305306                            if self.data.y_bins[j]>= self.qmin_x and self.data.y_bins[j]<= self.qmax_x: 
    306307                                res.append( (self.data.data[j][i]- self.model.runXY(\ 
    307                                  [self.data.x_bins[i],self.data.y_bins[j]]))\ 
     308                                 [self.data.y_bins[j],self.data.x_bins[i]]))\ 
    308309                                    /self.data.err_data[j][i] ) 
    309310                sum=0 
     
    335336                    self.qmin_x = float(self.qmin.GetValue()) 
    336337                    self.qmax_x = float(self.qmax.GetValue()) 
    337                     print "self.qmin_x, self.qmax_x",self.qmin_x,self.qmax_x 
     338                    #print "self.qmin_x, self.qmax_x",self.qmin_x,self.qmax_x 
    338339                    x,y,dy = [numpy.asarray(v) for v in (self.data.x,self.data.y,self.data.dy)] 
    339340                    if self.qmin_x==None and self.qmax_x==None:  
     
    393394        if len(self.param_toFit) >0 and flag==True: 
    394395            self.manager.schedule_for_fit( value=1,fitproblem =None)  
    395             self.manager._on_single_fit(qmin=self.qmin_x,qmax=self.qmax_x) 
     396            if hasattr(self.data, "data"): 
     397                self.manager._on_single_fit(qmin=self.qmin_x,qmax=self.qmax_x, 
     398                                            ymin=self.data.ymin, ymax=self.data.ymax) 
     399            else: 
     400                 self.manager._on_single_fit(qmin=self.qmin_x,qmax=self.qmax_x) 
    396401        else: 
    397402              wx.PostEvent(self.parent.parent, StatusEvent(status=\ 
Note: See TracChangeset for help on using the changeset viewer.