Mercurial Hosting > traffic-intelligence
comparison python/ubc_utils.py @ 161:41a5853ec495
added utility to offset the time intervales of complete trajectory files
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 20 Sep 2011 13:49:01 -0400 |
parents | 48e3de4acb65 |
children | ea2a8e8e4e77 |
comparison
equal
deleted
inserted
replaced
160:b0719b3ad3db | 161:41a5853ec495 |
---|---|
78 lines = utils.getLines(infile) | 78 lines = utils.getLines(infile) |
79 | 79 |
80 print('read {0} objects'.format(objNum)) | 80 print('read {0} objects'.format(objNum)) |
81 | 81 |
82 def modifyTrajectoryFile(modifyLines, filenameIn, filenameOut): | 82 def modifyTrajectoryFile(modifyLines, filenameIn, filenameOut): |
83 '''Reads filenameIn, replaces the first line with the result of modifyLines and writes the result in filenameOut''' | 83 '''Reads filenameIn, replaces the lines with the result of modifyLines and writes the result in filenameOut''' |
84 #sortByNum(objects) | |
85 fileIn = utils.openCheck(filenameIn, 'r', True) | 84 fileIn = utils.openCheck(filenameIn, 'r', True) |
86 fileOut = utils.openCheck(filenameOut, "w", True) | 85 fileOut = utils.openCheck(filenameOut, "w", True) |
87 | 86 |
88 lines = utils.getLines(fileIn) | 87 lines = utils.getLines(fileIn) |
89 trajNum = 0 | 88 trajNum = 0 |