From 40d7230bd094ae282d351e911cd0cd4db8f757a8 Mon Sep 17 00:00:00 2001 From: acereca Date: Sat, 2 Jun 2018 09:40:34 +0200 Subject: [PATCH] update 20180601 --- .../processing_cycledepends.py | 101 +++++++++--------- parts/intro.tex | 22 +++- preamble.tex | 2 + thesis.tex | 7 +- 4 files changed, 76 insertions(+), 56 deletions(-) diff --git a/data/m04_cycledepends/processing_cycledepends.py b/data/m04_cycledepends/processing_cycledepends.py index d781a8e..176f183 100644 --- a/data/m04_cycledepends/processing_cycledepends.py +++ b/data/m04_cycledepends/processing_cycledepends.py @@ -5,11 +5,22 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt import VisTools.plotting as vt +import uncertainties as unc +import uncertainties.unumpy as unp + +import statsmodels.api as sm +from statsmodels.stats.outliers_influence import summary_table as st plt.ioff() plt.style.use('bmh') -fig, axarr = plt.subplots(2,1,figsize=(11.88, 8.4)) -data = pd.read_csv("./" + __file__[:-3].split("_")[1] + ".csv") +fig, axarr = plt.subplots( + 2, + 1, + figsize=(9, 8), + gridspec_kw = {'height_ratios':[4,1]} +) +plt.subplots_adjust(hspace=.5) +data = pd.read_csv("./" + __file__[:-3].split("_")[1] + ".csv", comment="#") fits = np.array([]) errs = np.array([]) @@ -21,73 +32,59 @@ print(data) # fit to abs dist linfnc = lambda x,m,c: x*m+c -p = axarr[0].errorbar( - data[data.cycles == 0]['v_set/v'], - data[data.cycles == 0]['Dvk'], - label="relative Error of ADC, keith", - fmt='.' -) - -pfinal, pcov = opt.curve_fit( - linfnc, - data[data.cycles == 0]['v_set/v'], - data[data.cycles == 0]['Dvk'], - p0=(.1,2.6), - sigma=[.5 for e in range(data[data.cycles == 0]['Dv'].size)] -) - -axarr[0].plot( - data[data.cycles == 0]['v_set/v'], - data[data.cycles == 0]['v_set/v']*pfinal[0]+pfinal[1], - label="fitted, keith", - color = p[0].get_color() -) -for i in range(8): +def plot_and_linfit(col: str,fil, l: str): p = axarr[0].errorbar( - data[data.cycles == i]['v_set/v'], - data[data.cycles == i]['Dv'], - yerr=data[data.cycles == i]['dv_pit48/v'], - label="relative Error of ADC, scaler: "+str(i), - fmt='.' + data[fil]['v_set/v'], + data[fil][col], + alpha = 0, + label=None, + # fmt='.', + # antialiased=True ) - pfinal, pcov = opt.curve_fit( - linfnc, - data[data.cycles == i]['v_set/v'], - data[data.cycles == i]['Dv'], - p0=(.1,2.6), - sigma=[.5 for e in range(data[data.cycles == i]['Dv'].size)] - ) - - axarr[0].plot( - data[data.cycles == i]['v_set/v'], - data[data.cycles == i]['v_set/v']*pfinal[0]+pfinal[1], - label="fitted, scaler: "+str(i), + vals = vt.lm_plot( + data[fil], + 'v_set/v', + col, + None, + 'dv_pit48/v', + l, + fig=axarr[0], color = p[0].get_color() ) - fits = np.append(fits, pfinal[0]) - errs = np.append(errs, np.sqrt(pcov[0][0])) - colors = np.append(colors, p[0].get_color() ) + return vals, p -#vt.annotate_val(plt, pfinal[0], np.sqrt(pcov[0][0]), name="V48[2]", data_pos=(44, 3)) +plot_and_linfit('Dvk', data.cycles == 0, 'ref') +for i in range(8): + val, p = plot_and_linfit('Dv', data.cycles == i, 'scaler: {}'.format(i)) + fits = np.append(fits, val[0]) + #errs = np.append(errs, np.sqrt(pcov[0][0])) + #colors = np.append(colors, p[0].get_color() ) -print(fits) + +print(fits[0].n) for i in range(8): axarr[1].errorbar( i, - fits[i], - yerr = errs[i], + fits[i].n, + yerr = fits[i].s, fmt='.', - c = colors[i] + #c = colors[i], ) axarr[0].set_xlabel('V$_{set}$/V') -axarr[0].set_title("PowerIt ADC Calibration: dependency on measurement cycles") +#axarr[0].set_title("PowerIt ADC Calibration: dependency on measurement cycles") axarr[0].set_ylabel('$\Delta$V$_{IN}$ / V') axarr[1].set_xlabel('sampleTicks scaler') axarr[1].set_ylabel('$\Delta(\Delta$V$_{IN})$') +axarr[0].legend(bbox_to_anchor=(0, -.28,1, 1), loc="lower left", + mode="expand", borderaxespad=0, ncol=5) +#plt.tight_layout() +plt.savefig("./" + __file__[:-3].split("_")[1] + ".pdf", dpi=1000, bbox_inches='tight') -plt.tight_layout() -plt.savefig("./" + __file__[:-3].split("_")[1] + ".eps", format='eps', dpi=1000) + +ss, d, ss2 = st(sm.OLS(data[data.cycles == 0]['v_pit48/v'], data[data.cycles == 0]['v_set/v']).fit(), alpha=.05) + +low_ci, high_ci = d[:,4:6].T diff --git a/parts/intro.tex b/parts/intro.tex index 13c1e05..10973c8 100644 --- a/parts/intro.tex +++ b/parts/intro.tex @@ -2,9 +2,25 @@ \chapter{Intro} -\section{The Hardware} +\section{Premise} -The hardware used in this thesis is a PowerIt board, developed in the electronic visions group. It functions as power supply inside of the Waferscale System\footnote{ +\section{Hardware Overview} + +The hardware used in this thesis is a PowerIt board, developed in the electronic visions group\footnote{ + %TODO +}. It functions as power supply inside of the Waferscale System\footnote{ %TODO -}. In which it iis providing the HICANN Chips with ~1.8V and the FPGAs with 9.6V. +} (fig. \ref{wss}). +\begin{figure}[h] + \centering + \includegraphics[width=.9\textwidth]{../InternReport/img/waferscale_system.png} + \caption{WSS} + \label{wss} +\end{figure} +In which it is providing the Wafer with 1.8V and the FPGAs with 9.6V. Its maximum rated Pwerdraw is 2kW. + + +\section{Measurement Hardware} + + diff --git a/preamble.tex b/preamble.tex index d49e27f..23a37b7 100644 --- a/preamble.tex +++ b/preamble.tex @@ -7,6 +7,8 @@ \usepackage{hyperref} \usepackage{tcolorbox} \usepackage{enumitem,amssymb} +\usepackage{graphicx} +\usepackage{svg} \definecolor{myteal}{HTML}{228c9c} %\DeclareTColorBox{blockbox}{ O{width=\textwidth} }{boxrule=0mm, colframe=myteal, valign lower=bottom, on line, lower separated=false, height=.6\textheight, #1} diff --git a/thesis.tex b/thesis.tex index b5f4c52..4d2c0ba 100644 --- a/thesis.tex +++ b/thesis.tex @@ -20,7 +20,12 @@ \tableofcontents \include{./tabs/registerbuffer} - %\include{parts/intro} + \begin{figure} + \centering + \hspace*{-.16\columnwidth} + \includegraphics[width=1.3\columnwidth]{./data/m04_cycledepends/cycledepends.pdf} + \end{figure} + \include{parts/intro} %\include{parts/tasks} %\include{parts/theory} %\include{parts/experiments}