#!/usr/bin/env python # coding: utf-8 # In[47]: x = open("/home/julian/Documents/uvpumpingpython/2020-02-07 14-46-16.dat", "rb").read() print(x[:16]) # In[ ]: # so not http://galileo.phys.virginia.edu/~pmm3w/misc/file_format.txt # In[2]: 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) # In[3]: from matplotlib import pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') plt.plot(f[2::2]) # In[4]: # 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]) # In[29]: # 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]) # In[46]: print(struct.unpack(">fBBBBfBBBBfbbbbfbbbb", x[4*2:4*7298*1][:16*2])) # In[44]: plt.plot(sorted(f[7298*1+1:7298*2-1:2])) plt.plot(sorted(f[7298*4-1:7298*5-2:2])) # In[ ]: