TCAS figs: fit to paper and squeeze height
authorDan White <dan@whiteaudio.com>
Fri, 20 Feb 2015 12:54:17 +0000 (06:54 -0600)
committerDan White <dan@whiteaudio.com>
Fri, 20 Feb 2015 12:54:17 +0000 (06:54 -0600)
python-lib/test-data/chip01/chip01-channels.pdf
python-lib/test-data/chip02/chip02-channels.pdf
python-lib/test-data/chip02/stats.py

index ad7c574a59e29a62d654231d376543d0bb002ad1..aec246cc036d3b3d8afab0ade028d9dbb08948cf 100644 (file)
Binary files a/python-lib/test-data/chip01/chip01-channels.pdf and b/python-lib/test-data/chip01/chip01-channels.pdf differ
index 4ecd0952f8b8eaf9fdcb20e9e716fc4d194113a7..e82a3ccd89358484b49280af939f2bd6f6955a10 100644 (file)
Binary files a/python-lib/test-data/chip02/chip02-channels.pdf and b/python-lib/test-data/chip02/chip02-channels.pdf differ
index dad33fb837f727ba23afd932240f0a2f17321a91..0e7ab7ec6510fb510040ef6ba7f63c5503c989c5 100644 (file)
@@ -10,7 +10,7 @@ from random import sample as rand_sample
 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))
@@ -137,39 +137,58 @@ if 1:
 
 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')