view 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
line wrap: on
line source

#! /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)