Ignore:
Timestamp:
Jan 21, 2019 8:15:40 AM (5 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
d541324e
Parents:
3ca645bb
git-author:
Piotr Rozyczko <piotr.rozyczko@…> (01/21/19 08:12:08)
git-committer:
Piotr Rozyczko <piotr.rozyczko@…> (01/21/19 08:15:40)
Message:

Updated cansas read (cherrypicked and fixed from master).
Fixes: hdf5 returns byte strings so these need to be recasted properly.
https://github.com/h5py/h5py/issues/379

File:
1 edited

Legend:

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

    rb8080e1 r8db20a9  
    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]) 
     
    225228            raise ValueError("ascii_reader: could not load file") 
    226229 
     230        self.current_dataset = self.set_default_1d_units(self.current_dataset) 
    227231        if data_conv_q is not None: 
    228232            self.current_dataset.xaxis("\\rm{Q}", base_q_unit) 
    229         else: 
    230             self.current_dataset.xaxis("\\rm{Q}", 'A^{-1}') 
    231233        if data_conv_i is not None: 
    232234            self.current_dataset.yaxis("\\rm{Intensity}", base_i_unit) 
    233         else: 
    234             self.current_dataset.yaxis("\\rm{Intensity}", "cm^{-1}") 
    235235 
    236236        # Store loading process information 
Note: See TracChangeset for help on using the changeset viewer.