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')