Changes in src/sas/sascalc/dataloader/readers/cansas_reader.py [bcabf4e:8434365] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader.py
rbcabf4e r8434365 261 261 # I and Q - 1D data 262 262 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) 264 269 self.current_dataset.y = np.append(self.current_dataset.y, data_point) 265 270 elif tagname == 'Idev' and isinstance(self.current_dataset, plottable_1D): 266 271 self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 267 272 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) 269 279 self.current_dataset.x = np.append(self.current_dataset.x, data_point) 270 280 elif tagname == 'Qdev': … … 278 288 elif tagname == 'Shadowfactor': 279 289 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) 280 294 281 295 # I and Qx, Qy - 2D data … … 916 930 self._write_data(datainfo, entry_node) 917 931 # 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) 919 934 # Sample info 920 935 self._write_sample_info(datainfo, entry_node) … … 1020 1035 node.append(point) 1021 1036 self.write_node(point, "Q", datainfo.x[i], 1022 {'unit': datainfo. x_unit})1037 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 1023 1038 if len(datainfo.y) >= i: 1024 1039 self.write_node(point, "I", datainfo.y[i], 1025 {'unit': datainfo. y_unit})1040 {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 1026 1041 if datainfo.dy is not None and len(datainfo.dy) > i: 1027 1042 self.write_node(point, "Idev", datainfo.dy[i], 1028 {'unit': datainfo. y_unit})1043 {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 1029 1044 if datainfo.dx is not None and len(datainfo.dx) > i: 1030 1045 self.write_node(point, "Qdev", datainfo.dx[i], 1031 {'unit': datainfo. x_unit})1046 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 1032 1047 if datainfo.dxw is not None and len(datainfo.dxw) > i: 1033 1048 self.write_node(point, "dQw", datainfo.dxw[i], 1034 {'unit': datainfo. x_unit})1049 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 1035 1050 if datainfo.dxl is not None and len(datainfo.dxl) > i: 1036 1051 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 1038 1060 1039 1061 def _write_data_2d(self, datainfo, entry_node):
Note: See TracChangeset
for help on using the changeset viewer.