Changeset e4e9162 in sasview


Ignore:
Timestamp:
Oct 24, 2018 9:10:35 AM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1249
Children:
4cbb2f5
Parents:
1852b17
Message:

update code comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/manipulations.py

    re090ba90 re4e9162  
    931931            y = y/y_counts 
    932932            y_err = np.sqrt(y_err)/y_counts 
    933             # The type of averaging: phi,q2, or q 
    934             # Calculate x[i]should be at the center of the bin 
     933            # The type of averaging: phi, q2, or q 
     934            # Calculate x values at the center of the bin 
    935935            if run.lower() == 'phi': 
    936                 step  = (self.phi_max - self.phi_min) / self.nbins 
     936                step = (self.phi_max - self.phi_min) / self.nbins 
    937937                x = (np.arange(self.nbins) + 0.5) * step + self.phi_min 
    938938            else: 
    939                 # We take the center of ring area, not radius. 
    940                 # This is more accurate than taking the radial center of ring. 
    941                 # delta_r = (self.r_max - self.r_min) / self.nbins 
    942                 # r_inner = self.r_min + delta_r * i 
    943                 # r_outer = r_inner + delta_r 
    944                 # x[i] = math.sqrt((r_inner * r_inner + r_outer * r_outer) / 2) 
     939                # set q to the average of the q values within each bin 
    945940                x = x/y_counts 
     941 
     942                ### Alternate algorithm 
     943                ## We take the center of ring area, not radius. 
     944                ## This is more accurate than taking the radial center of ring. 
     945                #step = (self.r_max - self.r_min) / self.nbins 
     946                #r_inner = self.r_min + step * np.arange(self.nbins) 
     947                #x = math.sqrt((r_inner**2 + (r_inner + step)**2) / 2) 
    946948 
    947949        idx = (np.isfinite(y) & np.isfinite(y_err)) 
Note: See TracChangeset for help on using the changeset viewer.