Skip to content

Instantly share code, notes, and snippets.

@ASolchen
Created April 16, 2018 21:33
Show Gist options
  • Save ASolchen/871236f204d034e16e2be0f3ff6e7996 to your computer and use it in GitHub Desktop.
Save ASolchen/871236f204d034e16e2be0f3ff6e7996 to your computer and use it in GitHub Desktop.
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