- Timestamp:
- Feb 17, 2015 8:20:48 AM (10 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:
- 66f21cd
- Parents:
- 7eaf9f2
- Location:
- src/sas
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/dataloader/manipulations.py
r79492222 r400155b 582 582 """ 583 583 #Todo: remove center. 584 def __init__(self, r_min=0, r_max=0, center_x=0, center_y=0, nbins= 20):584 def __init__(self, r_min=0, r_max=0, center_x=0, center_y=0, nbins=36): 585 585 # Minimum radius 586 586 self.r_min = r_min … … 593 593 # Number of angular bins 594 594 self.nbins_phi = nbins 595 595 596 596 597 def __call__(self, data2D): … … 622 623 phi_values = numpy.zeros(self.nbins_phi) 623 624 phi_err = numpy.zeros(self.nbins_phi) 624 625 626 # Shift to apply to calculated phi values in order to center first bin at zero 627 phi_shift = Pi / self.nbins_phi 628 625 629 for npt in range(len(data)): 626 630 frac = 0 … … 637 641 continue 638 642 # binning 639 i_phi = int(math.floor((self.nbins_phi) * phi_value/ (2 * Pi)))643 i_phi = int(math.floor((self.nbins_phi) * (phi_value+phi_shift) / (2 * Pi))) 640 644 641 645 # Take care of the edge case at phi = 2pi. 642 if i_phi == self.nbins_phi:643 i_phi = self.nbins_phi - 1646 if i_phi >= self.nbins_phi: 647 i_phi = 0 644 648 phi_bins[i_phi] += frac * data[npt] 645 649 … … 655 659 phi_bins[i] = phi_bins[i] / phi_counts[i] 656 660 phi_err[i] = math.sqrt(phi_err[i]) / phi_counts[i] 657 phi_values[i] = 2.0 * math.pi / self.nbins_phi * (1.0 * i + 0.5)661 phi_values[i] = 2.0 * math.pi / self.nbins_phi * (1.0 * i) 658 662 659 663 idx = (numpy.isfinite(phi_bins)) -
src/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.py
r79492222 r400155b 35 35 36 36 ## Number of points on the plot 37 self.nbins = 2037 self.nbins = 36 38 38 #Cursor position of Rings (Left(-1) or Right(1)) 39 39 self.xmaxd = self.base.data2D.xmax … … 131 131 math.fabs(self.outer_circle.get_radius())) 132 132 #if the user does not specify the numbers of points to plot 133 # the default number will be nbins= 20133 # the default number will be nbins= 36 134 134 if nbins == None: 135 self.nbins = 20135 self.nbins = 36 136 136 else: 137 137 self.nbins = nbins
Note: See TracChangeset
for help on using the changeset viewer.