Changeset f001bc9 in sasview for test/sasdataloader
- Timestamp:
- Aug 22, 2017 12:55:17 PM (7 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- fca1f50, 17e257b5, f9ba422, 783c1b5
- Parents:
- a06ee7e (diff), dcb91cf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Jeff Krzywon <krzywon@…> (08/22/17 12:55:17)
- git-committer:
- GitHub <noreply@…> (08/22/17 12:55:17)
- Location:
- test/sasdataloader/test
- Files:
-
- 4 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasdataloader/test/utest_abs_reader.py
rc551bb3 rce8c7bd 5 5 6 6 import unittest 7 import math8 7 import numpy as np 9 8 from sas.sascalc.dataloader.loader import Loader 10 from sas.sascalc.dataloader.readers.IgorReader import Reader as IgorReader11 9 from sas.sascalc.dataloader.readers.abs_reader import Reader as AbsReader 12 from sas.sascalc.dataloader.readers.hfir1d_reader import Reader as HFIRReader13 10 from sas.sascalc.dataloader.readers.danse_reader import Reader as DANSEReader 14 11 from sas.sascalc.dataloader.readers.cansas_reader import Reader as CANSASReader 15 12 16 13 from sas.sascalc.dataloader.data_info import Data1D 17 14 18 15 import os.path 19 16 20 17 21 18 class abs_reader(unittest.TestCase): 22 19 23 20 def setUp(self): 24 21 reader = AbsReader() … … 27 24 def test_abs_checkdata(self): 28 25 """ 29 Check the data content to see whether 26 Check the data content to see whether 30 27 it matches the specific file we loaded. 31 28 Check the units too to see whether the … … 35 32 self.assertEqual(self.data.filename, "jan08002.ABS") 36 33 self.assertEqual(self.data.meta_data['loader'], "IGOR 1D") 37 34 38 35 self.assertEqual(self.data.source.wavelength_unit, 'A') 39 36 self.assertEqual(self.data.source.wavelength, 6.0) 40 37 41 38 self.assertEqual(self.data.detector[0].distance_unit, 'mm') 42 39 self.assertEqual(self.data.detector[0].distance, 1000.0) 43 40 44 41 self.assertEqual(self.data.sample.transmission, 0.5667) 45 42 46 43 self.assertEqual(self.data.detector[0].beam_center_unit, 'mm') 47 center_x = 114.58*5.0 48 center_y = 64.22*5.0 44 center_x = 114.58*5.08 45 center_y = 64.22*5.08 49 46 self.assertEqual(self.data.detector[0].beam_center.x, center_x) 50 47 self.assertEqual(self.data.detector[0].beam_center.y, center_y) 51 48 52 49 self.assertEqual(self.data.y_unit, '1/cm') 53 50 self.assertEqual(self.data.x[0], 0.002618) … … 55 52 self.assertEqual(self.data.x[2], 0.01309) 56 53 self.assertEqual(self.data.x[126], 0.5828) 57 54 58 55 self.assertEqual(self.data.y[0], 0.02198) 59 56 self.assertEqual(self.data.y[1], 0.02201) 60 57 self.assertEqual(self.data.y[2], 0.02695) 61 58 self.assertEqual(self.data.y[126], 0.2958) 62 59 63 60 self.assertEqual(self.data.dy[0], 0.002704) 64 61 self.assertEqual(self.data.dy[1], 0.001643) 65 62 self.assertEqual(self.data.dy[2], 0.002452) 66 63 self.assertEqual(self.data.dy[126], 1) 67 64 68 65 def test_checkdata2(self): 69 66 self.assertEqual(self.data.dy[126], 1) … … 74 71 self.assertEqual(data.meta_data['loader'], "IGOR 1D") 75 72 76 77 class hfir_reader(unittest.TestCase): 73 class DanseReaderTests(unittest.TestCase): 78 74 79 75 def setUp(self): 80 reader = HFIRReader() 81 self.data = reader.read("S2-30dq.d1d") 82 83 def test_hfir_checkdata(self): 84 """ 85 Check the data content to see whether 86 it matches the specific file we loaded. 87 """ 88 self.assertEqual(self.data.filename, "S2-30dq.d1d") 89 # THIS FILE FORMAT IS CURRENTLY READ BY THE ASCII READER 90 self.assertEqual(self.data.meta_data['loader'], "HFIR 1D") 91 self.assertEqual(len(self.data.x), 134) 92 self.assertEqual(len(self.data.y), 134) 93 # Q I dI dQ 94 # Point 1: 0.003014 0.003010 0.000315 0.008249 95 self.assertEqual(self.data.x[1], 0.003014) 96 self.assertEqual(self.data.y[1], 0.003010) 97 self.assertEqual(self.data.dy[1], 0.000315) 98 self.assertEqual(self.data.dx[1], 0.008249) 99 100 def test_generic_loader(self): 101 # the generic loader should work as well 102 data = Loader().load("S2-30dq.d1d") 103 self.assertEqual(data.meta_data['loader'], "HFIR 1D") 104 105 106 class igor_reader(unittest.TestCase): 107 108 def setUp(self): 109 # the IgorReader should be able to read this filetype 110 # if it can't, stop here. 111 reader = IgorReader() 112 self.data = reader.read("MAR07232_rest.ASC") 113 114 def test_igor_checkdata(self): 115 """ 116 Check the data content to see whether 76 reader = DANSEReader() 77 self.data = reader.read("MP_New.sans") 78 79 def test_checkdata(self): 80 """ 81 Check the data content to see whether 117 82 it matches the specific file we loaded. 118 83 Check the units too to see whether the … … 120 85 tests won't pass 121 86 """ 122 self.assertEqual(self.data.filename, "MAR07232_rest.ASC")123 self.assertEqual(self.data.meta_data['loader'], "IGOR 2D")124 125 self.assertEqual(self.data.source.wavelength_unit, 'A')126 self.assertEqual(self.data.source.wavelength, 8.4)127 128 self.assertEqual(self.data.detector[0].distance_unit, 'mm')129 self.assertEqual(self.data.detector[0].distance, 13705)130 131 self.assertEqual(self.data.sample.transmission, 0.84357)132 133 self.assertEqual(self.data.detector[0].beam_center_unit, 'mm')134 center_x = (68.76 - 1)*5.0135 center_y = (62.47 - 1)*5.0136 self.assertEqual(self.data.detector[0].beam_center.x, center_x)137 self.assertEqual(self.data.detector[0].beam_center.y, center_y)138 139 self.assertEqual(self.data.I_unit, '1/cm')140 # 3 points should be suffcient to check that the data is in column141 # major order.142 np.testing.assert_almost_equal(self.data.data[0:3],143 [0.279783, 0.28951, 0.167634])144 np.testing.assert_almost_equal(self.data.qx_data[0:3],145 [-0.01849072, -0.01821785, -0.01794498])146 np.testing.assert_almost_equal(self.data.qy_data[0:3],147 [-0.01677435, -0.01677435, -0.01677435])148 149 def test_generic_loader(self):150 # the generic loader should direct the file to IgorReader as well151 data = Loader().load("MAR07232_rest.ASC")152 self.assertEqual(data.meta_data['loader'], "IGOR 2D")153 154 155 class danse_reader(unittest.TestCase):156 157 def setUp(self):158 reader = DANSEReader()159 self.data = reader.read("MP_New.sans")160 161 def test_checkdata(self):162 """163 Check the data content to see whether164 it matches the specific file we loaded.165 Check the units too to see whether the166 Data1D defaults changed. Otherwise the167 tests won't pass168 """169 87 self.assertEqual(self.data.filename, "MP_New.sans") 170 88 self.assertEqual(self.data.meta_data['loader'], "DANSE") 171 89 172 90 self.assertEqual(self.data.source.wavelength_unit, 'A') 173 91 self.assertEqual(self.data.source.wavelength, 7.5) 174 92 175 93 self.assertEqual(self.data.detector[0].distance_unit, 'mm') 176 94 self.assertAlmostEqual(self.data.detector[0].distance, 5414.99, 3) 177 95 178 96 self.assertEqual(self.data.detector[0].beam_center_unit, 'mm') 179 97 center_x = 68.74*5.0 … … 181 99 self.assertEqual(self.data.detector[0].beam_center.x, center_x) 182 100 self.assertEqual(self.data.detector[0].beam_center.y, center_y) 183 101 184 102 self.assertEqual(self.data.I_unit, '1/cm') 185 103 self.assertEqual(self.data.data[0], 1.57831) … … 196 114 self.assertEqual(data.meta_data['loader'], "DANSE") 197 115 198 116 199 117 class cansas_reader(unittest.TestCase): 200 118 201 119 def setUp(self): 202 120 reader = CANSASReader() … … 212 130 self.assertEqual(self.data.filename, "cansas1d.xml") 213 131 self._checkdata() 214 132 215 133 def _checkdata(self): 216 134 """ 217 Check the data content to see whether 135 Check the data content to see whether 218 136 it matches the specific file we loaded. 219 137 Check the units too to see whether the … … 223 141 self.assertEqual(self.data.run[0], "1234") 224 142 self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") 225 143 226 144 # Data 227 145 self.assertEqual(len(self.data.x), 2) … … 238 156 self.assertEqual(self.data.run_name['1234'], 'run name') 239 157 self.assertEqual(self.data.title, "Test title") 240 158 241 159 # Sample info 242 160 self.assertEqual(self.data.sample.ID, "SI600-new-long") … … 244 162 self.assertEqual(self.data.sample.thickness_unit, 'mm') 245 163 self.assertAlmostEqual(self.data.sample.thickness, 1.03) 246 164 247 165 self.assertAlmostEqual(self.data.sample.transmission, 0.327) 248 166 249 167 self.assertEqual(self.data.sample.temperature_unit, 'C') 250 168 self.assertEqual(self.data.sample.temperature, 0) … … 258 176 self.assertAlmostEqual(self.data.sample.orientation.y, 0.02, 6) 259 177 260 self.assertEqual(self.data.sample.details[0], "http://chemtools.chem.soton.ac.uk/projects/blog/blogs.php/bit_id/2720") 261 self.assertEqual(self.data.sample.details[1], "Some text here") 262 178 self.assertEqual(self.data.sample.details[0], "http://chemtools.chem.soton.ac.uk/projects/blog/blogs.php/bit_id/2720") 179 self.assertEqual(self.data.sample.details[1], "Some text here") 180 263 181 # Instrument info 264 182 self.assertEqual(self.data.instrument, "canSAS instrument") 265 183 266 184 # Source 267 185 self.assertEqual(self.data.source.radiation, "neutron") 268 186 269 187 self.assertEqual(self.data.source.beam_size_unit, "mm") 270 188 self.assertEqual(self.data.source.beam_size_name, "bm") 271 189 self.assertEqual(self.data.source.beam_size.x, 12) 272 190 self.assertEqual(self.data.source.beam_size.y, 13) 273 191 274 192 self.assertEqual(self.data.source.beam_shape, "disc") 275 193 276 194 self.assertEqual(self.data.source.wavelength_unit, "A") 277 195 self.assertEqual(self.data.source.wavelength, 6) 278 196 279 197 self.assertEqual(self.data.source.wavelength_max_unit, "nm") 280 198 self.assertAlmostEqual(self.data.source.wavelength_max, 1.0) … … 283 201 self.assertEqual(self.data.source.wavelength_spread_unit, "percent") 284 202 self.assertEqual(self.data.source.wavelength_spread, 14.3) 285 203 286 204 # Collimation 287 205 _found1 = False … … 289 207 self.assertEqual(self.data.collimation[0].length, 123.) 290 208 self.assertEqual(self.data.collimation[0].name, 'test coll name') 291 209 292 210 for item in self.data.collimation[0].aperture: 293 211 self.assertEqual(item.size_unit,'mm') … … 303 221 and item.type == 'radius': 304 222 _found2 = True 305 223 306 224 if _found1 == False or _found2 == False: 307 raise RuntimeError, "Could not find all data %s %s" % (_found1, _found2) 308 225 raise RuntimeError, "Could not find all data %s %s" % (_found1, _found2) 226 309 227 # Detector 310 228 self.assertEqual(self.data.detector[0].name, "fictional hybrid") 311 229 self.assertEqual(self.data.detector[0].distance_unit, "mm") 312 230 self.assertEqual(self.data.detector[0].distance, 4150) 313 231 314 232 self.assertEqual(self.data.detector[0].orientation_unit, "degree") 315 233 self.assertAlmostEqual(self.data.detector[0].orientation.x, 1.0, 6) 316 234 self.assertEqual(self.data.detector[0].orientation.y, 0.0) 317 235 self.assertEqual(self.data.detector[0].orientation.z, 0.0) 318 236 319 237 self.assertEqual(self.data.detector[0].offset_unit, "m") 320 238 self.assertEqual(self.data.detector[0].offset.x, .001) 321 239 self.assertEqual(self.data.detector[0].offset.y, .002) 322 240 self.assertEqual(self.data.detector[0].offset.z, None) 323 241 324 242 self.assertEqual(self.data.detector[0].beam_center_unit, "mm") 325 243 self.assertEqual(self.data.detector[0].beam_center.x, 322.64) 326 244 self.assertEqual(self.data.detector[0].beam_center.y, 327.68) 327 245 self.assertEqual(self.data.detector[0].beam_center.z, None) 328 246 329 247 self.assertEqual(self.data.detector[0].pixel_size_unit, "mm") 330 248 self.assertEqual(self.data.detector[0].pixel_size.x, 5) 331 249 self.assertEqual(self.data.detector[0].pixel_size.y, 5) 332 250 self.assertEqual(self.data.detector[0].pixel_size.z, None) 333 251 334 252 # Process 335 253 _found_term1 = False … … 349 267 and float(t['value']) == 10.0): 350 268 _found_term1 = True 351 269 352 270 if _found_term1 == False or _found_term2 == False: 353 271 raise RuntimeError, "Could not find all process terms %s %s" % (_found_term1, _found_term2) 354 272 355 273 def test_writer(self): 356 274 r = CANSASReader() … … 364 282 if os.path.isfile(filename): 365 283 os.remove(filename) 366 284 367 285 def test_units(self): 368 286 """ … … 375 293 self.assertEqual(self.data.filename, filename) 376 294 self._checkdata() 377 295 378 296 def test_badunits(self): 379 297 """ … … 389 307 # This one should 390 308 self.assertAlmostEqual(self.data.sample.transmission, 0.327) 391 309 392 310 self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") 393 311 print(self.data.errors) … … 403 321 self.assertEqual(self.data.filename, filename) 404 322 self.assertEqual(self.data.run[0], "1234") 405 323 406 324 # Data 407 325 self.assertEqual(len(self.data.x), 2) -
test/sasdataloader/test/utest_ascii.py
r959eb01 rad92c5a 6 6 7 7 import unittest 8 from sas.sascalc.dataloader.loader import Loader 9 10 import os.path 8 from sas.sascalc.dataloader.loader import Loader 11 9 12 class abs_reader(unittest.TestCase): 10 11 class ABSReaderTests(unittest.TestCase): 13 12 14 13 def setUp(self): 15 14 self.loader = Loader() 16 15 self.f1_list = self.loader.load("ascii_test_1.txt") 16 self.f1 = self.f1_list[0] 17 self.f2_list = self.loader.load("ascii_test_2.txt") 18 self.f2 = self.f2_list[0] 19 self.f3_list = self.loader.load("ascii_test_3.txt") 20 self.f3 = self.f3_list[0] 21 self.f4_list = self.loader.load("ascii_test_4.abs") 22 self.f4 = self.f4_list[0] 23 self.f5_list = self.loader.load("ascii_test_5.txt") 24 self.f5 = self.f5_list[0] 25 17 26 def test_checkdata(self): 18 27 """ 19 28 Test .ABS file loaded as ascii 20 29 """ 21 f = self.loader.load("ascii_test_1.txt")22 30 # The length of the data is 10 23 self.assertEqual(len( f.x), 10)24 self.assertEqual( f.x[0],0.002618)25 self.assertEqual( f.x[9],0.0497)26 self.assertEqual( f.x_unit, '1/A')27 self.assertEqual( f.y_unit, '1/cm')31 self.assertEqual(len(self.f1.x), 10) 32 self.assertEqual(self.f1.x[0],0.002618) 33 self.assertEqual(self.f1.x[9],0.0497) 34 self.assertEqual(self.f1.x_unit, '1/A') 35 self.assertEqual(self.f1.y_unit, '1/cm') 28 36 29 self.assertEqual( f.meta_data['loader'],"ASCII")30 37 self.assertEqual(self.f1.meta_data['loader'],"ASCII") 38 31 39 def test_truncated_1(self): 32 40 """ … … 38 46 as though it were the start of a footer). 39 47 """ 40 # Test .ABS file loaded as ascii 41 f = self.loader.load("ascii_test_2.txt") 42 # The length of the data is 10 43 self.assertEqual(len(f.x), 5) 44 self.assertEqual(f.x[0],0.002618) 45 self.assertEqual(f.x[4],0.02356) 46 48 # The length of the data is 5 49 self.assertEqual(len(self.f2.x), 5) 50 self.assertEqual(self.f2.x[0],0.002618) 51 self.assertEqual(self.f2.x[4],0.02356) 52 47 53 def test_truncated_2(self): 48 54 """ … … 52 58 reading at the first inconsitent line. 53 59 """ 54 # Test .ABS file loaded as ascii55 f = self.loader.load("ascii_test_3.txt")56 60 # The length of the data is 5 57 self.assertEqual(len( f.x), 5)58 self.assertEqual( f.x[0],0.002618)59 self.assertEqual( f.x[4],0.02356)60 61 self.assertEqual(len(self.f3.x), 5) 62 self.assertEqual(self.f3.x[0],0.002618) 63 self.assertEqual(self.f3.x[4],0.02356) 64 61 65 def test_truncated_3(self): 62 66 """ … … 66 70 reading at the last line of header. 67 71 """ 68 # Test .ABS file loaded as ascii69 f = self.loader.load("ascii_test_4.abs")70 72 # The length of the data is 5 71 self.assertEqual(len( f.x), 5)72 self.assertEqual( f.x[0],0.012654)73 self.assertEqual( f.x[4],0.02654)74 73 self.assertEqual(len(self.f4.x), 5) 74 self.assertEqual(self.f4.x[0],0.012654) 75 self.assertEqual(self.f4.x[4],0.02654) 76 75 77 def test_truncated_4(self): 76 78 """ … … 78 80 Only the last 5 2-col lines should be read. 79 81 """ 80 # Test .ABS file loaded as ascii81 f = self.loader.load("ascii_test_5.txt")82 82 # The length of the data is 5 83 self.assertEqual(len( f.x), 5)84 self.assertEqual( f.x[0],0.02879)85 self.assertEqual( f.x[4],0.0497)86 83 self.assertEqual(len(self.f5.x), 5) 84 self.assertEqual(self.f5.x[0],0.02879) 85 self.assertEqual(self.f5.x[4],0.0497) 86 87 87 def test_truncated_5(self): 88 88 """ 89 Test a 6-col ascii file with complex header where one of them has a letter and90 many lines with 2 or 2 columns in the middle of the data section.91 Only last four lines should be read.89 Test a 6-col ascii file with complex header where one of them has a 90 letter and many lines with 2 or 2 columns in the middle of the data 91 section. Will be rejected because fewer than 5 lines. 92 92 """ 93 93 # Test .ABS file loaded as ascii … … 98 98 except: 99 99 self.assertEqual(f, None) 100 100 101 101 if __name__ == '__main__': 102 102 unittest.main() -
test/sasdataloader/test/utest_averaging.py
re123eb9 r2a52b0e 46 46 # respectively. 47 47 self.qmin = get_q(1.0, 1.0, detector.distance, source.wavelength) 48 49 48 self.qmax = get_q(49.5, 49.5, detector.distance, source.wavelength) 50 49 … … 104 103 def setUp(self): 105 104 filepath = os.path.join(os.path.dirname( 106 os.path.realpath(__file__)), 'MAR07232_rest. ASC')107 self.data = Loader().load(filepath) 105 os.path.realpath(__file__)), 'MAR07232_rest.h5') 106 self.data = Loader().load(filepath)[0] 108 107 109 108 def test_ring(self): … … 120 119 filepath = os.path.join(os.path.dirname( 121 120 os.path.realpath(__file__)), 'ring_testdata.txt') 122 answer = Loader().load(filepath) 121 answer = Loader().load(filepath)[0] 123 122 124 123 for i in range(r.nbins_phi - 1): … … 140 139 filepath = os.path.join(os.path.dirname( 141 140 os.path.realpath(__file__)), 'avg_testdata.txt') 142 answer = Loader().load(filepath) 141 answer = Loader().load(filepath)[0] 143 142 for i in range(r.nbins_phi): 144 143 self.assertAlmostEqual(o.x[i], answer.x[i], 4) … … 176 175 filepath = os.path.join(os.path.dirname( 177 176 os.path.realpath(__file__)), 'slabx_testdata.txt') 178 answer = Loader().load(filepath) 177 answer = Loader().load(filepath)[0] 179 178 for i in range(len(o.x)): 180 179 self.assertAlmostEqual(o.x[i], answer.x[i], 4) … … 195 194 filepath = os.path.join(os.path.dirname( 196 195 os.path.realpath(__file__)), 'slaby_testdata.txt') 197 answer = Loader().load(filepath) 196 answer = Loader().load(filepath)[0] 198 197 for i in range(len(o.x)): 199 198 self.assertAlmostEqual(o.x[i], answer.x[i], 4) … … 204 203 """ 205 204 Test sector averaging I(phi) 206 When considering the whole azimuthal range (2pi), 205 When considering the whole azimuthal range (2pi), 207 206 the answer should be the same as ring averaging. 208 207 The test data was not generated by IGOR. … … 222 221 filepath = os.path.join(os.path.dirname( 223 222 os.path.realpath(__file__)), 'ring_testdata.txt') 224 answer = Loader().load(filepath) 223 answer = Loader().load(filepath)[0] 225 224 for i in range(len(o.x)): 226 225 self.assertAlmostEqual(o.x[i], answer.x[i], 4) … … 240 239 filepath = os.path.join(os.path.dirname( 241 240 os.path.realpath(__file__)), 'sectorphi_testdata.txt') 242 answer = Loader().load(filepath) 241 answer = Loader().load(filepath)[0] 243 242 for i in range(len(o.x)): 244 243 self.assertAlmostEqual(o.x[i], answer.x[i], 4) … … 258 257 filepath = os.path.join(os.path.dirname( 259 258 os.path.realpath(__file__)), 'sectorq_testdata.txt') 260 answer = Loader().load(filepath) 259 answer = Loader().load(filepath)[0] 261 260 for i in range(len(o.x)): 262 261 self.assertAlmostEqual(o.x[i], answer.x[i], 4) … … 277 276 for i in range(len(o.x)): 278 277 self.assertAlmostEqual(o.x[i], expected_binning[i], 3) 279 278 280 279 # TODO: Test for Y values (o.y) 281 280 # print len(self.data.x_bins) … … 288 287 # xedges_width = (xedges[1] - xedges[0]) 289 288 # xedges_center = xedges[1:] - xedges_width / 2 290 289 291 290 # yedges_width = (yedges[1] - yedges[0]) 292 291 # yedges_center = yedges[1:] - yedges_width / 2 293 292 294 293 # print H.flatten().shape 295 294 # print o.y.shape 296 295 297 296 298 297 if __name__ == '__main__': -
test/sasdataloader/test/utest_red2d_reader.py
r959eb01 r248ff73 7 7 import unittest 8 8 from sas.sascalc.dataloader.loader import Loader 9 9 10 10 import os.path 11 11 12 12 class abs_reader(unittest.TestCase): 13 13 14 14 def setUp(self): 15 15 self.loader = Loader() 16 16 17 17 def test_checkdata(self): 18 18 """ 19 19 Test .DAT file loaded as IGOR/DAT 2D Q_map 20 20 """ 21 f = self.loader.load("exp18_14_igor_2dqxqy.dat") 21 f = self.loader.load("exp18_14_igor_2dqxqy.dat")[0] 22 22 # The length of the data is 10 23 23 self.assertEqual(len(f.qx_data), 36864) … … 26 26 self.assertEqual(f.Q_unit, '1/A') 27 27 self.assertEqual(f.I_unit, '1/cm') 28 28 29 29 self.assertEqual(f.meta_data['loader'],"IGOR/DAT 2D Q_map") 30 31 30 31 32 32 if __name__ == '__main__': 33 33 unittest.main() 34
Note: See TracChangeset
for help on using the changeset viewer.