Commit e87a0119 authored by remi.clement's avatar remi.clement
Browse files

Merge branch 'v2024_rc' of https://gitlab.irstea.fr/reversaal/OhmPi into v2024_rc

Showing with 7 additions and 5 deletions
+7 -5
...@@ -16,6 +16,7 @@ import numpy as np ...@@ -16,6 +16,7 @@ import numpy as np
import csv import csv
import time import time
import pandas as pd import pandas as pd
from zipfile import ZipFile
from shutil import rmtree, make_archive from shutil import rmtree, make_archive
from threading import Thread from threading import Thread
from inspect import getmembers, isfunction from inspect import getmembers, isfunction
...@@ -209,7 +210,8 @@ class OhmPi(object): ...@@ -209,7 +210,8 @@ class OhmPi(object):
last_measurement.update(idic) last_measurement.update(idic)
last_measurement.update(udic) last_measurement.update(udic)
last_measurement.update(tdic) last_measurement.update(tdic)
last_measurement.pop('full_waveform')
last_measurement.pop('full_waveform')
if os.path.isfile(filename): if os.path.isfile(filename):
# Load data file and append data to it # Load data file and append data to it
...@@ -565,7 +567,10 @@ class OhmPi(object): ...@@ -565,7 +567,10 @@ class OhmPi(object):
if isinstance(dd[key], float): if isinstance(dd[key], float):
dd[key] = np.round(dd[key], 3) dd[key] = np.round(dd[key], 3)
dd['cmd_id'] = str(cmd_id) dd['cmd_id'] = str(cmd_id)
# log data to the data logger
self.data_logger.info(dd) self.data_logger.info(dd)
self._hw.switch_mux(electrodes=quad[0:2], roles=['A', 'B'], state='on') self._hw.switch_mux(electrodes=quad[0:2], roles=['A', 'B'], state='on')
time.sleep(1.0) time.sleep(1.0)
self._hw.switch_mux(electrodes=quad[0:2], roles=['A', 'B'], state='off') self._hw.switch_mux(electrodes=quad[0:2], roles=['A', 'B'], state='off')
...@@ -695,9 +700,6 @@ class OhmPi(object): ...@@ -695,9 +700,6 @@ class OhmPi(object):
break break
# run a measurement # run a measurement
acquired_data = self.run_measurement(quad=quad, **kwargs) acquired_data = self.run_measurement(quad=quad, **kwargs)
# log data to the data logger
self.data_logger.info(acquired_data)
# add command_id in dataset # add command_id in dataset
acquired_data.update({'cmd_id': cmd_id}) acquired_data.update({'cmd_id': cmd_id})
...@@ -744,7 +746,7 @@ class OhmPi(object): ...@@ -744,7 +746,7 @@ class OhmPi(object):
if fw_in_zip: if fw_in_zip:
with ZipFile(filename.replace('.csv', '_fw.zip'), 'w') as myzip: with ZipFile(filename.replace('.csv', '_fw.zip'), 'w') as myzip:
myzip.write(filename.repleace('.csv', '_fw.csv')) myzip.write(filename.replace('.csv', '_fw.csv'))
os.remove(filename.replace('.csv', '_fw.csv')) os.remove(filename.replace('.csv', '_fw.csv'))
# reset to idle if we didn't interrupt the sequence # reset to idle if we didn't interrupt the sequence
......
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