cal_values = []
cal_outs = []
cal_nevals = []
+cal_means = []
+cal_stds = []
infiles = sorted(glob('*.npz'))
#N_RUNS = min(len(infiles), 8)
N_RUNS = 0
sample_runs = sorted(rand_sample(range(len(infiles)), N_RUNS))
-#N_PLOTS = 4
-N_PLOTS = 0
+N_PLOTS = 4
+#N_PLOTS = 0
#sample_channels = sorted(rand_sample(range(48), N_PLOTS))
sample_channels = range(N_PLOTS)
-#N_COLS = 4
-N_COLS = 0
+N_COLS = 4
+#N_COLS = 0
nrun = 0
for infile in infiles:
#for infile in sorted(glob('*.npz')):
subplot(N_PLOTS, N_COLS, N_COLS*i+2)
plot(r[:nevals[0,k]+1], '-')
+ subplot(N_PLOTS, N_COLS, N_COLS*i+3)
+ data = cv[:, 0, k]
+ hist(data, bins=range(128), align='left')
+ xlim((data.min()-1, data.max()+1))
+ xlim((0, 127))
+
+ subplot(N_PLOTS, N_COLS, N_COLS*i+4)
+ data = 1e3*(2.5/2/2**13)*co[:, 0, k]
+ dm = max((abs(data.min()), abs(data.max())))
+ print dm
+ dm = max(dm, 50)
+ hist(data, bins=100, range=(-dm, dm), align='left')
+ xlim((-dm, dm))
+ #ylim((0, 50))
+
+
cal_values.append(guesses[-1, :, :])
# results are zeros after [nevals:]
-if 0:
- figure()
+if 1:
+ figure(figsize=(14.0, 8.5))
for i,k in enumerate(sample_channels):
+ g = guesses[:, 0, k]
+ r = 1e3*(2.5/2/2**13)*results[:, 0, k]
+
+ subplot(N_PLOTS, N_COLS, N_COLS*i+1)
+ plot(g[:nevals[0,k]+1], '-')
+ ylim((0, 127))
+ #ylabel('Channel %02i-A' % k)
+
+ subplot(N_PLOTS, N_COLS, N_COLS*i+2)
+ plot(r[:nevals[0,k]+1], '-')
+
subplot(N_PLOTS, N_COLS, N_COLS*i+3)
data = cv[:, 0, k]
hist(data, bins=range(128), align='left')
xlim((data.min()-1, data.max()+1))
xlim((0, 127))
- subplot(N_PLOTS, N_COLS, N_COLS*i+4)
+ ax = subplot(N_PLOTS, N_COLS, N_COLS*i+4)
data = 1e3*(2.5/2/2**13)*co[:, 0, k]
dm = max((abs(data.min()), abs(data.max())))
print dm
hist(data, bins=100, range=(-dm, dm), align='left')
xlim((-dm, dm))
#ylim((0, 50))
+ dmean = data.mean()
+ dstd = data.std()
+ print nrun, dmean, dstd
+
+ text(0.03, 0.95, r'$\sigma=%4.1f$' % dstd,
+ horizontalalignment='left',
+ verticalalignment='top',
+ fontsize=18,
+ bbox=dict(facecolor='r', alpha=0.5, boxstyle="round"),
+ transform = ax.transAxes)
subplot(N_PLOTS, N_COLS, 1)
title('Offset DAC value')
(os.path.basename(os.getcwd()),
len(infiles)))
-interactive(False)
+ savefig('chip01-cal-plots2.pdf')
-if 1:
+#interactive(False)
+interactive(True)
+
+if 0:
figure()
data = cv.flatten()
hist(data, bins=range(128), align='left')