Changeset 3053


Ignore:
Timestamp:
Sep 6, 2017 4:04:40 PM (4 years ago)
Author:
vondreele
Message:

read multiple scans in a Panalytical xrdml file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2pwd_Panalytical.py

    r3052 r3053  
    5959        sample = self.root.find(tag+'sample')
    6060        self.idstring = ospath.basename(filename) + ' Scan '+str(blockNum)
    61         dataSets = self.root.findall(tag+'xrdMeasurement')
    62         if blockNum-1 == len(dataSets):
    63             self.repeat = False
    64             return False
    65         data = dataSets[blockNum-1]
    66         if len(dataSets) > 1:
    67             self.repeat = True
     61        data = self.root.find(tag+'xrdMeasurement')
    6862        wave = data.find(tag+'usedWavelength')
    6963        incident = data.find(tag+'incidentBeamPath')
    7064        radius = float(incident.find(tag+'radius').text)
    7165        tube = incident.find(tag+'xRayTube')
    72         scan = data.find(tag+'scan')
     66        scans = data.findall(tag+'scan')
     67        if len(scans) > 1:
     68            self.repeat = True
     69        if blockNum-1 == len(scans):
     70            self.repeat = False
     71            return False
     72        scan = scans[blockNum-1]
    7373        header = scan.find(tag+'header')
    7474        dataPoints = scan.find(tag+'dataPoints')
Note: See TracChangeset for help on using the changeset viewer.