Changeset 12c5b87 in sasview for DataLoader


Ignore:
Timestamp:
Jan 19, 2011 5:58:55 PM (14 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:
1d78e4b
Parents:
ec3959ab
Message:

fixed a bug in sector average

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/manipulations.py

    rec3959ab r12c5b87  
    812812            # The type of averaging: phi,q2, or q 
    813813            # Calculate x[i]should be at the center of the bin 
    814             if run.lower() == 'phi':  
    815                 temp = self.nbins * (1.0 * i + 0.5) + self.phi_min               
    816                 x[i] = (self.phi_max - self.phi_min) / temp 
     814            if run.lower()=='phi':               
     815                x[i] = (self.phi_max - self.phi_min) / self.nbins * \ 
     816                    (1.0 * i + 0.5) + self.phi_min 
    817817            else: 
    818                 temp = self.nbins * (1.0 * i + 0.5) + self.r_min 
    819                 x[i] = (self.r_max - self.r_min) / temp 
     818                x[i] = (self.r_max - self.r_min) / self.nbins * \ 
     819                    (1.0 * i + 0.5) + self.r_min 
    820820                 
    821821        idx = (numpy.isfinite(y) & numpy.isfinite(y_err)) 
Note: See TracChangeset for help on using the changeset viewer.