for i in path[1:]: whole = appendFracs(whole, minedParts[path[i]], lenOfCycle) whole = whole[0] plt.figure() whole = ma.movingAverage(whole, 10, 1.3) plt.plot(whole) #plt.plot() #plt.show() periods =[] strides = [] stances = [] swings = [] maximaOrder=15 clusteringGranularity=0.5 breaked = prt.breakToPeriods(whole,maximaOrder, clusteringGranularity) for cycle in breaked: if len(cycle)>25 and len(cycle)<60: #periods.append(cycle) strides.append(cycle) min = np.argmin(cycle) stances.append(cycle[:min]) swings.append(cycle[min:]) prt.plotStas(strides, 'Strides') prt.plotStas(stances, 'stances') prt.plotStas(swings, 'swings') """ originalParts= copy.deepcopy(minedParts) minedParts = mbp.matchFracsByPositionInCycle(minedParts) fig = plt.figure()
#fracs.append((currTime, currAngles)) anglesSplited.append(currAngles) currTime = [t] currAngles = [a] lastT = t #fracs = ke.clusterByTime(time, angles, False, minimalCluster) #cleanedParts, kuku = ke.cleanFracs(fracs, False) st.plotParts(anglesSplited) periods =[] strides = [] stances = [] swings = [] for cluster in anglesSplited: maximaOrder=27 clusteringGranularity=0.5 breaked = part.breakToPeriods(cluster,maximaOrder, clusteringGranularity) for cycle in breaked: if len(cycle)>80 and len(cycle)<180: #periods.append(cycle) strides.append(cycle) min = np.argmin(cycle) stances.append(cycle[:min]) swings.append(cycle[min:]) part.plotStas(strides, 'Strides') part.plotStas(stances, 'stances') part.plotStas(swings, 'swings') plt.show()