Changeset 400155b in sasview
- Timestamp:
- Feb 17, 2015 6: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
- Files:
-
- 142 added
- 3 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 -
test/sasdataloader/test/ring_testdata.txt
r8c9ffde r400155b 1 1 <X> <Y> <dY> 2 0. 157079632679 0.892216637179 0.07756634145953 0. 471238898038 0.98455818481 0.0796576971184 0. 785398163397 0.961797998125 0.07885569803945 1.09955742876 0.97171642327 0.0791285423182 6 1. 41371669412 1.0146882474 0.0820634266397 1. 72787595947 1.00992701463 0.0803530917648 2.04203522483 1.02880481582 0.0815342153253 9 2. 35619449019 1.00598046038 0.079825173228310 2. 67035375555 1.07871021115 0.083633549866211 2. 98451302091 0.998456910563 0.07974733158512 3. 29867228627 1.04419570592 0.083042824148913 3. 61283155163 1.01232642025 0.080830851326714 3. 92699081699 1.0083937443 0.081002888700915 4. 24115008235 1.03216852956 0.081038953481216 4. 55530934771 1.06499475793 0.081408523043917 4. 86946861306 0.982265097403 0.080552898804618 5. 18362787842 1.00390126667 0.080663356106219 5. 49778714378 0.980815954717 0.079314565949920 5. 81194640914 0.907713166456 0.076578295664821 6.1261056745 0.983188286879 0.0797444057771 2 0.0 0.974491286452 0.0803843574327 3 0.314159265359 0.9046853025 0.0768971192264 4 0.628318530718 0.964040908176 0.0790933208542 5 0.942477796077 0.922142905769 0.0781616076625 6 1.25663706144 1.02710537736 0.080875897538 7 1.57079632679 1.01448978075 0.0808313893873 8 1.88495559215 1.04677136013 0.0828850195035 9 2.19911485751 1.00067189877 0.0790510747578 10 2.51327412287 1.06280533013 0.0830643956456 11 2.82743338823 1.04313751703 0.0824585190353 12 3.14159265359 0.993559460696 0.0803376331443 13 3.45575191895 0.998101030127 0.0813124293449 14 3.76991118431 1.04589910764 0.0821364674302 15 4.08407044967 0.997201556522 0.0797466854806 16 4.39822971503 1.07289797405 0.0830165798358 17 4.71238898038 1.01212391625 0.0803021745794 18 5.02654824574 0.995907123899 0.0804649435453 19 5.3407075111 0.991431571613 0.0803765721376 20 5.65486677646 0.959020086792 0.0787114622667 21 5.96902604182 0.945705788519 0.0767669312314
Note: See TracChangeset
for help on using the changeset viewer.