comparison python/pavement.py @ 431:0bcfa49d179a

began module for pavement marking data processing
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 27 Nov 2013 03:22:01 -0500
parents
children 4970fa64f636
comparison
equal deleted inserted replaced
430:fb3654a9127d 431:0bcfa49d179a
1 #! /usr/bin/env python
2 '''Tools for processing and analyzing pavement marking data'''
3
4 __metaclass__ = type
5
6 class RTSS:
7 'class for data related to a RTSS, including agregating pavement marking measurements'
8 pass
9
10 class MarkingTest:
11 '''class for a test site for a given product'''
12
13 def __init__(self, siteId, paintingDate, paintingType, color, data):
14 self.siteId = siteId
15 self.paintingDate = paintingDate
16 self.paintingType = paintingType
17 self.color = color
18 self.data = data
19 self.nMeasures = len(data)
20
21 def plot(self, measure, dayRatio = 1.):
22 from matplotlib.pyplot import plot
23 plot(self.data['jours']/float(dayRatio),
24 self.data[measure])
25
26 def plotRetroreflectivity(self, dayRatio = 1.):
27 for i in range(1,7):
28 self.plot('retro_{}'.format(i), dayRatio)
29
30 def plotDurability(self, dayRatio = 1.):
31 for i in range(1,7):
32 self.plot('dur_{}'.format(i), dayRatio)