Changeset 2f569b3 in sasview
- Timestamp:
- Jan 25, 2010 1:12:40 PM (15 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.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:
- 3c67340
- Parents:
- bb0b12c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/manipulations.py
rbb0b12c r2f569b3 472 472 473 473 i_q = int(math.floor((q_value-self.r_min)/self.bin_width)) #- 1 474 474 475 if q_value > qmax or q_value < self.r_min: 475 continue 476 #print q_value 476 continue 477 477 478 478 x[i_q] += q_value … … 769 769 x = numpy.zeros(self.nbins) 770 770 x_counts = numpy.zeros(self.nbins) 771 y_err = numpy.zeros(self.nbins) 772 773 774 center_x=center_x 775 center_y=center_y 771 y_err = numpy.zeros(self.nbins) 776 772 777 773 # This If finds qmax within ROI defined by sector lines … … 782 778 for j in range(numpy.size(data,0)): 783 779 #number of sub-bin: default = 2 (ie., 1 bin: no sub-bin) 784 nsubbins = 2780 nsubbins = 1 785 781 786 782 #Sub divide one pixel into nine sub-pixels only for the pixels where the qmax or qmin line crosses over. … … 854 850 for j in range(numpy.size(data,0)): 855 851 #number of sub-bin: default = 1 (ie., 1 bin: no sub-bin) 856 nsubbins = 2852 nsubbins = 1 857 853 858 854 #if is_intercept(self.r_max, q_00, q_01, q_10, q_11) \ … … 955 951 # Check which type of averaging we need 956 952 if run.lower()=='phi': 957 i_bin = int(math. ceil(self.nbins*(phi_value-self.phi_min)/(self.phi_max-self.phi_min))) - 1953 i_bin = int(math.floor(self.nbins*(phi_value-self.phi_min)/(self.phi_max-self.phi_min))) 958 954 else: 959 955 # If we don't need this pixel, skip the rest of the work … … 962 958 # the ring defined by q_min/q_max rather than the complete 963 959 # pixel 964 i_bin = int(math.ceil(self.nbins*(q_value-qmin)/(qmax-qmin))) - 1 965 960 i_bin = int(math.floor(self.nbins*(q_value-qmin)/(qmax-qmin))) 961 962 #Make sure that no out of bound happens 963 #This is needed because of a numerical error in math.ceil(). 964 if i_bin >= self.nbins: 965 i_bin = self.nbins - 1 966 elif i_bin < 0: 967 i_bin = 0 968 966 969 try: 967 970 y[i_bin] += frac * data[j][i]
Note: See TracChangeset
for help on using the changeset viewer.