Mercurial > hg > nsaunier > traffic-intelligence
diff python/pavement.py @ 433:d40ad901b272
added kernel smoothing
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 29 Nov 2013 02:38:41 -0500 |
| parents | 4970fa64f636 |
| children | 9a714f32fc9f |
line wrap: on
line diff
--- a/python/pavement.py Thu Nov 28 00:48:24 2013 -0500 +++ b/python/pavement.py Fri Nov 29 02:38:41 2013 -0500 @@ -23,10 +23,12 @@ plot(self.data['jours']/float(dayRatio), self.data[measure], options, **kwargs) - def plotRetroreflectivity(self, options = 'o', dayRatio = 1., **kwargs): - for i in range(1,7): - self.plot('retro_{}'.format(i), options, dayRatio, **kwargs) + def getMarkingMeasures(self, measure, ligneNum): + from numpy import isnan + dataLabel = '{}_{}'.format(measure, ligneNum) + nonZeroIndices = ~isnan(self.data[dataLabel]) + return self.data[nonZeroIndices]['jours'], self.data[nonZeroIndices][dataLabel] - def plotDurability(self, options = 'o', dayRatio = 1., **kwargs): + def plotMarkingMeasures(self, measure, options = 'o', dayRatio = 1., **kwargs): for i in range(1,7): - self.plot('dur_{}'.format(i), options, dayRatio, **kwargs) + self.plot('{}_{}'.format(measure, i), options, dayRatio, **kwargs)
