Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3. from numpy import sqrt,sin,cos,log,exp
  4. import scipy
  5. import scipy.fftpack
  6. import scipy.odr
  7. import StringIO
  8.  
  9. matplotlib.rc('font', size=15)
  10.  
  11. def lese_lab_datei(dateiname):
  12. '''
  13. CASSY LAB Datei einlesen.
  14.  
  15. Messdaten werden anhand von Tabulatoren identifiziert.
  16.  
  17. Gibt ein numpy-Array zurueck.
  18.  
  19. '''
  20. f = open(dateiname)
  21. dataSectionStarted = False
  22. dataSectionEnded = False
  23. data = ''
  24. for line in f:
  25. if '\t' in line and not dataSectionEnded:
  26. data += line
  27. dataSectionStarted = True
  28. if not '\t' in line and dataSectionStarted:
  29. dataSectionEnded = True
  30. f.close()
  31. return np.genfromtxt(StringIO.StringIO(data))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement