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

Fixes a bug in vab_square_wave; Fixes a bug in test_measure_with_ohmpi_card_3_15.py

No related merge requests found
Showing with 2 additions and 2 deletions
+2 -2
...@@ -152,7 +152,7 @@ class OhmPiHardware: ...@@ -152,7 +152,7 @@ class OhmPiHardware:
return vab, polarity, rab return vab, polarity, rab
def vab_square_wave(self, vab, length, sampling_rate, cycles=3): def vab_square_wave(self, vab, length, sampling_rate, cycles=3):
self._vab_pulses(self, vab, [length]*cycles, sampling_rate) self._vab_pulses(vab, [length]*cycles, sampling_rate)
def _vab_pulse(self, vab, length, sampling_rate=None, polarity=None, append=False): def _vab_pulse(self, vab, length, sampling_rate=None, polarity=None, append=False):
""" Gets VMN and IAB from a single voltage pulse """ Gets VMN and IAB from a single voltage pulse
......
...@@ -6,7 +6,7 @@ from OhmPi.measure import OhmPiHardware ...@@ -6,7 +6,7 @@ from OhmPi.measure import OhmPiHardware
k = OhmPiHardware() k = OhmPiHardware()
k.vab_square_wave(vab=12, length=1., sampling_rate=k.rx.sampling_rate, cycles=3) k.vab_square_wave(vab=12, length=1., sampling_rate=k.rx.sampling_rate, cycles=3)
r = k.readings[:,4]*k.readings[:,2]/k.readings[:,1] r = k.readings[:,3]*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} %')
print(f'sampling rate: {k.rx.sampling_rate:.1f} ms, mean sample spacing: {np.mean(np.diff(k.readings[:,0]))*1000.:.1f} ms') print(f'sampling rate: {k.rx.sampling_rate:.1f} ms, mean sample spacing: {np.mean(np.diff(k.readings[:,0]))*1000.:.1f} ms')
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