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

Adjust start and end time to take into account the length of filter

parent 70055a5f
__version__ = '0.7a1'
__version__ = '0.7a2'
......@@ -469,6 +469,14 @@ class TDMS(object):
if self.sampling_rate is None:
self.sampling_rate = self.metadata[obj]['SamplingFrequency[Hz]']
if len(self.__filter):
tap = (len(self.__filter) - 1) / (2.0 * self.sampling_rate)
# If there is decimation adjust the start and end times to include the tapering
# and later keep exactly what user requests
logs.debug('Readjust start and end time to accommodate the filter length: %s - %s' %
(self.__twstart, self.__twend))
self.__twstart -= datetime.timedelta(seconds=tap)
self.__twend += datetime.timedelta(seconds=tap)
except KeyError:
......@@ -751,6 +759,7 @@ class TDMS(object):
stats.mseed.blkt1001.timing_quality = 100
logs.debug('Data length: %d; First component: %s' % (len(data[ch]), data[ch][0]))
logs.debug('Stats: %s' % (stats,))
yield data[ch], stats
# No more data in this file. Skip to the next one.
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