do not imply we plotted at zero
authorDan White <dan@whiteaudio.com>
Thu, 13 Feb 2014 10:53:58 +0000 (04:53 -0600)
committerDan White <dan@whiteaudio.com>
Thu, 13 Feb 2014 11:20:59 +0000 (05:20 -0600)
python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-gm-2.pdf
python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-gm-2.py

index f45eeb4143b24aeb720bc382066315f230f80c53..bbd1cc97930ffaa4cd4ed83bc9a21c67238460ab 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-gm-2.pdf and b/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-gm-2.pdf differ
index 97b1aa1d6843538794655b2b88a1bfe27703c8c6..2913a2379cee52965667558672e12526db647409 100644 (file)
@@ -164,14 +164,25 @@ if 1:
         iout = iout - iout[idx]
 
         gm = 1e12 * iout / vd
+        st = styler.next()
+        #do not plot bad data around zero
+        plot(vd[:idx-1], gm[:idx-1],
+             st,
+             label='%i'%ios)
+        plot(vd[idx+2:], gm[idx+2:],
+             st)
+
+        #calc nonlinearity
         gm = [gm[i] for i in range(len(gm))
               if i not in (idx-1, idx, idx+1)]
         vd = [vd[i] for i in range(len(vd))
               if i not in (idx-1, idx, idx+1)]
-        plot(vd, gm,
-                styler.next(),
-                label='%i'%ios)
 
+        gm = array(gm)
+        dplus = gm.max()/gm.mean() * 100 - 100
+        dminus = gm.min()/gm.mean() * 100 - 100
+        print gm.mean()
+        print '%i: %+5.1f %+5.1f %%' % (ios, dplus, dminus)
 
     hlines(0, -10, 10, linewidth=0.5, color='0.40')
     vlines(0, -1000, 1000, linewidth=0.5, color='0.40')