Ignore:
File:
1 edited

Legend:

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

    rbcabf4e r8434365  
    261261                # I and Q - 1D data 
    262262                elif tagname == 'I' and isinstance(self.current_dataset, plottable_1D): 
    263                     self.current_dataset.yaxis("Intensity", unit) 
     263                    unit_list = unit.split("|") 
     264                    if len(unit_list) > 1: 
     265                        self.current_dataset.yaxis(unit_list[0].strip(), 
     266                                                   unit_list[1].strip()) 
     267                    else: 
     268                        self.current_dataset.yaxis("Intensity", unit) 
    264269                    self.current_dataset.y = np.append(self.current_dataset.y, data_point) 
    265270                elif tagname == 'Idev' and isinstance(self.current_dataset, plottable_1D): 
    266271                    self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 
    267272                elif tagname == 'Q': 
    268                     self.current_dataset.xaxis("Q", unit) 
     273                    unit_list = unit.split("|") 
     274                    if len(unit_list) > 1: 
     275                        self.current_dataset.xaxis(unit_list[0].strip(), 
     276                                                   unit_list[1].strip()) 
     277                    else: 
     278                        self.current_dataset.xaxis("Q", unit) 
    269279                    self.current_dataset.x = np.append(self.current_dataset.x, data_point) 
    270280                elif tagname == 'Qdev': 
     
    278288                elif tagname == 'Shadowfactor': 
    279289                    pass 
     290                elif tagname == 'Sesans': 
     291                    self.current_datainfo.isSesans = bool(data_point) 
     292                elif tagname == 'zacceptance': 
     293                    self.current_datainfo.sample.zacceptance = (data_point, unit) 
    280294 
    281295                # I and Qx, Qy - 2D data 
     
    916930            self._write_data(datainfo, entry_node) 
    917931        # Transmission Spectrum Info 
    918         self._write_trans_spectrum(datainfo, entry_node) 
     932        # TODO: fix the writer to linearize all data, including T_spectrum 
     933        # self._write_trans_spectrum(datainfo, entry_node) 
    919934        # Sample info 
    920935        self._write_sample_info(datainfo, entry_node) 
     
    10201035            node.append(point) 
    10211036            self.write_node(point, "Q", datainfo.x[i], 
    1022                             {'unit': datainfo.x_unit}) 
     1037                            {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
    10231038            if len(datainfo.y) >= i: 
    10241039                self.write_node(point, "I", datainfo.y[i], 
    1025                                 {'unit': datainfo.y_unit}) 
     1040                                {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 
    10261041            if datainfo.dy is not None and len(datainfo.dy) > i: 
    10271042                self.write_node(point, "Idev", datainfo.dy[i], 
    1028                                 {'unit': datainfo.y_unit}) 
     1043                                {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 
    10291044            if datainfo.dx is not None and len(datainfo.dx) > i: 
    10301045                self.write_node(point, "Qdev", datainfo.dx[i], 
    1031                                 {'unit': datainfo.x_unit}) 
     1046                                {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
    10321047            if datainfo.dxw is not None and len(datainfo.dxw) > i: 
    10331048                self.write_node(point, "dQw", datainfo.dxw[i], 
    1034                                 {'unit': datainfo.x_unit}) 
     1049                                {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
    10351050            if datainfo.dxl is not None and len(datainfo.dxl) > i: 
    10361051                self.write_node(point, "dQl", datainfo.dxl[i], 
    1037                                 {'unit': datainfo.x_unit}) 
     1052                                {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
     1053        if datainfo.isSesans: 
     1054            sesans = self.create_element("Sesans") 
     1055            sesans.text = str(datainfo.isSesans) 
     1056            node.append(sesans) 
     1057            self.write_node(node, "zacceptance", datainfo.sample.zacceptance[0], 
     1058                             {'unit': datainfo.sample.zacceptance[1]}) 
     1059 
    10381060 
    10391061    def _write_data_2d(self, datainfo, entry_node): 
Note: See TracChangeset for help on using the changeset viewer.