Commit 86abf016 authored by Javier Quinteros's avatar Javier Quinteros
Browse files

Remove buffers after being used inside a loop

parent 47a49423
......@@ -717,6 +717,9 @@ class TDMS(object):
# Add samples each "self.__decimate" components
outbuf[ch]['data'] = np.append(outbuf[ch]['data'], nodecimation[ch][::self.__decimate])
# Remove filtered signal after copying it to the output buffer
del nodecimation[ch]
logs.debug('outbuf[%d][:11] %s' % (ch, outbuf[ch]['data'][:11]))
logs.debug('outbuf[%d][-11:] %s' % (ch, outbuf[ch]['data'][-11:]))
......@@ -744,6 +747,8 @@ class TDMS(object):
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']
outbuf[ch]['stats']['starttime'] += len(outbuf[ch]['data']) / outbuf[ch]['stats']['sampling_rate']
del outbuf[ch]['data']
def __iter_data__(self):
"""Read data from files based on channel selection
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