Commit f68c6646 authored by Javier Quinteros's avatar Javier Quinteros
Browse files

Include more debug messages and comments

parent 5ba001eb
......@@ -651,6 +651,8 @@ class TDMS(object):
logs.debug('Flushing: %s %s' % (nodecimation[ch][-leftover::self.__decimate],
outbuf[ch]['stats']))
del outbuf[ch]
else:
logs.debug('Nothing to flush after GAP')
# self.__buffer[ch] = None
del expectedtime[ch]
# Start the processing of a new chunk after the gap
......@@ -667,7 +669,7 @@ class TDMS(object):
else:
inbuf[ch]['data'] = np.append(inbuf[ch]['data'], data)
# Store values resulting from the convolution
# Set values of stats for the output buffer resulting from the convolution
if ch not in outbuf:
# Initialize an idx and array with the first chunk of data
outbuf[ch] = {'stats': inbuf[ch]['stats'].copy()}
......@@ -696,7 +698,9 @@ class TDMS(object):
# Check if we can copy as many components as a multiple of the decimation factor
leftover = len(nodecimation[ch]) % self.__decimate
logs.debug('filtered: leave %d components for next iteration %s' % (leftover, nodecimation[ch][-leftover:]))
logs.debug('filtered: leave %d components for next iteration %s' %
(leftover, nodecimation[ch][-leftover:]))
if leftover:
if 'data' not in outbuf[ch]:
# Take samples each "self.__decimate" components
......@@ -728,7 +732,7 @@ class TDMS(object):
# If there is enough data
if len(outbuf[ch]['data']) > 2000:
outbuf[ch]['stats']['npts'] = len(outbuf[ch]['data'])
# print('outbuf: %s npts' % outbuf[ch]['index'])
logs.debug('Sending: %s %s' % (outbuf[ch]['stats'], outbuf[ch]['data']))
yield outbuf[ch]['data'], outbuf[ch]['stats']
# Reset outbuf with an empty array and the next starttime (in headers)
outbuf[ch]['stats']['starttime'] += len(outbuf[ch]['data']) / outbuf[ch]['stats']['sampling_rate']
......@@ -738,6 +742,7 @@ class TDMS(object):
for ch in outbuf:
if ('data' in outbuf[ch]) and len(outbuf[ch]['data']):
outbuf[ch]['stats']['npts'] = len(outbuf[ch]['data'])
logs.debug('Sending: %s %s' % (outbuf[ch]['stats'], outbuf[ch]['data']))
yield outbuf[ch]['data'], outbuf[ch]['stats']
def __iter_data__(self):
......
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