Guest User

Untitled

a guest
Oct 20th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. #!/path/to/python -tt
  2.  
  3. # numerical data
  4. # python GraphicalPart.py ../S001R03_data.txt_motor.txt_0.0_T0.txt
  5.  
  6. import sys
  7. import matplotlib.pyplot as plt
  8. import numpy as np
  9.  
  10. def startDivide(fileName):
  11.  inputFile = open(fileName)
  12.  outputFile = open(fileName + "_out.csv", "w")
  13.  floatList = []
  14.  for line in inputFile.readlines():
  15.    data = line.split(" ")
  16.    string = data[1] + "\n"
  17.    if string.startswith('-')
  18.     string = string[1:]
  19.    outputFile.write("%s" % string)
  20.  
  21.  inputFile.close()
  22.  outputFile.close()
  23.  
  24.  inputFileByTab = open(fileName + "_out.csv")
  25.  data1=np.genfromtxt(fileName + '_out.csv', skip_header=1)
  26.  
  27.  #plt.plot(data1)
  28.  #plt.show()
  29.  
  30.  
  31. def main():
  32.  if len(sys.argv) != 2:
  33.    print "Not enough arguments. *_data.txt file only!"
  34.  else:
  35.    startDivide(sys.argv[1])
  36.  
  37. if __name__ == "__main__":
  38.  main()
Advertisement
Add Comment
Please, Sign In to add comment