changeset 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 fb3654a9127d
children 4970fa64f636
files python/pavement.py
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/pavement.py	Wed Nov 27 03:22:01 2013 -0500
@@ -0,0 +1,32 @@
+#! /usr/bin/env python
+'''Tools for processing and analyzing pavement marking data'''
+
+__metaclass__ = type
+
+class RTSS:
+    'class for data related to a RTSS, including agregating pavement marking measurements'
+    pass
+
+class MarkingTest:
+    '''class for a test site for a given product'''
+
+    def __init__(self, siteId, paintingDate, paintingType, color, data):
+        self.siteId = siteId
+        self.paintingDate = paintingDate
+        self.paintingType = paintingType
+        self.color = color
+        self.data = data
+        self.nMeasures = len(data)
+
+    def plot(self, measure, dayRatio = 1.):
+        from matplotlib.pyplot import plot
+        plot(self.data['jours']/float(dayRatio), 
+             self.data[measure])
+
+    def plotRetroreflectivity(self, dayRatio = 1.):
+        for i in range(1,7):
+            self.plot('retro_{}'.format(i), dayRatio)
+
+    def plotDurability(self, dayRatio = 1.):
+        for i in range(1,7):
+            self.plot('dur_{}'.format(i), dayRatio)