Commit f341311d authored by Javier Quinteros's avatar Javier Quinteros

Add id to the metadata entry for each channel and filter its iteration based on id

parent dea34302
......@@ -299,7 +299,9 @@ class TDMS(object):
else:
self.metadata[obj]['data'] = True
self.metadata[obj]['id'] = numChannels
numChannels += 1
# There is raw data!
sizeBytes = None
datatype, arraylen, numValues = struct.unpack('%cIIQ' % self.__endian, self.__fi.read(16))
......@@ -561,9 +563,13 @@ class TDMS(object):
# Metadata
# logs = logging.getLogger('Iterate Metadata')
channels = list(range(self.__chstart, self.__chstop+1, self.__chstep))
while (self.__twend is None) or (self.__twstart < self.__twend):
for ch in self.metadata:
yield self.metadata[ch]
for obj in self.metadata:
if 'id' in self.metadata[obj] and self.metadata[obj]['id'] not in channels:
continue
yield self.metadata[obj]
# No more data in this file. Skip to the next one.
self.__currentfile += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment