20180825a
- Checks
import spidev
import time
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import json
import time
from pyUn0 import *
%matplotlib inline
Not loading RPi.GPIO as not on RPi
for FILE in ["data/20180825a-1.json"]:
x = us_json()
x.JSONprocessing(FILE)
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2,figsize=(20,10))
Duration = (x.parameters['LengthAcq']-x.parameters['DeltaAcq'])/1000.0
Title = "Duration: "+str(Duration)+"us ("+str(x.parameters['LengthAcq'])+" - "
Title+= str(x.parameters['DeltaAcq'])+"), for "+str(x.Nacq)
Title += " repeats\n"
Title += "Fech = "+str(x.f)+"Msps, total of "+str(float(x.f)*Duration)+" pts per line\n"
Title += "Nacq = "+str(x.Nacq)
plt.suptitle(Title)
A = 4000
B = 6000
ax1.plot(x.tmp)
ax1.plot(x.IDLine)
ax1.set_title('signal / IDLine for '+str(x.N))
A =34000
ax2.plot(x.t[A:A+14000],x.tmp[A:A+14000])
ax2.plot(x.t[A:A+14000],x.IDLine[A:A+14000])
ax2.set_title('signal / IDLine - total')
ax3.plot(x.t,x.tmp)
ax3.plot(x.t,x.IDLine)
ax3.set_title('signal / IDLine - total')
ax4.plot(x.t[1500:1600],x.TT1[1500:1600])
ax4.plot(x.t[1500:1600],x.TT2[1500:1600])
ax4.set_title('TT1 / TT2')
plt.show()
FileName = "images/"+x.iD+"-"+str(x.N)+"-all.jpg"
f.savefig(FileName)
Data acquired
Getting the full clean image
CleanImage = x.mk2DArray()
plt.figure(figsize = (15,5))
plt.title("Testing repeatibility of "+x.iD)
for k in range(50):
plt.plot(x.TwoDArray[k][2200:2600])
plt.show()
FileName = "images/detailed_"+x.iD+"-"+str(x.N)+"-"+str(2200)+"-"+str(2600)+".jpg"
plt.savefig(FileName)
<matplotlib.figure.Figure at 0x7f3131c99910>
MetaDataImg("matty,loftus","20180825a","other","Testing new functions to unpack images")
./images/2DArray_20180825a.jpg done
./images/20180825a-1-all.jpg done
./images/20180825a-1.jpg done
./images/detailed_20180825a-1-2200-2600.jpg done