Guest User

Untitled

a guest
Apr 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import time, struct
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4.  
  5. path = 'E:/big_ass.rdd'
  6. ptr = 0
  7. np_ptr = 0
  8. buff = np.zeros([2,2000000], np.float64)
  9. t = time.time()
  10. with open(path, 'rb') as f:
  11. f.seek(1024)
  12. while True:
  13. b = f.read(16)
  14. if b:
  15. buff[:, np_ptr] = struct.unpack('dd', b)
  16. np_ptr+=1
  17. ptr += 16*9999
  18. f.seek(ptr)
  19. else:
  20. break
  21. plt.plot(buff[0, :np_ptr], buff[1, :np_ptr])
  22. plt.show()
  23. print(buff[:, :np_ptr])
Add Comment
Please, Sign In to add comment