Changeset 0d64713 in sasview for src/sas/sascalc/dataloader/readers/cansas_reader.py
- Timestamp:
- Feb 28, 2017 11:17:19 AM (7 years ago)
- Children:
- 13043af
- Parents:
- 46f798f
- git-author:
- Jeff Krzywon <krzywon@…> (02/28/17 11:17:19)
- git-committer:
- GitHub <noreply@…> (02/28/17 11:17:19)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader.py
rc221349 r0d64713 261 261 # I and Q - 1D data 262 262 elif tagname == 'I' and isinstance(self.current_dataset, plottable_1D): 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) 263 self.current_dataset.yaxis("Intensity", unit) 269 264 self.current_dataset.y = np.append(self.current_dataset.y, data_point) 270 265 elif tagname == 'Idev' and isinstance(self.current_dataset, plottable_1D): 271 266 self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 272 267 elif tagname == 'Q': 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) 268 self.current_dataset.xaxis("Q", unit) 279 269 self.current_dataset.x = np.append(self.current_dataset.x, data_point) 280 270 elif tagname == 'Qdev': … … 288 278 elif tagname == 'Shadowfactor': 289 279 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)294 280 295 281 # I and Qx, Qy - 2D data … … 1034 1020 node.append(point) 1035 1021 self.write_node(point, "Q", datainfo.x[i], 1036 {'unit': datainfo. _xaxis + " | " + datainfo._xunit})1022 {'unit': datainfo.x_unit}) 1037 1023 if len(datainfo.y) >= i: 1038 1024 self.write_node(point, "I", datainfo.y[i], 1039 {'unit': datainfo. _yaxis + " | " + datainfo._yunit})1025 {'unit': datainfo.y_unit}) 1040 1026 if datainfo.dy is not None and len(datainfo.dy) > i: 1041 1027 self.write_node(point, "Idev", datainfo.dy[i], 1042 {'unit': datainfo. _yaxis + " | " + datainfo._yunit})1028 {'unit': datainfo.y_unit}) 1043 1029 if datainfo.dx is not None and len(datainfo.dx) > i: 1044 1030 self.write_node(point, "Qdev", datainfo.dx[i], 1045 {'unit': datainfo. _xaxis + " | " + datainfo._xunit})1031 {'unit': datainfo.x_unit}) 1046 1032 if datainfo.dxw is not None and len(datainfo.dxw) > i: 1047 1033 self.write_node(point, "dQw", datainfo.dxw[i], 1048 {'unit': datainfo. _xaxis + " | " + datainfo._xunit})1034 {'unit': datainfo.x_unit}) 1049 1035 if datainfo.dxl is not None and len(datainfo.dxl) > i: 1050 1036 self.write_node(point, "dQl", datainfo.dxl[i], 1051 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 1052 if datainfo.isSesans: 1053 sesans = self.create_element("Sesans") 1054 sesans.text = str(datainfo.isSesans) 1055 node.append(sesans) 1056 self.write_node(node, "zacceptance", datainfo.sample.zacceptance[0], 1057 {'unit': datainfo.sample.zacceptance[1]}) 1058 1037 {'unit': datainfo.x_unit}) 1059 1038 1060 1039 def _write_data_2d(self, datainfo, entry_node):
Note: See TracChangeset
for help on using the changeset viewer.