Changeset c8780f11 in sasview
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader.py
r1b7842d rc8780f11 282 282 for loopIter in range(1, len(sasNode)): 283 283 for dataNode in sasNode[loopIter]: 284 # Iterating through the tags in the unit node, getting their tag name and respective unit 285 dataTagName = dataNode.tag.replace(self.base_ns, "") 286 # Creating our data array first 287 dataArray = np.fromstring(dataNode.text, dtype=float, sep=",") 288 289 if dataTagName == "I": 290 self.current_dataset.y[loopIter] = dataArray 291 elif dataTagName == "Q": 292 self.current_dataset.x[loopIter] = dataArray 293 elif dataTagName == "Idev": 294 self.current_dataset.dy[loopIter] = dataArray 295 elif dataTagName == "Qdev": 296 self.current_dataset.dx[loopIter] = dataArray 297 elif dataTagName == "Qx": 298 self.current_dataset.qx_data[loopIter] = dataArray 299 elif dataTagName == "Qy": 300 self.current_dataset.qy_data[loopIter] = dataArray 301 elif dataTagName == "Qxdev": 302 self.current_dataset.dqx_data[loopIter] = dataArray 303 elif dataTagName == "Qydev": 304 self.current_dataset.dqy_data[loopIter] = dataArray 305 elif dataTagName == "dQw": 306 self.current_dataset.dxw[loopIter] = dataArray 307 elif dataTagName == "dQl": 308 self.current_dataset.dxl[loopIter] = dataArray 284 if dataNode.text is not None: 285 # Iterating through the tags in the unit node, getting their tag name and respective unit 286 dataTagName = dataNode.tag.replace(self.base_ns, "") 287 # Creating our data array first 288 dataArray = np.fromstring(dataNode.text, dtype=float, sep=",") 289 290 if dataTagName == "I": 291 self.current_dataset.y[loopIter] = dataArray 292 elif dataTagName == "Q": 293 self.current_dataset.x[loopIter] = dataArray 294 elif dataTagName == "Idev": 295 self.current_dataset.dy[loopIter] = dataArray 296 elif dataTagName == "Qdev": 297 self.current_dataset.dx[loopIter] = dataArray 298 elif dataTagName == "Qx": 299 self.current_dataset.qx_data[loopIter] = dataArray 300 elif dataTagName == "Qy": 301 self.current_dataset.qy_data[loopIter] = dataArray 302 elif dataTagName == "Qxdev": 303 self.current_dataset.dqx_data[loopIter] = dataArray 304 elif dataTagName == "Qydev": 305 self.current_dataset.dqy_data[loopIter] = dataArray 306 elif dataTagName == "dQw": 307 self.current_dataset.dxw[loopIter] = dataArray 308 elif dataTagName == "dQl": 309 self.current_dataset.dxl[loopIter] = dataArray 309 310 310 311 self._check_for_empty_resolution() … … 587 588 self.process.date = processNode.text 588 589 elif processTagName == "term": 589 unit = attr.get("unit", "")590 590 dic = {} 591 591 dic["name"] = processNode.attrib.get("name", "") … … 644 644 for loopIter in range(1, len(sasNode)): 645 645 for dataNode in sasNode[loopIter]: 646 dataTagName = dataNode.tag.replace(self.base_ns, "") 647 dataArray = np.fromstring(dataNode.text, dtype=float, sep=",") 648 649 if dataTagName == "T": 650 self.transspectrum.transmission[loopIter] = dataArray 651 elif dataTagName == "Tdev": 652 self.transspectrum.transmission_deviation[loopIter] = dataArray 653 elif dataTagName == "Lambda": 654 self.transspectrum.wavelength[loopIter] = dataArray 646 if dataNode.text is not None: 647 dataTagName = dataNode.tag.replace(self.base_ns, "") 648 dataArray = np.fromstring(dataNode.text, dtype=float, sep=",") 649 650 if dataTagName == "T": 651 self.transspectrum.transmission[loopIter] = dataArray 652 elif dataTagName == "Tdev": 653 self.transspectrum.transmission_deviation[loopIter] = dataArray 654 elif dataTagName == "Lambda": 655 self.transspectrum.wavelength[loopIter] = dataArray 655 656 656 657 self.current_datainfo.trans_spectrum.append(self.transspectrum)
Note: See TracChangeset
for help on using the changeset viewer.