Created
April 16, 2018 21:33
-
-
Save ASolchen/871236f204d034e16e2be0f3ff6e7996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, struct | |
import numpy as np | |
import matplotlib.pyplot as plt | |
path = 'E:/big_ass.rdd' | |
ptr = 0 | |
np_ptr = 0 | |
buff = np.zeros([2,2000000], np.float64) | |
t = time.time() | |
with open(path, 'rb') as f: | |
f.seek(1024) | |
while True: | |
b = f.read(16) | |
if b: | |
buff[:, np_ptr] = struct.unpack('dd', b) | |
np_ptr+=1 | |
ptr += 16*9999 | |
f.seek(ptr) | |
else: | |
break | |
plt.plot(buff[0, :np_ptr], buff[1, :np_ptr]) | |
plt.show() | |
print(buff[:, :np_ptr]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment