cal_values = []
cal_outs = []
-infiles = sorted(glob('*.npz'))
+infiles = sorted(glob('201*.npz'))
N_RUNS = min(len(infiles), 8)
#N_RUNS = 0
sample_runs = sorted(rand_sample(range(len(infiles)), N_RUNS))
if 1:
# stddev for each calibrated channel
- means = []
- stdds = []
+ good_means = []
+ good_stdds = []
+ bad_means = []
+ bad_stdds = []
+ good_x = []
+ bad_x = []
c = 0
+ x = 0
for k in range(co.shape[2]):
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:
+ good_x.append(x)
+ good_means.append(m)
+ good_stdds.append(s)
c += 1
#print '%02i: mean: %5.1f, std: %5.1f' % (k, m, s)
+ else:
+ bad_x.append(x)
+ bad_means.append(m)
+ bad_stdds.append(s)
+ x += 1
print 'good channels:', c
- figure(figsize=(5.0, 3.5))
- subplots_adjust(top=0.93, bottom=0.12, left=0.15, right=0.98)
+ figure(figsize=(3.5, 2.0))
+ subplots_adjust(top=0.98, bottom=0.18, left=0.16, right=0.98)
- x = range(len(means))
- errorbar(x, means, yerr=stdds, fmt='.')
- hlines([-10, 10], 0, len(x), linewidth=1.0, color='g')
+ #x = range(len(means))
+ errorbar(good_x, good_means, yerr=good_stdds, fmt='.', label='Good')
+ errorbar(bad_x, bad_means, yerr=bad_stdds, fmt='x', label='Bad')
+ #hlines([-10, 10], 0, 96, linewidth=1.0, color='g')
+ hlines([0], 0, 96, linewidth=0.4, color='black')
xlim((0, 96))
xticks(range(0, 97, 16))
- ylim((-250, 100))
+ yticks(range(-200, 60, 50), fontsize='small')
+ ylim((-200, 80))
+ legend(loc='lower left', frameon=False, fontsize='small')
xlabel('Channel index')
- ylabel(r'$V_{oos}$, $\bar x$, $\sigma$ (mV)', fontsize='large')
- title('%i acceptable channels' % c)
+ ylabel(r'$V_{oos}$, $\bar x$, $\sigma$ (mV)')
+ #title('%i acceptable channels' % c)
+ text(48, -100, '%i acceptable\nchannels' % c,
+ horizontalalignment='center',
+ verticalalignment='top',
+ fontsize='medium')
savefig(os.path.basename(os.getcwd()) + '-channels.pdf')