x = open("/home/julian/Documents/uvpumpingpython/2020-02-07 14-46-16.dat", "rb").read()
print(x[:16])
b'\x00\x00\x00\x03\x00\x00\x0e@@^\xd3r\n\xaeDZ'
# so not http://galileo.phys.virginia.edu/~pmm3w/misc/file_format.txt
import struct
x = open("/home/julian/Documents/uvpumpingpython/2020-02-07 14-46-16.dat", "rb").read()
f = [ struct.unpack(">f", x[i:i+4])[0] for i in range(0, len(x), 4) ]
len(f)
36487
from matplotlib import pyplot as plt
%matplotlib inline
plt.plot(f[2::2])
[<matplotlib.lines.Line2D at 0x7fca2b86c510>]
# plots of 3 alternating components
plt.plot(f[2:7298*1:2])
plt.plot(f[7298*2:7298*3-2:2])
plt.plot(f[7298*3:7298*4-2:2])
# seems to exactly match
print(f[2:7298*1:2][2000:2004])
print(f[7298*2:7298*3-2:2][2000:2004])
print(f[7298*3:7298*4-2:2][2000:2004])
[4.17051362991333, 4.170751094818115, 4.170989036560059, 4.171226501464844] [4.17051362991333, 4.170751094818115, 4.170989036560059, 4.171226501464844] [4.17051362991333, 4.170751094818115, 4.170989036560059, 4.171226501464844]
# zero sections
print(set(f[7298*1+2:7298*2:2]))
print(set(f[7298*4:7298*5-2:2]))
plt.plot(f[7298*1+1:7298*2-1:2])
plt.plot(f[7298*4-1:7298*5-2:2])
{0.0} {0.0}
[<matplotlib.lines.Line2D at 0x7fca2b28ae90>]
print(struct.unpack(">fBBBBfBBBBfbbbbfbbbb", x[4*2:4*7298*1][:16*2]))
(3.4816555976867676, 10, 174, 68, 90, 3.4829108715057373, 78, 137, 23, 205, 3.484165906906128, -27, -123, 13, -84, 3.4854209423065186, -49, -92, -119, 6)
plt.plot(sorted(f[7298*1+1:7298*2-1:2]))
plt.plot(sorted(f[7298*4-1:7298*5-2:2]))
[<matplotlib.lines.Line2D at 0x7fca298440d0>]