Changeset 1b7842d in sasview
- Timestamp:
- Apr 10, 2017 12:02:20 PM (8 years ago)
- Children:
- c8780f11
- Parents:
- 9a39657
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader.py
r9a39657 r1b7842d 220 220 multipleEntries = True 221 221 222 if sasNode[0].text is not None:223 for setupNode in sasNode[0]:222 for setupNode in sasNode[0]: 223 if setupNode.text is not None: 224 224 # Iterating through the tags in the unit node, getting their tag name and respective unit 225 225 setupTagName = setupNode.tag.replace(self.base_ns, "") … … 279 279 pass 280 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 281 # If there's more data present, let's deal with that too 282 for loopIter in range(1, len(sasNode)): 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 309 310 self._check_for_empty_resolution() 311 self.data.append(self.current_dataset) 312 312 313 313 # If it's not data, let's check for other tags starting with skippable ones... … … 574 574 elif currentTagName == "SASprocess": 575 575 for processNode in sasNode: 576 processTagName = setupNode.tag.replace(self.base_ns, "")577 units = setupNode.attrib.get("unit", "")576 processTagName = processNode.tag.replace(self.base_ns, "") 577 units = processNode.attrib.get("unit", "") 578 578 579 579 if processTagName == "name": … … 615 615 multipleEntries == True 616 616 617 if sasNode[0].text is not None:618 for setupNode in sasNode[0]:617 for setupNode in sasNode[0]: 618 if setupNode.text is not None: 619 619 # Iterating through the tags in the unit node, getting their tag name and respective unit 620 620 setupTagName = setupNode.tag.replace(self.base_ns, "") … … 641 641 self.transspectrum.wavelength_unit = transmissionDataUnits 642 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 643 # If there's more data present, let's deal with that too 644 for loopIter in range(1, len(sasNode)): 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 655 656 self.current_datainfo.trans_spectrum.append(self.transspectrum) 657 self.transspectrum = TransmissionSpectrum() 658 658 659 659
Note: See TracChangeset
for help on using the changeset viewer.