Guest User

Untitled

a guest
Oct 17th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. for root, dirs, files in os.walk(rootDir):
  2. firstFile = True
  3. for name in files:
  4. if firstFile:
  5. currentTaskValues = os.path.splitext(name)[0].replace('p', '.').replace('m', '-').replace('s', '').split('_')
  6. currentTaskValues = removeAlphabeticSymbols(currentTaskValues)
  7. firstFile = False
  8.  
  9. currentFileContent = os.path.splitext(name)[0].split('_')[-1]
  10.  
  11. if currentFileContent == 'accelerations':
  12. arrTime, arrAccLat, arrAccLon, arrAccRol, arrAccYaw = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(0,1,2,3,4), unpack=True)
  13. elif currentFileContent == 'displacements':
  14. arrDspSum, arrDspLat, arrDspLon, arrDspRol, arrDspYaw = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(0,1,2,3,4), unpack=True)
  15. elif currentFileContent == 'forces':
  16. arrLeFro, arrLeRea, arrRiFro, arrRiRea = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(1,2,3,4), unpack=True)
  17. elif currentFileContent == 'steering':
  18. arrSWAng, arrSWRotSpd, arrToeLeFro, arrToeLeRea = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(1,2,3,4), unpack=True)
  19. elif currentFileContent == 'velocities':
  20. arrVelLat, arrVelLon, arrVelRol, arrVelYaw = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(1,2,3,4), unpack=True)
  21. elif currentFileContent == 'wheelslipangles':
  22. arrSideSlAng, arrLeSlFro, arrLeSlRea, arrRiSlFro, arrRiSlRea = np.loadtxt(os.path.join(root, name), skiprows=7, usecols=(0,1,2,3,4), unpack=True)
  23. else:
  24. raise SystemExit('Unable to open file {:s}'.format(currentFileContent))
  25.  
  26. indStartTime = np.argwhere(np.abs(arrTime - 4.0) < 1e-4)[0,0]
Add Comment
Please, Sign In to add comment