Commit a1a94217 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Adds a plot

Showing with 5 additions and 0 deletions
+5 -0
import numpy as np import numpy as np
import matplotlib.pyplot as plt
from utils import change_config from utils import change_config
change_config('config_ohmpi_card_3_15.py', verbose=False) change_config('config_ohmpi_card_3_15.py', verbose=False)
from OhmPi.measure import OhmPiHardware from OhmPi.measure import OhmPiHardware
...@@ -7,4 +8,8 @@ k = OhmPiHardware() ...@@ -7,4 +8,8 @@ k = OhmPiHardware()
k._vab_pulse(vab=12, length=1., sampling_rate=10., polarity=1) k._vab_pulse(vab=12, length=1., sampling_rate=10., polarity=1)
r = k.readings[:,2]/k.readings[:,1] r = k.readings[:,2]/k.readings[:,1]
print(f'Mean resistance: {np.mean(r):.3f} Ohms, Dev. {100*np.std(r)/np.mean(r):.1f} %') print(f'Mean resistance: {np.mean(r):.3f} Ohms, Dev. {100*np.std(r)/np.mean(r):.1f} %')
fig, ax = plt.subplots()
ax.plot(r[:,0], r[:, 1], '-r', label='current')
ax2 = ax.twinx()
ax.plot(r[:,0], r[:, 2], '-b', label='voltage')
change_config('config_default.py', verbose=False) change_config('config_default.py', verbose=False)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment