Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for root, dirs, files in os.walk(rootDir):
- firstFile = True
- for name in files:
- if firstFile:
- currentTaskValues = os.path.splitext(name)[0].replace('p', '.').replace('m', '-').replace('s', '').split('_')
- currentTaskValues = removeAlphabeticSymbols(currentTaskValues)
- firstFile = False
- currentFileContent = os.path.splitext(name)[0].split('_')[-1]
- if currentFileContent == 'accelerations':
- arrTime, arrAccLat, arrAccLon, arrAccRol, arrAccYaw = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(0,1,2,3,4), unpack=True)
- elif currentFileContent == 'displacements':
- arrDspSum, arrDspLat, arrDspLon, arrDspRol, arrDspYaw = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(0,1,2,3,4), unpack=True)
- elif currentFileContent == 'forces':
- arrLeFro, arrLeRea, arrRiFro, arrRiRea = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(1,2,3,4), unpack=True)
- elif currentFileContent == 'steering':
- arrSWAng, arrSWRotSpd, arrToeLeFro, arrToeLeRea = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(1,2,3,4), unpack=True)
- elif currentFileContent == 'velocities':
- arrVelLat, arrVelLon, arrVelRol, arrVelYaw = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(1,2,3,4), unpack=True)
- elif currentFileContent == 'wheelslipangles':
- arrSideSlAng, arrLeSlFro, arrLeSlRea, arrRiSlFro, arrRiSlRea = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(0,1,2,3,4), unpack=True)
- else:
- raise SystemExit('Unable to open file {:s}'.format(currentFileContent))
- indStartTime = np.argwhere(np.abs(arrTime - 4.0) < 1e-4)[0,0]
Add Comment
Please, Sign In to add comment