- Make sure the input file is named
sg.csvand placed inside thesrcfolder. - Make sure you have two folders
gt_dataandra_datacontaining lane-separated gt and ra files. - Make sure that each file has non-empty column headers. Having empty column headers could result in formatting issues or other errors. Most likely, you will only need to modify or remove the last column of
sg.csv, e.g. "DATE,TIME,LANE,SPEED,LENGTH,NUMBER_PLATE,DISTANCE_FROM_CURB,-" will suffice. - To run, simply modify the time offset inside the makefile and execute with
make run.merge_tsv.pyrequires at least 2 files as arguments. If there are more than 2 lanes, please modify the -l flag of thesplit_lanes.pyscript. The relevant output files can be found inside the newly createdoutput_filesfolder. The order of execution is as follows:- A copy of the input file is created with modified timestamps.
- The modified copy is split into two files, separated by lane number.
- The resulting files are both used to merge with their corresponding gt and ra files. The merged output files are by default named
sg_lane1_merged.tsvandsg_lane2_merged.tsv.
If you wish to alter the filenames or paths, specify a different time offset or split more than two lanes, please modify the makefile accordingly.
python3 add_time_offset.py <filename> can be used to arbitrarily add a datetime offset to a column, with header 'TIME', containing timestamps of the format HHMMSS or HHMMSS.f.
- Input: any .csv or .tsv file with a column named 'time' (case insensitive) containing timestamps of the format
HHMMSSorHHMMSS.f(i.e. excluding ':' or any other special characters). - Output: a .tsv file with modified timestamps.
- Flags:
-h <int>set the number of hours to modify.-m <int>set the number of minutes to modify.-s <int>set the number of seconds to modify.--subsubtract instead of add.
csv_to_tsv.py can be used to quickly convert .csv files to .tsv format.
split_lanes.py is used to split the data of a single file over two separate files, by lane number.
- Flags:
-f <int>set the number of lanes.