Changeset afab469 in sasview
- Timestamp:
- Mar 12, 2010 1:31:20 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:
- 32e8c78
- Parents:
- edb30b66
- Location:
- DataLoader/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/test/utest_abs_reader.py
radbb821 rafab469 108 108 109 109 self.assertEqual(self.data.detector[0].beam_center_unit, 'mm') 110 center_x = 68.76*5.0111 center_y = 62.47*5.0110 center_x = (68.76-1)*5.0 111 center_y = (62.47-1)*5.0 112 112 self.assertEqual(self.data.detector[0].beam_center.x, center_x) 113 113 self.assertEqual(self.data.detector[0].beam_center.y, center_y) 114 114 115 115 self.assertEqual(self.data.I_unit, '1/cm') 116 self.assertEqual(self.data.data[0] [0], 0.279783)117 self.assertEqual(self.data.data[ 0][1], 0.28951)118 self.assertEqual(self.data.data[ 0][2], 0.167634)116 self.assertEqual(self.data.data[0], 0.279783) 117 self.assertEqual(self.data.data[1], 0.28951) 118 self.assertEqual(self.data.data[2], 0.167634) 119 119 120 120 class danse_reader(unittest.TestCase): … … 147 147 148 148 self.assertEqual(self.data.I_unit, '1/cm') 149 self.assertEqual(self.data.data[0] [0], 1.57831)150 self.assertEqual(self.data.data[ 0][1], 2.70983)151 self.assertEqual(self.data.data[ 0][2], 3.83422)152 153 self.assertEqual(self.data.err_data[0] [0], 1.37607)154 self.assertEqual(self.data.err_data[ 0][1], 1.77569)155 self.assertEqual(self.data.err_data[ 0][2], 2.06313)149 self.assertEqual(self.data.data[0], 1.57831) 150 self.assertEqual(self.data.data[1], 2.70983) 151 self.assertEqual(self.data.data[2], 3.83422) 152 153 self.assertEqual(self.data.err_data[0], 1.37607) 154 self.assertEqual(self.data.err_data[1], 1.77569) 155 self.assertEqual(self.data.err_data[2], 2.06313) 156 156 157 157 -
DataLoader/test/utest_averaging.py
re84e1e6 rafab469 3 3 4 4 from DataLoader.loader import Loader 5 from DataLoader.manipulations import Ring, CircularAverage, SectorPhi, get_q 5 from DataLoader.manipulations import Ring, CircularAverage, SectorPhi, get_q,reader2D_converter 6 6 7 7 import os.path … … 20 20 x_0 = numpy.ones([100,100]) 21 21 dx_0 = numpy.ones([100,100]) 22 self.data = data_info.Data2D(x_0, dx_0) 22 23 self.data = data_info.Data2D(data=x_0, err_data=dx_0) 23 24 detector = data_info.Detector() 24 detector.distance = 1000.0 25 detector.pixel_size.x = 1.0 26 detector.pixel_size.y = 1.0 27 detector.beam_center.x = 50 28 detector.beam_center.y = 50 25 detector.distance = 1000.0 #mm 26 detector.pixel_size.x = 1.0 #mm 27 detector.pixel_size.y = 1.0 #mm 28 29 # center in pixel position = (len(x_0)-1)/2 30 detector.beam_center.x = (len(x_0)-1)/2 #pixel number 31 detector.beam_center.y = (len(x_0)-1)/2 #pixel number 29 32 self.data.detector.append(detector) 30 33 31 34 source = data_info.Source() 32 source.wavelength = 10.0 35 source.wavelength = 10.0 #A 33 36 self.data.source = source 34 37 35 self.qmin = get_q(1.0, 1.0, 1000.0, 10.0) 36 38 # get_q(dx, dy, det_dist, wavelength) where units are mm,mm,mm,and A respectively. 39 self.qmin = get_q(1.0, 1.0, detector.distance, source.wavelength) 40 41 self.qmax = get_q(49.5, 49.5, detector.distance, source.wavelength) 42 43 self.qstep = len(x_0) 44 x= numpy.linspace(start= -1*self.qmax, 45 stop= self.qmax, 46 num= self.qstep, 47 endpoint=True ) 48 y = numpy.linspace(start= -1*self.qmax, 49 stop= self.qmax, 50 num= self.qstep, 51 endpoint=True ) 52 self.data.x_bins=x 53 self.data.y_bins=y 54 self.data = reader2D_converter(self.data) 55 37 56 def test_ring_flat_distribution(self): 38 57 """
Note: See TracChangeset
for help on using the changeset viewer.