Changeset d96744de in sasview


Ignore:
Timestamp:
Dec 21, 2018 10:34:39 AM (6 years ago)
Author:
Jeff Krzywon <jkrzywon@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249
Children:
1342f6a
Parents:
109afbd
Message:

Fix for loading USANS data in ABS reader including fixes to unit tests.

Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/abs_reader.py

    r35ac8df rd96744de  
    4848        detector = Detector() 
    4949        data_line = 0 
     50        x_index = 4 
    5051        self.reset_data_list(len(lines)) 
    5152        self.current_datainfo.detector.append(detector) 
     
    6364        for line in lines: 
    6465            # Information line 1 
     66            if line.find(".bt5") > 0: 
     67                x_index = 0 
    6568            if is_info: 
    6669                is_info = False 
     
    171174 
    172175                try: 
    173                     _x = float(toks[4]) 
     176                    _x = float(toks[x_index]) 
    174177                    _y = float(toks[1]) 
    175178                    _dy = float(toks[2]) 
  • test/sasdataloader/test/utest_abs_reader.py

    rf4e2f22 rd96744de  
    7777 
    7878    def test_usans_negative_dxl(self): 
    79         data_abs = Loader().load(find("sam14_cor.ABS")) 
    80         data_cor = Loader().load(find("sam14_cor.cor")) 
    81         for i in range(0, len(data_abs) - 1): 
     79        data_abs = Loader().load(find("sam14_cor.ABS"))[0] 
     80        data_cor = Loader().load(find("sam14_cor.txt"))[0] 
     81        for i in range(0, len(data_abs.x) - 1): 
    8282            self.assertEqual(data_abs.x[i], data_cor.x[i]) 
    8383            self.assertEqual(data_abs.y[i], data_cor.y[i]) 
    84             self.assertEqual(data_abs.dxl[i], data_cor.dxl[i]) 
    85             self.assertEqual(data_abs.dxw[i], data_cor.dxw[i]) 
    86             self.assertTrue(data_abs.dxl > 0) 
     84            self.assertEqual(data_abs.dxl[i], -data_cor.dx[i]) 
     85            self.assertTrue(data_abs.dxl[i] > 0) 
    8786 
    8887 
Note: See TracChangeset for help on using the changeset viewer.