calibration stats
authorDan White <dan@whiteaudio.com>
Mon, 10 Feb 2014 06:56:38 +0000 (00:56 -0600)
committerDan White <dan@whiteaudio.com>
Mon, 10 Feb 2014 06:56:38 +0000 (00:56 -0600)
python-lib/test-data/chip01/chip01-caldac-hist.pdf [new file with mode: 0644]
python-lib/test-data/chip01/chip01-calout-hist.pdf [new file with mode: 0644]
python-lib/test-data/chip01/chip01-channels.pdf [new file with mode: 0644]
python-lib/test-data/chip02/stats.py

diff --git a/python-lib/test-data/chip01/chip01-caldac-hist.pdf b/python-lib/test-data/chip01/chip01-caldac-hist.pdf
new file mode 100644 (file)
index 0000000..efc1006
Binary files /dev/null and b/python-lib/test-data/chip01/chip01-caldac-hist.pdf differ
diff --git a/python-lib/test-data/chip01/chip01-calout-hist.pdf b/python-lib/test-data/chip01/chip01-calout-hist.pdf
new file mode 100644 (file)
index 0000000..c86f333
Binary files /dev/null and b/python-lib/test-data/chip01/chip01-calout-hist.pdf differ
diff --git a/python-lib/test-data/chip01/chip01-channels.pdf b/python-lib/test-data/chip01/chip01-channels.pdf
new file mode 100644 (file)
index 0000000..e4fa947
Binary files /dev/null and b/python-lib/test-data/chip01/chip01-channels.pdf differ
index 0df5159faac6b9093dcdc47b797233d4dda3f12a..e9f02272e6fc6699bbe8e780b78ad708aedd711f 100644 (file)
@@ -33,7 +33,7 @@ for infile in infiles:
     nevals = d['nevals']
 
     d.close() # close file descriptor
-    
+
     if nrun in sample_runs:
         for i,k in enumerate(sample_channels):
             g = guesses[:, 0, k]
@@ -109,23 +109,25 @@ if 0:
 
 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:
@@ -134,16 +136,36 @@ 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]