Mercurial Hosting > traffic-intelligence
comparison trafficintelligence/pavement.py @ 1029:c6cf75a2ed08
reorganization of imports
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 18 Jun 2018 22:50:59 -0400 |
parents | cc5cb04b04b0 |
children | 956a66096e91 |
comparison
equal
deleted
inserted
replaced
1028:cc5cb04b04b0 | 1029:c6cf75a2ed08 |
---|---|
1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
2 '''Tools for processing and analyzing pavement marking data''' | 2 '''Tools for processing and analyzing pavement marking data''' |
3 | 3 |
4 import datetime | |
5 | |
6 import numpy as np | |
7 | |
4 from trafficintelligence import utils | 8 from trafficintelligence import utils |
5 | |
6 import numpy as np | |
7 | |
8 | 9 |
9 paintTypes = {0: "Non-existant", | 10 paintTypes = {0: "Non-existant", |
10 1: "Eau", | 11 1: "Eau", |
11 2: "Epoxy", | 12 2: "Epoxy", |
12 3: "Alkyde", | 13 3: "Alkyde", |
102 return (exigence, x_moy, y_moy, age_revtm, classe_fonct, type_revtm, milieu, djma, djma_camions, vit_max, peinture_lrd, peinture_lrg, peinture_lc) | 103 return (exigence, x_moy, y_moy, age_revtm, classe_fonct, type_revtm, milieu, djma, djma_camions, vit_max, peinture_lrd, peinture_lrg, peinture_lc) |
103 | 104 |
104 def winterMaintenanceIndicators(data, startDate, endDate, circuitReference, snowThreshold): | 105 def winterMaintenanceIndicators(data, startDate, endDate, circuitReference, snowThreshold): |
105 '''Computes several winter maintenance indicators | 106 '''Computes several winter maintenance indicators |
106 data = entretien_hivernal = pylab.csv2rec('C:\\Users\Alexandre\Documents\Cours\Poly\Projet\mesures_entretien_hivernal\mesures_deneigement.txt', delimiter = ',')''' | 107 data = entretien_hivernal = pylab.csv2rec('C:\\Users\Alexandre\Documents\Cours\Poly\Projet\mesures_entretien_hivernal\mesures_deneigement.txt', delimiter = ',')''' |
107 import datetime | |
108 somme_eau, somme_neige, somme_abrasif, somme_sel, somme_lc, somme_lrg, somme_lrd, compteur_premiere_neige, compteur_somme_abrasif = 0,0,0,0,0,0,0,0,0 | 108 somme_eau, somme_neige, somme_abrasif, somme_sel, somme_lc, somme_lrg, somme_lrd, compteur_premiere_neige, compteur_somme_abrasif = 0,0,0,0,0,0,0,0,0 |
109 | 109 |
110 if circuitReference in data['ref_circuit']: | 110 if circuitReference in data['ref_circuit']: |
111 for i in range(len(data)): | 111 for i in range(len(data)): |
112 if data['ref_circuit'][i] == circuitReference and (data['date'][i] + datetime.timedelta(days = 6)) <= endDate and (data['date'][i] + datetime.timedelta(days = 6)) > startDate: | 112 if data['ref_circuit'][i] == circuitReference and (data['date'][i] + datetime.timedelta(days = 6)) <= endDate and (data['date'][i] + datetime.timedelta(days = 6)) > startDate: |