def getRawData(path, name, nb, hip): def getDir(path, subject, bodyPart, nb): return (path + subject + "\\" + bodyPart + "\\" + "DATA-00" + str(int(nb)) + ".csv") if hip: bodyPart = 'heup' else: bodyPart = 'enkel' datadir = getDir(path, name, bodyPart, nb) try: data = ac.readGCDCFormat(datadir) except: return None return ac.preprocessGCDC(data)
def getDataForOneBodyPart(path, hip): data = readGCDCFormat(path) data = preprocessGCDC(data) data = getRunningPart(data, hip) return data
if col in posCols()] generatedFeatures['features'] = [f for f in generatedFeatures['features'] if f in posFeatures().keys()] return generatedFeatures def getSimpleFreqDomainFeatures(data, requiredFeatures=None): requiredFeatures = checkRequiredFeatures(requiredFeatures) data = toFreq(data[requiredFeatures['cols']]) features = dict() for f in requiredFeatures['features']: features.update(posFeatures()[f](data, f)) return features if __name__ == '__main__': import dataTransform.accproc as ac import dataTransform.Preprocessing as pp for i in range(9): nb = int(i + 1) if nb == 4: data = ac.readGCDCFormat("..\data\Runs\Tina\enkel\DATA-00" + `nb` + ".csv") data = ac.preprocessGCDC(data) filtered = pp.filterRun3(data) print(getSimpleFreqDomainFeatures(data, None))
minx = xcandidate[0] data = data[minx:maxx] return data if __name__ == '__main__': subjects = ['Vreni', 'Annick', 'Tina', 'Tinne'] subjects = ['Ann', 'Emmy', 'Floor'] subjects = ['Hanne', 'Jolien', 'Laura'] subjects = ['Mara', 'Nina', 'Sofie', 'Yllia'] for sub in subjects: print(sub) for i in range(9): nb = int(i + 1) print(nb) datadir = "..\..\Runs\\" + sub + "\heup\DATA-00" + `nb` + ".csv" try: data = ac.readGCDCFormat(datadir) data = preprocessGCDC(data) # data.plot() try: data = filterRun3(data, True) data.plot() except: print("failed") except: continue pylab.show()