20180224a
- Client side
Testing
import numpy as np
import matplotlib.pyplot as plt
import glob, os
for CSVFile in glob.glob("data/y*.csv"):
A = np.genfromtxt(CSVFile, delimiter=';').astype(int)[1:]
tmp = []
if (A[4]) < 0b111:
print "bad"
for i in range(len(A)/2-1):
value = 256*(A[2*i+2]&0b11) + A[2*i+1] - 512
#print A[2*i]&0b10000000,A[2*i+1]&0b10000000,
tmp.append( value )
#print A[2*i+1]
#print A[i+1]-A[i]
else:
for i in range(len(A)/2-1):
value = 256*(A[2*i+1]&0b11) + A[2*i] - 512
#print A[2*i]&0b10000000,A[2*i+1]&0b10000000,
tmp.append( value )
#print A[2*i+1]
#print A[i+1]-A[i]
plt.plot(tmp)
plt.title(CSVFile+"-")
plt.savefig("images/"+CSVFile.split(".")[0].split("/")[-1]+".jpg")
plt.show()
bad
bad