diff --git a/dev/test_mb_2024_4_mux_2024.py b/dev/test_mb_2024_4_mux_2024.py index 70a3631424d3af72ecee3f3a1b9b63d3898067fc..f25c5d58ef10e6862af0c32d93ac5c9abc5579ab 100644 --- a/dev/test_mb_2024_4_mux_2024.py +++ b/dev/test_mb_2024_4_mux_2024.py @@ -105,12 +105,14 @@ if within_ohmpi: # k._hw.switch_mux([A, B, M, N], state='off') # print(f'OhmPiHardware Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV') # k._hw._plot_readings() + k.load_sequence('sequences/9991_GRAD_16_s1_a1.txt') + k.run_sequence(tx_volt=5, injection_duration=1., nb_stack=2, duty_cycle=0.5) print('using OhmPi') - d = k.run_measurement([A, B, M, N], injection_duration=1., nb_stack=2, duty_cycle=0.5) - print(d) + #d = k.run_measurement([A, B, M, N], injection_duration=1., nb_stack=2, duty_cycle=0.5) + # print(d) # k._hw._plot_readings() print(f'OhmPiHardware: Resistance: {k._hw.last_resistance() :.2f} ohm, dev. {k._hw.last_dev():.2f} %, sp: {k._hw.sp:.2f} mV, rx bias: {k._hw.rx._bias:.2f} mV') print(f'OhmPi: Resistance: {d["R [ohm]"] :.2f} ohm, dev. {d["R_std [%]"]:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV') - k._hw._plot_readings(save_fig=False) + # k._hw._plot_readings(save_fig=False) # plot_exec_log('ohmpi/logs/exec.log') change_config('../configs/config_default.py', verbose=False) diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index 82653c02065ae1d957a5f5148eca3c201439e656..8798b9162573632827e48d3226c5076960e79b78 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -456,7 +456,7 @@ class OhmPi(object): # check arguments if quad is None: - quad = [0, 0, 0, 0] + quad = np.array([0, 0, 0, 0]) if nb_stack is None: nb_stack = self.settings['nb_stack'] if injection_duration is None: @@ -635,7 +635,7 @@ class OhmPi(object): # self.switch_mux_on(quad) # run a measurement if self.on_pi: - acquired_data = self.run_measurement(quad, **kwargs) + acquired_data = self.run_measurement(quad=quad, **kwargs) else: # for testing, generate random data sum_vmn = np.random.rand(1)[0] * 1000. sum_i = np.random.rand(1)[0] * 100. @@ -810,7 +810,7 @@ class OhmPi(object): self.exec_logger.debug(f'tx pwr voltage: {self._hw.tx.pwr.voltage}, rx max voltage: {self._hw.rx._voltage_max}') return False else: - if quadrupole == [0, 0, 0, 0]: # NOTE: No mux + if np.array(quadrupole).all() == np.array([0, 0, 0, 0]).all(): # NOTE: No mux return True else: return self._hw.switch_mux(electrodes=quadrupole, state='on', bypass_check=bypass_check) diff --git a/requirements.txt b/requirements.txt index 8010a45145eadd15c5e76e6b1f8b836c62734c38..4c649e24d14cd66c5bc3460be933dd9a686ffc60 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,9 +3,11 @@ adafruit-blinka adafruit-circuitpython-ads1x15 adafruit-circuitpython-tca9548a adafruit-circuitpython-mcp230xx +adafruit_extended_bus minimalmodbus gpiozero numpy paho-mqtt termcolor pandas +matplotlib \ No newline at end of file