In [1]:
!head -10 train_points_import_data/arduino_raw_data.txt
We want to have this data in a more standard format, a CSV file for instance. More like this way:
In [2]:
!head -10 train_points_import_data/processed_data.csv
In [4]:
# Import points from arduino format:
#
# "hit: { [tstamp]:[level] [tstamp]:[level] ... [tstamp]:[level] [side]}"
# from file: src/arduino/data/[file]
#
# To internal format:
# "[x_coord],[y_coord],[tstamp],[tstamp], ... ,[tstamp]"
# to file: src/python/data/[file]
import sys
#sys.path.insert(0, '/home/asanso/workspace/att-spyder/att/src/python/')
sys.path.insert(0, 'i:/dev/workspaces/python/att-workspace/att/src/python/')
import hit.importer.train_points_importer as imp
Create an Importer instance now:
In [5]:
importer = imp.TrainPointsImporter()
Now it is time to set some paths, in order to point the source raw data files and the target CSV files:
In [6]:
str_left_input_file = "../src/arduino/data/train_20160129_left.txt"
str_left_output_file = "../src/python/data/train_points_20160129_left.txt"
That was for the left-side collected hit info.
In [7]:
str_right_input_file = "../src/arduino/data/train_20160129_right.txt"
str_right_output_file = "../src/python/data/train_points_20160129_right.txt"
That was for the right-side collected hit info.
Let's do the left-side import now:
In [8]:
importer.from_file_to_file(str_left_input_file, str_left_output_file)
And the right-side import now:
In [9]:
importer.from_file_to_file(str_right_input_file, str_right_output_file)
In [ ]: