import utils.kinect.angleExtraction as ae import matplotlib.pyplot as plt import utils.oldKinectExtractor as ex import itertools import numpy as np fileName = 'inputs/alon_multi_right.skl'#'inputs/asc_gyro_l.skl' joint = 'AnkleRight_X' time, angles, weights = ae.getAngleVec(fileName, joint, False) startGrade=0.93 minimalOverlap=10 maximalOverlap=50 lengthFactor=0#-0.4 merged, des, fracs = ex.stitchKinect(time, angles, weights, True, startGrade, minimalOverlap, maximalOverlap, lengthFactor) time, values = zip(*fracs) sortingIndices = sorted(des.keys(), key=lambda k: des[k][0]) timeLine = [] for i in sortingIndices: timeLine = timeLine[:des[i][0]] + time[i] #timeLine = list(itertools.chain(*time)) mat = {} file = open(fileName, 'r') headersStr = file.readline() headers = headersStr.split() for line in file: splited = line.split() mat[float(splited[0])] = splited[1:]