From: Dan White Date: Sun, 9 Feb 2014 19:04:20 +0000 (-0600) Subject: rename py file to match output X-Git-Tag: cheetah~38 X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=05703885114d6e6fdd7375ada99903314fcdcffa;p=430.git rename py file to match output --- diff --git a/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-gm.py b/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-gm.py new file mode 100644 index 0000000..b59c2d3 --- /dev/null +++ b/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-gm.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python + +from pylab import * + +from glob import glob +import yaml +import scipy.signal as sig + + + + + +close('all') + + +def circular_cycle(a, b): + from itertools import cycle + + a_cycler = cycle(a) + b_cycler = cycle(b) + + while True: + yield a_cycler.next() + b_cycler.next() + +def style_cycle(): + lines = ('-', '--', '-.', ':') + colors = ('b', 'g', 'r', 'k', 'm', 'c') + return circular_cycle(lines, colors) + + +def mkgm(vd, vout, tint, Cint=50e-12): + dvout = diff(vout / tint) + dvd = diff(vd) + gm = Cint * dvout / dvd + return (vd[:-1], gm) + + +def smooth(x, npoints=21.0): + return sig.filtfilt(ones(npoints)/npoints, [1], x) + + +# collect data to plot sorted by offset value +d = {} +for npz in glob('arb0-2013*.npz'): + data = np.load(npz) + cfg = yaml.load(open(npz.replace('.npz', '.yaml'), 'rb')) + ios = cfg['arb']['harmonics'][0]['otaA']['offset'] + + d[ios] = {'data':data, 'fname':npz} + + +if 0: + figure(figsize=(5.0, 3.5)) + subplots_adjust(top=0.98, bottom=0.12, left=0.15, right=0.95) + + for ios in sorted(d.keys()): + if ios == 100: + continue + + data = d[ios]['data'] + tint = data['tint'] + vd = data['vd'] + vout = data['vout'] + + vdgm, dgm = mkgm(vd, vout, tint) + + #plot(vdgm, dgm, 'b.', label='raw') + plot(vdgm, 1e12*smooth(dgm, 15.0), + linewidth=2.0, + label=ios) + + + legend(loc='best', ncol=2) + + #xlim((-2.0, 2.0)) + xlabel('$V_d$ (V)') + ylim((0, 100)) + ylabel('$g_m$ (pA/V)') + + savefig('arb0-chip14-gm.pdf') + + + + + +if 1: + figure(figsize=(5.0, 5.5)) + subplots_adjust(top=0.98, bottom=0.08, left=0.14, right=0.98) + + + subplot(211) + styler = style_cycle() + for ios in sorted(d.keys()): + #if ios == 100: + #continue + + data = d[ios]['data'] + tint = data['tint'] + vd = data['vd'] + vout = data['vout'] + + iout = 50e-12 * vout / tint + plot(vd, 1e12*iout, + styler.next(), + label='%i'%ios) + + + hlines(0, -10, 10, linewidth=0.5, color='0.40') + vlines(0, -1000, 1000, linewidth=0.5, color='0.40') + + xlim((-2.5, 2.5)) + ylim((-180, 180)) + ylabel('$I_{out}$ (pA)') + + legend(title='offset code', + loc='lower right', + ncol=2, + fontsize='medium', + handletextpad=0.2, + labelspacing=0.2) + + subplot(212) + styler = style_cycle() #reset iterator + for ios in sorted(d.keys()): + #if ios == 100: + #continue + + data = d[ios]['data'] + tint = data['tint'] + vd = data['vd'] + vout = data['vout'] + + vdgm, dgm = mkgm(vd, vout, tint) + + #plot(vdgm, dgm, 'b.', label='raw') + #plot(vd, 1e12*smooth(50e-12*vout/tint, 15.0)/vd, + plot(vdgm, 1e12*smooth(dgm, 15.0), + styler.next(), + label=ios) + + xlim((-2.5, 2.5)) + hlines(0, -10, 10, linewidth=0.5, color='0.40') + vlines(0, -1000, 1000, linewidth=0.5, color='0.40') + ylim((-5, 100)) + #ylabel(r'$g_m = dI_{out}/dV_d$ (pA/V)') + ylabel(r'$G_m$ (pA/V)') + xlabel('$V_d$ (V)') + + savefig('arb0-chip14-iout-gm.pdf') + diff --git a/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-raw.pdf b/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-raw.pdf new file mode 100644 index 0000000..f642d26 Binary files /dev/null and b/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-raw.pdf differ diff --git a/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-raw.py b/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-raw.py new file mode 100644 index 0000000..3faf008 --- /dev/null +++ b/python-lib/test-data/chip14/arb0/vios-offset-gm/arb0-chip14-iout-raw.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python + +from pylab import * + +from glob import glob +from itertools import cycle +import yaml + +import scipy.signal as sig + +close('all') + + +def circular_cycle(a, b): + a_cycler = cycle(a) + b_cycler = cycle(b) + while True: + yield a_cycler.next() + b_cycler.next() + + +colors = ('b', 'g', 'r', 'k', 'm', 'c') +lines = ('-', '--', '-.', ':') + + +def color_cycle(): + return cycle(colors) + + +def line_cycle(): + return cycle(lines) + + +def style_cycle(): + return circular_cycle(lines, colors) + + +def mkgm(vd, vout, tint, Cint=50e-12): + dvout = diff(vout / tint) + dvd = diff(vd) + gm = Cint * dvout / dvd + return (vd[:-1], gm) + + +def smooth(x, npoints=21.0): + return sig.filtfilt(ones(npoints)/npoints, [1], x) + + +# collect data to plot sorted by offset value +d = {} +for npz in glob('arb0-2013*.npz'): + data = np.load(npz) + cfg = yaml.load(open(npz.replace('.npz', '.yaml'), 'rb')) + ios = cfg['arb']['harmonics'][0]['otaA']['offset'] + + d[ios] = {'data': data, 'fname': npz} + + + + + + + +if 1: + figure(figsize=(5.0, 3.5)) + subplots_adjust(top=0.98, bottom=0.12, left=0.14, right=0.98) + + import matplotlib.gridspec as gridspec + gs = gridspec.GridSpec(2, 1, height_ratios=[2, 1]) + + ax1 = plt.subplot(gs[0]) + + #select the raw plot by offset code + ios = 105 + + data = d[ios]['data'] + tint = data['tint'] + vd = data['vd'] + vout = data['vout'] + + plot(vd, vout, + '.', + label='%i'%ios) + + hlines(0, -10, 10, linewidth=0.5, color='0.40') + vlines(0, -1000, 1000, linewidth=0.5, color='0.40') + + xlim((-2.5, 2.5)) + ylim((-1.1, 1.1)) + ylabel('$V_{out}$ (V)') + + legend(title='offset code', + loc='lower right', + ncol=2, + fontsize='medium', + handletextpad=0.2, + labelspacing=0.2) + + + + + #subplot(212) + ax2 = plt.subplot(gs[1]) + # same offset code + data = d[ios]['data'] + tint = data['tint'] + vd = data['vd'] + vout = data['vout'] + + plot(vd, tint, + '.', + label='integration time') + + hlines(0, -10, 10, linewidth=0.5, color='0.40') + vlines(0, -10, 10, linewidth=0.5, color='0.40') + + xlim((-2.5, 2.5)) + ylim((0, 2.2)) + + ylabel(r'$t_{int}$ (s)') + xlabel('$V_d$ (V)') + + savefig('arb0-chip14-iout-raw.pdf') + diff --git a/python-lib/test-data/chip14/arb0/vios-offset-gm/gm2.py b/python-lib/test-data/chip14/arb0/vios-offset-gm/gm2.py deleted file mode 100644 index b59c2d3..0000000 --- a/python-lib/test-data/chip14/arb0/vios-offset-gm/gm2.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python - -from pylab import * - -from glob import glob -import yaml -import scipy.signal as sig - - - - - -close('all') - - -def circular_cycle(a, b): - from itertools import cycle - - a_cycler = cycle(a) - b_cycler = cycle(b) - - while True: - yield a_cycler.next() + b_cycler.next() - -def style_cycle(): - lines = ('-', '--', '-.', ':') - colors = ('b', 'g', 'r', 'k', 'm', 'c') - return circular_cycle(lines, colors) - - -def mkgm(vd, vout, tint, Cint=50e-12): - dvout = diff(vout / tint) - dvd = diff(vd) - gm = Cint * dvout / dvd - return (vd[:-1], gm) - - -def smooth(x, npoints=21.0): - return sig.filtfilt(ones(npoints)/npoints, [1], x) - - -# collect data to plot sorted by offset value -d = {} -for npz in glob('arb0-2013*.npz'): - data = np.load(npz) - cfg = yaml.load(open(npz.replace('.npz', '.yaml'), 'rb')) - ios = cfg['arb']['harmonics'][0]['otaA']['offset'] - - d[ios] = {'data':data, 'fname':npz} - - -if 0: - figure(figsize=(5.0, 3.5)) - subplots_adjust(top=0.98, bottom=0.12, left=0.15, right=0.95) - - for ios in sorted(d.keys()): - if ios == 100: - continue - - data = d[ios]['data'] - tint = data['tint'] - vd = data['vd'] - vout = data['vout'] - - vdgm, dgm = mkgm(vd, vout, tint) - - #plot(vdgm, dgm, 'b.', label='raw') - plot(vdgm, 1e12*smooth(dgm, 15.0), - linewidth=2.0, - label=ios) - - - legend(loc='best', ncol=2) - - #xlim((-2.0, 2.0)) - xlabel('$V_d$ (V)') - ylim((0, 100)) - ylabel('$g_m$ (pA/V)') - - savefig('arb0-chip14-gm.pdf') - - - - - -if 1: - figure(figsize=(5.0, 5.5)) - subplots_adjust(top=0.98, bottom=0.08, left=0.14, right=0.98) - - - subplot(211) - styler = style_cycle() - for ios in sorted(d.keys()): - #if ios == 100: - #continue - - data = d[ios]['data'] - tint = data['tint'] - vd = data['vd'] - vout = data['vout'] - - iout = 50e-12 * vout / tint - plot(vd, 1e12*iout, - styler.next(), - label='%i'%ios) - - - hlines(0, -10, 10, linewidth=0.5, color='0.40') - vlines(0, -1000, 1000, linewidth=0.5, color='0.40') - - xlim((-2.5, 2.5)) - ylim((-180, 180)) - ylabel('$I_{out}$ (pA)') - - legend(title='offset code', - loc='lower right', - ncol=2, - fontsize='medium', - handletextpad=0.2, - labelspacing=0.2) - - subplot(212) - styler = style_cycle() #reset iterator - for ios in sorted(d.keys()): - #if ios == 100: - #continue - - data = d[ios]['data'] - tint = data['tint'] - vd = data['vd'] - vout = data['vout'] - - vdgm, dgm = mkgm(vd, vout, tint) - - #plot(vdgm, dgm, 'b.', label='raw') - #plot(vd, 1e12*smooth(50e-12*vout/tint, 15.0)/vd, - plot(vdgm, 1e12*smooth(dgm, 15.0), - styler.next(), - label=ios) - - xlim((-2.5, 2.5)) - hlines(0, -10, 10, linewidth=0.5, color='0.40') - vlines(0, -1000, 1000, linewidth=0.5, color='0.40') - ylim((-5, 100)) - #ylabel(r'$g_m = dI_{out}/dV_d$ (pA/V)') - ylabel(r'$G_m$ (pA/V)') - xlabel('$V_d$ (V)') - - savefig('arb0-chip14-iout-gm.pdf') -