Commit 26ad175c authored by Javier Quinteros's avatar Javier Quinteros
Browse files

Small additional fix related to issue 21

parent 67c0a912
......@@ -477,13 +477,14 @@ class TDMS(object):
try:
if self.sampling_rate is None:
self.sampling_rate = self.metadata[obj]['SamplingFrequency[Hz]']
# TODO Check for decimation, not for filter length
if len(self.__filter):
# Check for decimation and take into account the filter length
if self.__decimate != 1:
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
self.__twstart -= datetime.timedelta(seconds=tap)
self.__twend += datetime.timedelta(seconds=tap)
if self.__twend is not None:
self.__twend += datetime.timedelta(seconds=tap)
logs.debug('Readjust start and end time to accommodate the filter length: %s - %s' %
(self.__twstart, self.__twend))
except KeyError:
......
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