source: sasview/sansdataloader/test/utest_red2d_reader.py @ 4a65d80

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 4a65d80 was ca3b9c5d, checked in by Jae Cho <jhjcho@…>, 13 years ago

update dataloader name

  • Property mode set to 100644
File size: 907 bytes
RevLine 
[46fe6a6]1"""
2    Unit tests for the red2d (3-7-column) reader
3"""
4import warnings
5warnings.simplefilter("ignore")
6
7import unittest
[ca3b9c5d]8from sans.dataloader.loader import  Loader
[46fe6a6]9 
10import os.path
11
12class abs_reader(unittest.TestCase):
13   
14    def setUp(self):
15        self.loader = Loader()
16       
17    def test_checkdata(self):
18        """
19            Test .DAT file loaded as IGOR/DAT 2D Q_map
20        """
21        f = self.loader.load("exp18_14_igor_2dqxqy.dat")
22        # The length of the data is 10
23        self.assertEqual(len(f.qx_data),  36864)
24        self.assertEqual(f.qx_data[0],-0.03573497)
25        self.assertEqual(f.qx_data[36863],0.2908819)
26        self.assertEqual(f.Q_unit, '1/A')
27        self.assertEqual(f.I_unit, '1/cm')
28       
29        self.assertEqual(f.meta_data['loader'],"IGOR/DAT 2D Q_map")
30       
31       
32if __name__ == '__main__':
33    unittest.main()
34   
Note: See TracBrowser for help on using the repository browser.