diff --git a/doc/source/index.rst b/doc/source/index.rst index 61c63d7e9fd3e019efaea752140d9f9cf1f8ae29..594dc7c8602fa136be4302601e2808f2768e34c8 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -24,8 +24,8 @@ OHMPI: Open source and open hardware resistivity-meter * General tutorials .. image:: img/logo/ohmpi/LOGO_OHMPI.png - :width: 200px - :height: 150px + :width: 168px + :height: 94px :align: left Contents: diff --git a/examples/example_simple_measurement.py b/examples/example_simple_measurement.py index 0ebfc3aec9d62a1832dd1ecfe08f939642e5d38f..8301770ecf653eb7911a857b8f0ccd3697585eef 100644 --- a/examples/example_simple_measurement.py +++ b/examples/example_simple_measurement.py @@ -8,14 +8,14 @@ from ohmpi.ohmpi import OhmPi k = OhmPi() # Update settings if needed -k.update_settings({"injection_duration":0.2}) +k.update_settings({"injection_duration": 1.}) +k.update_settings({"strategy": "constant"}) +k.update_settings({"tx_volt": 3.}) +k.update_settings({"nb_stack": 2}) # Set or load sequence -k.sequence = np.array([[1,2,3,4]]) # set numpy array of shape (n,4) -# k.load_sequence('sequences/ABMN.txt') # load sequence from a local file - -# Run contact resistance check -# k.rs_check() +quad = [1,4,2,3] # set numpy array of shape (n,4) # Run sequence -k.run_sequence() +k.run_measurement(quad) +k.plot_last_fw() \ No newline at end of file diff --git a/examples/example_simple_sequence.py b/examples/example_simple_sequence.py new file mode 100644 index 0000000000000000000000000000000000000000..66035bc631b5b553bc6fbc257bf5119844306493 --- /dev/null +++ b/examples/example_simple_sequence.py @@ -0,0 +1,24 @@ +import os +import numpy as np +import time +os.chdir("/home/pi/OhmPi") +from ohmpi.ohmpi import OhmPi + +# Define object from class OhmPi +k = OhmPi() + +# Update settings if needed +k.update_settings({"injection_duration": 1.}) +k.update_settings({"strategy": "constant"}) +k.update_settings({"tx_volt": 3.}) +k.update_settings({"nb_stack": 2}) + +# Set or load sequence +k.sequence = np.array([[1,4,2,3], [2,5,3,4]]) # set numpy array of shape (n,4) +# k.load_sequence('sequences/ABMN.txt') # load sequence from a local file + +# Run contact resistance check +k.rs_check() + +# Run sequence +k.run_sequence() diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index b16238e90381871f67d8851d6f07bb02ef4dbcfb..135b934d8b93b1ed3deb0b5060098bec7a2d4fc7 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -452,8 +452,15 @@ class OhmPi(object): self.exec_logger.info(f'Restarting pi following command {cmd_id}...') os.system('poweroff') # this may require admin rights - def plot_last_fw(self, save_fig=True, filename=None): - self._hw.plot_readings(save_fig=save_fig, filename=filename) + def plot_last_fw(self, save_fig=False, filename=None): + """Plots last full waveform measurement + + Parameters + ---------- + save_fig: boolean, optional - default (False) + filename: str, optional. Path to save plot. By default figures/test.png""" + + self._hw._plot_readings(save_fig=save_fig, filename=filename) def run_measurement(self, quad=None, nb_stack=None, injection_duration=None, duty_cycle=None, autogain=True, strategy=None, tx_volt=None, best_tx_injtime=0.1,