Ignore:
Timestamp:
Aug 29, 2018 10:01:23 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
9463ca2
Parents:
ce30949
git-author:
Piotr Rozyczko <rozyczko@…> (08/29/18 09:59:56)
git-committer:
Piotr Rozyczko <rozyczko@…> (08/29/18 10:01:23)
Message:

cherry picking sascalc changes from master SASVIEW-996
minor unit test fixes

File:
1 edited

Legend:

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

    r1efbc190 rb8080e1  
    2929    type_name = "IGOR 1D" 
    3030    # Wildcards 
    31     type = ["IGOR 1D files (*.abs)|*.abs"] 
     31    type = ["IGOR 1D files (*.abs)|*.abs", "IGOR 1D USANS files (*.cor)|*.cor"] 
    3232    # List of allowed extensions 
    33     ext = ['.abs'] 
     33    ext = ['.abs', '.cor'] 
    3434 
    3535    def get_file_contents(self): 
     
    4646        self.current_datainfo = DataInfo() 
    4747        self.current_datainfo.filename = filepath 
    48         self.reset_data_list(len(lines)) 
    4948        detector = Detector() 
    5049        data_line = 0 
     
    172171 
    173172                try: 
    174                     _x = float(toks[0]) 
     173                    _x = float(toks[4]) 
    175174                    _y = float(toks[1]) 
    176175                    _dy = float(toks[2]) 
     
    188187                    self.current_dataset.y[data_line] = _y 
    189188                    self.current_dataset.dy[data_line] = _dy 
    190                     self.current_dataset.dx[data_line] = _dx 
     189                    if _dx > 0: 
     190                        self.current_dataset.dx[data_line] = _dx 
     191                    else: 
     192                        if data_line == 0: 
     193                            self.current_dataset.dx = None 
     194                            self.current_dataset.dxl = np.zeros(len(lines)) 
     195                            self.current_dataset.dxw = np.zeros(len(lines)) 
     196                        self.current_dataset.dxl[data_line] = abs(_dx) 
     197                        self.current_dataset.dxw[data_line] = 0 
    191198                    data_line += 1 
    192199 
     
    197204                    pass 
    198205 
     206            # SANS Data: 
    199207            # The 6 columns are | Q (1/A) | I(Q) (1/cm) | std. dev. 
    200208            # I(Q) (1/cm) | sigmaQ | meanQ | ShadowFactor| 
    201             if line.count("The 6 columns") > 0: 
     209            # USANS Data: 
     210            # EMP LEVEL: <value> ; BKG LEVEL: <value> 
     211            if line.startswith("The 6 columns") or line.startswith("EMP LEVEL"): 
    202212                is_data_started = True 
    203213 
Note: See TracChangeset for help on using the changeset viewer.