Mercurial Hosting > traffic-intelligence
diff trafficintelligence/moving.py @ 1250:77fbd0e2ba7d
dltrack works with moving average filtering
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 15 Feb 2024 22:04:35 -0500 |
parents | 2aa56b101041 |
children | fe35473acee3 |
line wrap: on
line diff
--- a/trafficintelligence/moving.py Thu Feb 15 14:09:52 2024 -0500 +++ b/trafficintelligence/moving.py Thu Feb 15 22:04:35 2024 -0500 @@ -990,10 +990,10 @@ return Trajectory([[alpha*x for x in self.getXCoordinates()], [alpha*y for y in self.getYCoordinates()]]) - def filterMovingWindow(self, halfWidth, mode = 'valid'): + def filterMovingWindow(self, halfWidth): '''Returns a new Trajectory obtained after the smoothing of the input by a moving average''' - return Trajectory([utils.filterMovingWindow(self.positions[0], halfWidth, mode), - utils.filterMovingWindow(self.positions[1], halfWidth, mode)]) + return Trajectory([utils.filterMovingWindow(self.positions[0], halfWidth), + utils.filterMovingWindow(self.positions[1], halfWidth)]) def differentiate(self, doubleLastPosition = False): diff = Trajectory()