Mercurial Hosting > traffic-intelligence
changeset 408:365d8dee44f3
last changes for TRB14
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 13 Aug 2013 23:36:45 -0400 |
parents | 5eeb3b9fb568 |
children | 3c271a46b4d4 |
files | python/events.py python/indicators.py |
diffstat | 2 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/python/events.py Mon Aug 12 22:50:42 2013 -0400 +++ b/python/events.py Tue Aug 13 23:36:45 2013 -0400 @@ -39,7 +39,7 @@ indicatorNameToIndices = utils.inverseEnumeration(indicatorNames) indicatorShortNames = ['CCDP', - 'CCAng', + 'CCA', 'Dist', 'MinDist', 'VA', @@ -49,6 +49,17 @@ 'P(SEA)', 'pPET'] + indicatorUnits = ['', + 'rad', + 'm', + 'm', + 'rad', + 'm/s', + '', + 's', + '', + ''] + def __init__(self, num = None, timeInterval = None, roaduserNum1 = None, roaduserNum2 = None, roadUser1 = None, roadUser2 = None, categoryNum = None): moving.STObject.__init__(self, num, timeInterval) self.roadUserNumbers = set([roaduserNum1, roaduserNum2])
--- a/python/indicators.py Mon Aug 12 22:50:42 2013 -0400 +++ b/python/indicators.py Tue Aug 13 23:36:45 2013 -0400 @@ -74,14 +74,14 @@ def getValues(self): return [self.__getitem__(t) for t in self.timeInterval] - def plot(self, options = '', xfactor = 1., timeShift = 0, **kwargs): + def plot(self, options = '', xfactor = 1., yfactor = 1., timeShift = 0, **kwargs): from matplotlib.pylab import plot,ylim if self.getTimeInterval().length() == 1: marker = 'o' else: marker = '' time = sorted(self.values.keys()) - plot([(x+timeShift)/xfactor for x in time], [self.values[i] for i in time], options+marker, **kwargs) + plot([(x+timeShift)/xfactor for x in time], [self.values[i]/yfactor for i in time], options+marker, **kwargs) if self.maxValue: ylim(ymax = self.maxValue)