- Timestamp:
- Oct 24, 2018 11:10:35 AM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1249
- Children:
- 4cbb2f5
- Parents:
- 1852b17
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/manipulations.py
re090ba90 re4e9162 931 931 y = y/y_counts 932 932 y_err = np.sqrt(y_err)/y_counts 933 # The type of averaging: phi, q2, or q934 # Calculate x [i]should beat the center of the bin933 # The type of averaging: phi, q2, or q 934 # Calculate x values at the center of the bin 935 935 if run.lower() == 'phi': 936 step 936 step = (self.phi_max - self.phi_min) / self.nbins 937 937 x = (np.arange(self.nbins) + 0.5) * step + self.phi_min 938 938 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 945 940 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) 946 948 947 949 idx = (np.isfinite(y) & np.isfinite(y_err))
Note: See TracChangeset
for help on using the changeset viewer.