nevals = d['nevals']
d.close() # close file descriptor
-
+
if nrun in sample_runs:
for i,k in enumerate(sample_channels):
g = guesses[:, 0, k]
interactive(False)
-if 0:
- figure()
+if 1:
+ figure(figsize=(5.0, 3.5))
+ subplots_adjust(top=0.93, bottom=0.12, left=0.10, right=0.98)
data = cv.flatten()
hist(data, bins=range(128), align='left')
- xlabel('OTA tuning DAC value')
- title('Channel offset tuning histogram\n48x2 channels x %i runs' %
- (len(infiles),))
- savefig('caldac-hist.pdf')
+ ylim((0, 7000))
+ xlabel('OTA tuning DAC code')
+ title('48x2 channels x %i runs' % (len(infiles),))
+ savefig(os.path.basename(os.getcwd()) + '-caldac-hist.pdf')
- figure()
- data = co.flatten()
- hist(data, bins=range(-1500, 1500, 10), align='left')
- xlabel('Tuned channel output offset voltage (mV)')
- title('Channel offset tuning histogram\n48x2 channels x %i runs' %
- (len(infiles),))
- savefig('calout-hist.pdf')
+ figure(figsize=(5.0, 3.5))
+ subplots_adjust(top=0.93, bottom=0.12, left=0.10, right=0.98)
+ data = co.flatten() * 1e-3
+ hist(data, bins=arange(-1.500, 1.500, 0.025), align='left')
+ xlabel('Residual $V_{oos}$ (V)')
+ ylim((0, 7000))
+ title('48x2 channels x %i runs' % (len(infiles),))
+ savefig(os.path.basename(os.getcwd()) + '-calout-hist.pdf')
if 1:
stdds = []
c = 0
for k in range(co.shape[2]):
- data = 1e3*(2.5/2/2**13)*co[:, 0, k]
- m = data.mean()
- s = data.std()
- means.append(m)
- stdds.append(s)
- if abs(m) < 10.0 and abs(s) < 10.0:
- c += 1
+ for i in range(2):
+ data = 1e3*(2.5/2/2**13)*co[:, i, k]
+ m = data.mean()
+ s = data.std()
+ means.append(m)
+ stdds.append(s)
print '%02i: mean: %5.1f, std: %5.1f' % (k, m, s)
+ if abs(m) < 10.0 and abs(s) < 10.0:
+ c += 1
+ #print '%02i: mean: %5.1f, std: %5.1f' % (k, m, s)
print 'good channels:', c
+
+ figure(figsize=(5.0, 3.5))
+ subplots_adjust(top=0.93, bottom=0.12, left=0.15, right=0.98)
+
+ x = range(len(means))
+ errorbar(x, means, yerr=stdds, fmt='.')
+ hlines([-10, 10], 0, len(x), linewidth=1.0, color='g')
+
+ xlim((0, 96))
+ xticks(range(0, 97, 16))
+
+
+ xlabel('Channel index')
+ ylabel(r'$V_{oos}$, $\bar x$, $\sigma$ (mV)', fontsize='large')
+ title('%i acceptable channels' % c)
+
+ savefig(os.path.basename(os.getcwd()) + '-channels.pdf')
+
#print sample_runs
#print [infiles[s] for s in sample_runs]