Changes in / [53df2ea:25ab07c] in sasview
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/dataloader/manipulations.py
rddc192a r400155b 623 623 phi_values = numpy.zeros(self.nbins_phi) 624 624 phi_err = numpy.zeros(self.nbins_phi) 625 626 627 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 628 629 629 for npt in range(len(data)): -
src/sas/dataloader/readers/ascii_reader.py
ref3445e2 r79492222 67 67 raise RuntimeError, "ascii_reader: cannot open %s" % path 68 68 buff = input_f.read() 69 lines = buff.splitlines() 69 lines = buff.split('\n') 70 71 #Jae could not find python universal line spliter: 72 #keep the below for now 73 # some ascii data has \r line separator, 74 # try it when the data is on only one long line 75 if len(lines) < 2 : 76 lines = buff.split('\r') 70 77 71 78 x = numpy.zeros(0) … … 74 81 dx = numpy.zeros(0) 75 82 76 83 #temp. space to sort data 77 84 tx = numpy.zeros(0) 78 85 ty = numpy.zeros(0) … … 213 220 pass 214 221 215 x = numpy.append(x, _x) 222 x = numpy.append(x, _x) 216 223 y = numpy.append(y, _y) 217 224 … … 287 294 i += 1 288 295 except: 296 289 297 # It is data and meet non - number, then stop reading 290 298 if is_data == True: -
test/sasdataloader/test/utest_averaging.py
ref3445e2 r35ec279 105 105 r = Ring(r_min=.005, r_max=.01, 106 106 center_x=self.data.detector[0].beam_center.x, 107 center_y=self.data.detector[0].beam_center.y, 108 nbins = 20) 109 ##r.nbins_phi = 20 107 center_y=self.data.detector[0].beam_center.y) 108 r.nbins_phi = 20 110 109 111 110 o = r(self.data) 112 111 answer = Loader().load('ring_testdata.txt') 113 114 for i in range(r.nbins_phi - 1): 115 self.assertAlmostEqual(o.x[i + 1], answer.x[i], 4) 116 self.assertAlmostEqual(o.y[i + 1], answer.y[i], 4) 117 self.assertAlmostEqual(o.dy[i + 1], answer.dy[i], 4) 112 for i in range(r.nbins_phi): 113 self.assertAlmostEqual(o.x[i], answer.x[i], 4) 114 self.assertAlmostEqual(o.y[i], answer.y[i], 4) 115 self.assertAlmostEqual(o.dy[i], answer.dy[i], 4) 118 116 119 117 def test_circularavg(self): … … 196 194 import math 197 195 198 r = SectorPhi(r_min=.005, 199 r_max=.01, 200 phi_min=0.15707963, 201 phi_max=math.pi*2.-0.15707963, 202 nbins=19) 196 r = SectorPhi(r_min=.005, r_max=.01, phi_min=0, phi_max=math.pi*2.0) 197 r.nbins_phi = 20 203 198 o = r(self.data) 204 199
Note: See TracChangeset
for help on using the changeset viewer.