update 20180530 1200
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,10 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
import scipy.optimize as opt
|
||||
import scipy.optimize as opt
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import VisTools.plotting as vt
|
||||
|
||||
plt.ioff()
|
||||
plt.style.use('bmh')
|
||||
@@ -14,14 +15,14 @@ data['Dv'] = data['v_pit48/v'] - data['v_keith/v']
|
||||
print(data)
|
||||
|
||||
axarr[0].errorbar(
|
||||
data['v_keith/v'],
|
||||
data['v_set/v'],
|
||||
data['v_pit48/v'],
|
||||
yerr=data['dv_pit48/v'],
|
||||
label="V$_{MONITOR\_48V}$",
|
||||
fmt='.'
|
||||
)
|
||||
axarr[0].errorbar(
|
||||
data['v_keith/v'],
|
||||
data['v_set/v'],
|
||||
data['v_ps/v'],
|
||||
yerr=data['dv_ps/v'],
|
||||
label="V$_{PS}$",
|
||||
@@ -29,7 +30,7 @@ axarr[0].errorbar(
|
||||
)
|
||||
|
||||
axarr[1].errorbar(
|
||||
data['v_keith/v'],
|
||||
data['v_set/v'],
|
||||
data['Dv'],
|
||||
yerr=data['dv_pit48/v'],
|
||||
label=" absolute Error of ADC",
|
||||
@@ -41,7 +42,7 @@ linfnc = lambda x,m,c: x*m+c
|
||||
|
||||
pfinal, pcov = opt.curve_fit(
|
||||
linfnc,
|
||||
data['v_keith/v'],
|
||||
data['v_set/v'],
|
||||
data['Dv'],
|
||||
p0=(.1,2.6),
|
||||
sigma=[.5 for e in range(data['Dv'].size)]
|
||||
@@ -50,10 +51,13 @@ pfinal, pcov = opt.curve_fit(
|
||||
print( pfinal )
|
||||
|
||||
axarr[1].plot(
|
||||
data['v_keith/v'],
|
||||
data['v_set/v'],
|
||||
data['v_keith/v']*pfinal[0]+pfinal[1]
|
||||
)
|
||||
plt.xlabel('V$_{Keith}$/k$\Omega$')
|
||||
|
||||
vt.annotate_val(plt, pfinal[0], np.sqrt(pcov[0][0]), name="V48[2]", data_pos=(44, 3))
|
||||
|
||||
plt.xlabel('V$_{set}$/V')
|
||||
axarr[0].set_ylabel('V$_{IN}$/V')
|
||||
axarr[0].set_title("PowerIt ADC Calibration: 48V Input")
|
||||
axarr[1].set_ylabel('$\Delta$V$_{IN}$ / V')
|
||||
|
||||
Reference in New Issue
Block a user