Changeset 027e8f2 in sasview


Ignore:
Timestamp:
Dec 8, 2009 4:24:55 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:
71e2de7
Parents:
3bb37ef
Message:

Fixed a 2D problem of not properly (calculating chi2 and fitting 2Ddata) with bounded Q range.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • park_integration/AbstractFitEngine.py

    r255306e r027e8f2  
    266266         
    267267         
    268     def set_data(self, sans_data2d ): 
     268    def set_data(self, sans_data2d, qmin=None, qmax=None ): 
    269269        """ 
    270270            Determine the correct x_bin and y_bin to fit 
     
    279279         
    280280        ## fitting range 
    281         self.qmin = 1e-16 
    282         self.qmax = math.sqrt(x_max*x_max +y_max*y_max) 
     281        if qmin == None: 
     282            self.qmin = 1e-16 
     283        if qmax == None: 
     284            self.qmax = math.sqrt(x_max*x_max +y_max*y_max) 
    283285        ## new error image for fitting purpose 
    284286        if self.err_data== None or self.err_data ==[]: 
     
    300302        if qmax!=None: 
    301303            self.qmax= qmax 
    302        
     304             
     305        self.radius= numpy.sqrt(self.x_bins_array**2 + self.y_bins_array**2) 
     306        self.index_model = (self.qmin <= self.radius)&(self.radius<= self.qmax) 
    303307         
    304308    def getFitRange(self): 
Note: See TracChangeset for help on using the changeset viewer.