Changeset 46cd1c3 in sasview for src/sas/sascalc/dataloader/manipulations.py
- Timestamp:
- May 18, 2017 2:48:06 PM (8 years ago)
- 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 7b15990
- Parents:
- e123eb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/manipulations.py
rb290a9e r46cd1c3 787 787 return Data1D(x=phi_values[idx], y=phi_bins[idx], dy=phi_err[idx]) 788 788 789 ################################################################################790 789 791 790 class _Sector(object): … … 802 801 """ 803 802 804 def __init__(self, r_min, r_max, phi_min=0, phi_max=2 * math.pi, nbins=20, base = None): 803 def __init__(self, r_min, r_max, phi_min=0, phi_max=2 * math.pi, nbins=20, 804 base=None): 805 ''' 806 :param base: must be a valid base for an algorithm, i.e., 807 a positive number 808 ''' 805 809 self.r_min = r_min 806 810 self.r_max = r_max … … 838 842 y_err = np.zeros(self.nbins) 839 843 x_err = np.zeros(self.nbins) 840 y_counts = np.zeros(self.nbins) # Cycle counts (for the mean)844 y_counts = np.zeros(self.nbins) # Cycle counts (for the mean) 841 845 842 846 # Get the min and max into the region: 0 <= phi < 2Pi … … 936 940 # We take the center of ring area, not radius. 937 941 # This is more accurate than taking the radial center of ring. 938 # delta_r = (self.r_max - self.r_min) / self.nbins939 # r_inner = self.r_min + delta_r * i940 # r_outer = r_inner + delta_r941 # x[i] = math.sqrt((r_inner * r_inner + r_outer * r_outer) / 2)942 # delta_r = (self.r_max - self.r_min) / self.nbins 943 # r_inner = self.r_min + delta_r * i 944 # r_outer = r_inner + delta_r 945 # x[i] = math.sqrt((r_inner * r_inner + r_outer * r_outer) / 2) 942 946 x[i] = x[i] / y_counts[i] 943 947 y_err[y_err == 0] = np.average(y_err) … … 952 956 # elif len(y[idx])!= self.nbins: 953 957 # print "resulted",self.nbins- len(y[idx]), 954 # "empty bin(s) due to tight binning..."958 # "empty bin(s) due to tight binning..." 955 959 return Data1D(x=x[idx], y=y[idx], dy=y_err[idx], dx=d_x) 956 960
Note: See TracChangeset
for help on using the changeset viewer.