From 749480b49222803f3204977c9982fc5dbeca10fb Mon Sep 17 00:00:00 2001 From: Dan White Date: Fri, 21 Sep 2012 13:08:22 -0500 Subject: [PATCH] Histogram of all channels x runs --- python-lib/test-data/chip02/stats.py | 96 +++++++++++++++++----------- 1 file changed, 58 insertions(+), 38 deletions(-) diff --git a/python-lib/test-data/chip02/stats.py b/python-lib/test-data/chip02/stats.py index b00fa3b..9f3296d 100644 --- a/python-lib/test-data/chip02/stats.py +++ b/python-lib/test-data/chip02/stats.py @@ -60,45 +60,65 @@ for infile in infiles: cv = array(cal_values) co = array(cal_outs) -for i,k in enumerate(sample_channels): - subplot(N_PLOTS, N_COLS, N_COLS*i+3) - data = cv[:, 0, k] + +if 0: + figure() + for i,k in enumerate(sample_channels): + subplot(N_PLOTS, N_COLS, N_COLS*i+3) + data = cv[:, 0, k] + hist(data, bins=range(128), align='left') + xlim((data.min()-1, data.max()+1)) + xlim((0, 127)) + + subplot(N_PLOTS, N_COLS, N_COLS*i+4) + data = 1e3*(2.5/2/2**13)*co[:, 0, k] + dm = max((abs(data.min()), abs(data.max()))) + print dm + dm = max(dm, 50) + hist(data, bins=100, range=(-dm, dm), align='left') + xlim((-dm, dm)) + #ylim((0, 50)) + + subplot(N_PLOTS, N_COLS, 1) + title('Offset DAC value') + subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+1) + xlabel('Iteration step') + + subplot(N_PLOTS, N_COLS, 2) + title('Vout (mV)') + subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+2) + xlabel('Iteration step') + + subplot(N_PLOTS, N_COLS, 3) + title('Offset DAC histogram') + subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+3) + xlabel('OTA tuning DAC') + + subplot(N_PLOTS, N_COLS, 4) + title('Vout (mV) histogram') + subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+4) + xlabel('Residual Voos (mV)') + + suptitle('Calibration data from %s\nNruns = %i' % + (os.path.basename(os.getcwd()), + len(infiles))) + + +if 1: + figure() + data = cv.flatten() hist(data, bins=range(128), align='left') - xlim((data.min()-1, data.max()+1)) - xlim((0, 127)) - - subplot(N_PLOTS, N_COLS, N_COLS*i+4) - data = 1e3*(2.5/2/2**13)*co[:, 0, k] - dm = max((abs(data.min()), abs(data.max()))) - print dm - dm = max(dm, 50) - hist(data, bins=100, range=(-dm, dm), align='left') - xlim((-dm, dm)) - #ylim((0, 50)) - -subplot(N_PLOTS, N_COLS, 1) -title('Offset DAC value') -subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+1) -xlabel('Iteration step') - -subplot(N_PLOTS, N_COLS, 2) -title('Vout (mV)') -subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+2) -xlabel('Iteration step') - -subplot(N_PLOTS, N_COLS, 3) -title('Offset DAC histogram') -subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+3) -xlabel('OTA tuning DAC') - -subplot(N_PLOTS, N_COLS, 4) -title('Vout (mV) histogram') -subplot(N_PLOTS, N_COLS, (N_PLOTS-1)*N_COLS+4) -xlabel('Residual Voos (mV)') - -suptitle('Calibration data from %s\nNruns = %i' % - (os.path.basename(os.getcwd()), - len(infiles))) + xlabel('OTA tuning DAC value') + title('Channel offset tuning histogram\n48x2 channels x %i runs' % + (len(infiles),)) + + + 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),)) print sample_runs print [infiles[s] for s in sample_runs] -- 2.25.1