From 286a75e84f75cae40a5b480471acb709fcd974f4 Mon Sep 17 00:00:00 2001 From: Stepan Bahnik Date: Tue, 3 Dec 2013 21:25:49 +0100 Subject: [PATCH] corrected two minor bugs --- Stuff/Modules/cm.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Stuff/Modules/cm.py b/Stuff/Modules/cm.py index 0ae98fe..7d3fd0b 100644 --- a/Stuff/Modules/cm.py +++ b/Stuff/Modules/cm.py @@ -156,7 +156,7 @@ def _processRoomFile(self, infile, endsplit = 7): # missing points if count + 1 != line[0]: - i = 2 + i = 1 while True: if self.data[-i][2] or self.data[-i][3]: break @@ -369,8 +369,9 @@ def getT1(self, time = 20, startTime = 0, lastTime = "fromParameter"): argument 'lastTime' decides whether the last time point is obtained from 'time' parameter or data """ - time = time * 60000 # conversion from minutes to miliseconds start = self.findStart(startTime) + time *= 60000 # conversion from minutes to miliseconds + startTime *= 60000 T1 = 0 for content in self.data[start:]: if content[5] != 2: @@ -568,7 +569,7 @@ def getMaxTimeOfImmobility(self, time = 20, startTime = 0, minSpeed = 10, skip = minSpeed argument is in cm/s, smooth and skip are represented in data points""" time = time * 60000 start = self.findStart(startTime) - t0 = startTime + t0 = startTime * 60000 x0, y0 = self.data[start][self.indices] speeds = deque() @@ -668,7 +669,7 @@ def getPercentOfMobility(self, time = 20, startTime = 0, minSpeed = 5, skip = 12 minSpeed argument is in cm/s, smooth and skip are represented in data points""" time = time * 60000 start = self.findStart(startTime) - t0 = startTime + t0 = startTime * 60000 x0, y0 = self.data[start][self.indices] speeds = deque()