Commit 205fdfd0 authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

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

Showing with 9 additions and 11 deletions
+9 -11
...@@ -51,8 +51,7 @@ class OhmPi(object): ...@@ -51,8 +51,7 @@ class OhmPi(object):
Dictionnary of parameters. Possible parameters with their default values: Dictionnary of parameters. Possible parameters with their default values:
`{'injection_duration': 0.2, 'nb_meas': 1, 'sequence_delay': 1, `{'injection_duration': 0.2, 'nb_meas': 1, 'sequence_delay': 1,
'nb_stack': 1, 'sampling_interval': 2, 'tx_volt': 5, 'duty_cycle': 0.5, 'nb_stack': 1, 'sampling_interval': 2, 'tx_volt': 5, 'duty_cycle': 0.5,
'strategy': 'constant', 'export_path': None, 'export_dir': 'data', 'strategy': 'constant', 'export_path': None
'export_name': 'measurement.csv'`.
sequence : str, optional sequence : str, optional
Path of the .csv or .txt file with A, B, M and N electrodes. Path of the .csv or .txt file with A, B, M and N electrodes.
Electrode index starts at 1. See `OhmPi.load_sequence()` for full docstring. Electrode index starts at 1. See `OhmPi.load_sequence()` for full docstring.
...@@ -74,8 +73,9 @@ class OhmPi(object): ...@@ -74,8 +73,9 @@ class OhmPi(object):
self._hw = OhmPiHardware(**{'exec_logger': self.exec_logger, 'data_logger': self.data_logger, self._hw = OhmPiHardware(**{'exec_logger': self.exec_logger, 'data_logger': self.data_logger,
'soh_logger': self.soh_logger}) 'soh_logger': self.soh_logger})
self.exec_logger.info('Hardware configured...') self.exec_logger.info('Hardware configured...')
# default acquisition settings # default acquisition settings
self.settings = {}
self.update_settings('settings/default.json') self.update_settings('settings/default.json')
# read in acquisition settings # read in acquisition settings
...@@ -900,10 +900,7 @@ class OhmPi(object): ...@@ -900,10 +900,7 @@ class OhmPi(object):
- nb_stack (number of stack for each quadrupole measurement) - nb_stack (number of stack for each quadrupole measurement)
- strategy (injection strategy: constant, vmax, vmin) - strategy (injection strategy: constant, vmax, vmin)
- duty_cycle (injection duty cycle comprised between 0.5 - 1) - duty_cycle (injection duty cycle comprised between 0.5 - 1)
- export_dir (directory where to export the data) - export_path (path where to export the data, timestamp will be added to filename)
- export_name (name of exported file, timestamp will be added to filename)
- export_path (path where to export the data, timestamp will be added to filename ;
if export_path is given, it goes over export_dir and export_name)
Parameters Parameters
---------- ----------
...@@ -931,10 +928,11 @@ class OhmPi(object): ...@@ -931,10 +928,11 @@ class OhmPi(object):
self.exec_logger.warning('Settings are missing...') self.exec_logger.warning('Settings are missing...')
if self.settings['export_path'] is None: if self.settings['export_path'] is None:
self.settings['export_path'] = os.path.join(self.settings['export_dir'], self.settings['export_name']) self.settings['export_path'] = os.path.join("data", "measurement.csv")
else:
self.settings['export_dir'] = os.path.split(self.settings['export_path'])[0] if not os.path.isabs(self.settings['export_path']):
self.settings['export_name'] = os.path.split(self.settings['export_path'])[1] export_dir = os.path.split(os.path.dirname(__file__))[0]
self.settings['export_path'] = os.path.join(export_dir, self.settings['export_path'])
def run_inversion(self, survey_names=None, elec_spacing=1, **kwargs): def run_inversion(self, survey_names=None, elec_spacing=1, **kwargs):
"""Run a simple 2D inversion using ResIPy (https://gitlab.com/hkex/resipy). """Run a simple 2D inversion using ResIPy (https://gitlab.com/hkex/resipy).
......
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