tomwer 1.3.4__py3-none-any.whl → 1.3.26__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +1 -0
  2. orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +184 -184
  3. tomwer/app/canvas_launcher/mainwindow.py +0 -1
  4. tomwer/app/zstitching.py +0 -1
  5. tomwer/core/cluster/cluster.py +0 -9
  6. tomwer/core/process/control/datalistener/datalistener.py +15 -12
  7. tomwer/core/process/control/datawatcher/edfdwprocess.py +0 -9
  8. tomwer/core/process/reconstruction/axis/axis.py +3 -3
  9. tomwer/core/process/reconstruction/axis/params.py +3 -3
  10. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +37 -8
  11. tomwer/core/process/reconstruction/nabu/nabucommon.py +3 -4
  12. tomwer/core/process/reconstruction/nabu/nabuscores.py +1 -0
  13. tomwer/core/process/reconstruction/nabu/nabuslices.py +6 -52
  14. tomwer/core/process/reconstruction/nabu/nabuvolume.py +2 -5
  15. tomwer/core/process/reconstruction/nabu/utils.py +10 -2
  16. tomwer/core/process/reconstruction/saaxis/saaxis.py +2 -0
  17. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +2 -0
  18. tomwer/core/process/task.py +4 -2
  19. tomwer/core/process/test/test_data_transfer.py +4 -3
  20. tomwer/core/scan/blissscan.py +3 -3
  21. tomwer/core/scan/nxtomoscan.py +2 -2
  22. tomwer/core/scan/scanbase.py +5 -6
  23. tomwer/core/utils/scanutils.py +5 -1
  24. tomwer/gui/cluster/slurm.py +1 -21
  25. tomwer/gui/cluster/test/test_cluster.py +0 -1
  26. tomwer/gui/control/datawatcher/datawatcher.py +1 -24
  27. tomwer/gui/control/reducedarkflatselector.py +2 -2
  28. tomwer/gui/control/selectorwidgetbase.py +3 -1
  29. tomwer/gui/edit/dkrfpatch.py +4 -4
  30. tomwer/gui/edit/nxtomoeditor.py +28 -20
  31. tomwer/gui/edit/nxtomowarmer.py +3 -2
  32. tomwer/gui/edit/test/test_nx_editor.py +58 -1
  33. tomwer/gui/imagefromfile.py +2 -2
  34. tomwer/gui/qfolderdialog.py +4 -0
  35. tomwer/gui/reconstruction/axis/axis.py +16 -13
  36. tomwer/gui/reconstruction/axis/radioaxis.py +3 -1
  37. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +11 -0
  38. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +16 -14
  39. tomwer/gui/reconstruction/saaxis/saaxis.py +2 -2
  40. tomwer/gui/stitching/stitching.py +8 -3
  41. tomwer/gui/visualization/dataviewer.py +27 -15
  42. tomwer/gui/visualization/diffviewer/diffviewer.py +9 -8
  43. tomwer/gui/visualization/volumeviewer.py +10 -4
  44. tomwer/io/utils/h5pyutils.py +3 -7
  45. tomwer/io/utils/utils.py +3 -3
  46. tomwer/synctools/stacks/reconstruction/castvolume.py +20 -5
  47. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +10 -0
  48. tomwer/tests/datasets.py +5 -1
  49. tomwer/utils.py +1 -4
  50. tomwer/version.py +1 -1
  51. tomwer-1.3.26-py3.11-nspkg.pth +1 -0
  52. {tomwer-1.3.4.dist-info → tomwer-1.3.26.dist-info}/METADATA +34 -48
  53. {tomwer-1.3.4.dist-info → tomwer-1.3.26.dist-info}/RECORD +58 -58
  54. {tomwer-1.3.4.dist-info → tomwer-1.3.26.dist-info}/WHEEL +1 -1
  55. tomwer-1.3.4-py3.11-nspkg.pth +0 -1
  56. {tomwer-1.3.4.dist-info → tomwer-1.3.26.dist-info}/LICENSE +0 -0
  57. {tomwer-1.3.4.dist-info → tomwer-1.3.26.dist-info}/entry_points.txt +0 -0
  58. {tomwer-1.3.4.dist-info → tomwer-1.3.26.dist-info}/namespace_packages.txt +0 -0
  59. {tomwer-1.3.4.dist-info → tomwer-1.3.26.dist-info}/top_level.txt +0 -0
@@ -152,6 +152,7 @@ class DarkRefAndCopyOW(SuperviseOW, WidgetLongProcessing):
152
152
  self.widget.recons_params.sigChanged.connect(self._updateSettingsVals)
153
153
  self.widget.sigModeAutoChanged.connect(self._updateSettingsVals)
154
154
  self.widget.sigCopyActivationChanged.connect(self._updateSettingsVals)
155
+ self.widget.sigClearCache.connect(self._processing_stack.clear_cache)
155
156
  self._processing_stack.sigComputationStarted.connect(self._startProcessing)
156
157
  self._processing_stack.sigComputationEnded.connect(self._endProcessing)
157
158
  self._processing_stack.sigRefSetted.connect(self.widget.setRefSetBy)
@@ -1,184 +1,184 @@
1
- import logging
2
-
3
- from orangewidget import gui
4
- from orangewidget.settings import Setting
5
- from orangewidget.widget import Input, Output
6
- from orangecontrib.tomwer.orange.managedprocess import TomwerWithStackStack
7
- from silx.gui import qt
8
- from typing import Optional
9
-
10
- from tomwer.core.futureobject import FutureTomwerObject
11
- from tomwer.core.scan.scanbase import TomwerScanBase
12
- from tomwer.gui.reconstruction.nabu.helical import HelicalPrepareWeightsDouble
13
- from tomwer.core.process.reconstruction.nabu.helical import (
14
- NabuHelicalPrepareWeightsDouble,
15
- )
16
- from tomwer.core.scan.nxtomoscan import NXtomoScan
17
-
18
- _logger = logging.getLogger(__name__)
19
-
20
-
21
- class NabuHelicalPrepareWeightsDoubleOW(
22
- TomwerWithStackStack,
23
- ewokstaskclass=NabuHelicalPrepareWeightsDouble,
24
- ):
25
- """
26
- widget used to call the `nabu-helical-prepare-weights-double` application on a dedicated thread. It define weights map and double flat field.
27
-
28
- :param parent: the parent widget
29
- """
30
-
31
- # note of this widget should be the one registered on the documentation
32
- name = "helical prerate weights double"
33
- id = "orangecontrib.tomwer.widgets.reconstruction.NabuHelicalPrepareWeightsDoubleOW.NabuHelicalPrepareWeightsDoubleOW"
34
- description = "compute map of weights requested for nabu helical reconstruction"
35
- icon = "icons/nabu_prepare_weights_double.svg"
36
- priority = 199
37
- keywords = [
38
- "tomography",
39
- "nabu",
40
- "reconstruction",
41
- "nabu-helical",
42
- "helical",
43
- "weights",
44
- "prepare",
45
- ]
46
-
47
- want_main_area = True
48
- want_control_area = False
49
- resizing_enabled = True
50
-
51
- _ewoks_default_inputs = Setting(
52
- {
53
- "data": None,
54
- "transition_width_vertical": 50,
55
- "transition_width_horizontal": 50,
56
- "processes_file": "",
57
- "rotation_axis_position": 0,
58
- }
59
- )
60
-
61
- _ewoks_inputs_to_hide_from_orange = (
62
- "progress",
63
- "processes_file",
64
- "transition_width_vertical",
65
- "transition_width_horizontal",
66
- "rotation_axis_position",
67
- )
68
-
69
- sigScanReady = qt.Signal(TomwerScanBase)
70
- "Signal emitted when a scan is ended"
71
-
72
- TIMEOUT = 30
73
-
74
- class Inputs:
75
- data = Input(
76
- name="data",
77
- type=TomwerScanBase,
78
- doc="one scan to be process",
79
- default=True,
80
- multiple=False,
81
- )
82
-
83
- class Outputs:
84
- data = Output(name="data", type=TomwerScanBase, doc="one scan to be process")
85
- future_tomo_obj = Output(
86
- name="future_tomo_obj",
87
- type=FutureTomwerObject,
88
- doc="future object (process remotely)",
89
- )
90
-
91
- LOGGER = _logger
92
-
93
- def __init__(self, parent=None):
94
- super().__init__(parent)
95
- self.__scan = None
96
-
97
- # gui definition
98
- _layout = gui.vBox(self.mainArea, self.name).layout()
99
- self.widget = HelicalPrepareWeightsDouble(parent=self)
100
- _layout.addWidget(self.widget)
101
-
102
- ## connect signal / slot
103
- self.widget.sigConfigChanged.connect(self._updateSettings)
104
-
105
- if isinstance(self.task_output_changed_callbacks, set):
106
- self.task_output_changed_callbacks.add(self._notify_state)
107
- elif isinstance(self.task_output_changed_callbacks, list):
108
- self.task_output_changed_callbacks.append(self._notify_state)
109
- else:
110
- raise NotImplementedError
111
-
112
- ## handle settings
113
- self._loadSettings()
114
- self.task_executor_queue.sigComputationStarted.connect(self._newTaskStarted)
115
-
116
- def _updateSettings(self):
117
- config = self.widget.getConfiguration()
118
- for key in ("transition_width", "processes_file"):
119
- self._ewoks_default_inputs[key] = config[key] # pylint: disable=E1137
120
-
121
- @property
122
- def request_input(self):
123
- return self.__request_input
124
-
125
- @request_input.setter
126
- def request_input(self, request):
127
- self.__request_input = request
128
-
129
- def get_task_inputs(self):
130
- assert self.__scan is not None
131
- return {
132
- "data": self.__scan,
133
- "transition_width": self.widget.getConfiguration()["transition_width"],
134
- "processes_file": self.widget.getConfiguration()["processes_file"],
135
- }
136
-
137
- def handleNewSignals(self) -> None:
138
- """Invoked by the workflow signal propagation manager after all
139
- signals handlers have been called.
140
- """
141
- # for now we want to avoid propagation any processing.
142
- # task will be executed only when the user validates the dialog
143
- data = super().get_task_inputs().get("data", None)
144
- if data is not None:
145
- if not isinstance(data, NXtomoScan):
146
- raise TypeError(
147
- f"data is expected to be an instance of NXtomoScan. {type(data)} are not handled"
148
- )
149
- self.add(data.path)
150
-
151
- def _loadSettings(self):
152
- self.widget.setConfiguration(self._ewoks_default_inputs)
153
-
154
- def _newTaskStarted(self):
155
- try:
156
- task_executor = self.sender()
157
- scan = task_executor.current_task.inputs.data
158
- self.notify_on_going(scan)
159
- except Exception:
160
- pass
161
-
162
- def _notify_state(self):
163
- try:
164
- task_executor = self.sender()
165
- task_suceeded = task_executor.succeeded
166
- scan = task_executor.current_task.outputs.data
167
- if task_suceeded:
168
- self.notify_succeed(scan=scan)
169
- else:
170
- self.notify_failed(scan=scan)
171
- except Exception as e:
172
- _logger.error(f"failed to handle task finished callback. Raiseon is {e}")
173
-
174
- @Inputs.data
175
- def process_data(self, scan: Optional[TomwerScanBase]):
176
- if scan is None:
177
- return
178
- else:
179
- self.__scan = scan
180
- self.notify_pending(scan=scan)
181
- self.execute_ewoks_task()
182
-
183
- def sizeHint(self) -> qt.QSize:
184
- return qt.QSize(650, 60)
1
+ # import logging
2
+
3
+ # from orangewidget import gui
4
+ # from orangewidget.settings import Setting
5
+ # from orangewidget.widget import Input, Output
6
+ # from orangecontrib.tomwer.orange.managedprocess import TomwerWithStackStack
7
+ # from silx.gui import qt
8
+ # from typing import Optional
9
+
10
+ # from tomwer.core.futureobject import FutureTomwerObject
11
+ # from tomwer.core.scan.scanbase import TomwerScanBase
12
+ # from tomwer.gui.reconstruction.nabu.helical import HelicalPrepareWeightsDouble
13
+ # from tomwer.core.process.reconstruction.nabu.helical import (
14
+ # NabuHelicalPrepareWeightsDouble,
15
+ # )
16
+ # from tomwer.core.scan.nxtomoscan import NXtomoScan
17
+
18
+ # _logger = logging.getLogger(__name__)
19
+
20
+
21
+ # class NabuHelicalPrepareWeightsDoubleOW(
22
+ # TomwerWithStackStack,
23
+ # ewokstaskclass=NabuHelicalPrepareWeightsDouble,
24
+ # ):
25
+ # """
26
+ # widget used to call the `nabu-helical-prepare-weights-double` application on a dedicated thread. It define weights map and double flat field.
27
+
28
+ # :param parent: the parent widget
29
+ # """
30
+
31
+ # # note of this widget should be the one registered on the documentation
32
+ # name = "helical prerate weights double"
33
+ # id = "orangecontrib.tomwer.widgets.reconstruction.NabuHelicalPrepareWeightsDoubleOW.NabuHelicalPrepareWeightsDoubleOW"
34
+ # description = "compute map of weights requested for nabu helical reconstruction"
35
+ # icon = "icons/nabu_prepare_weights_double.svg"
36
+ # priority = 199
37
+ # keywords = [
38
+ # "tomography",
39
+ # "nabu",
40
+ # "reconstruction",
41
+ # "nabu-helical",
42
+ # "helical",
43
+ # "weights",
44
+ # "prepare",
45
+ # ]
46
+
47
+ # want_main_area = True
48
+ # want_control_area = False
49
+ # resizing_enabled = True
50
+
51
+ # _ewoks_default_inputs = Setting(
52
+ # {
53
+ # "data": None,
54
+ # "transition_width_vertical": 50,
55
+ # "transition_width_horizontal": 50,
56
+ # "processes_file": "",
57
+ # "rotation_axis_position": 0,
58
+ # }
59
+ # )
60
+
61
+ # _ewoks_inputs_to_hide_from_orange = (
62
+ # "progress",
63
+ # "processes_file",
64
+ # "transition_width_vertical",
65
+ # "transition_width_horizontal",
66
+ # "rotation_axis_position",
67
+ # )
68
+
69
+ # sigScanReady = qt.Signal(TomwerScanBase)
70
+ # "Signal emitted when a scan is ended"
71
+
72
+ # TIMEOUT = 30
73
+
74
+ # class Inputs:
75
+ # data = Input(
76
+ # name="data",
77
+ # type=TomwerScanBase,
78
+ # doc="one scan to be process",
79
+ # default=True,
80
+ # multiple=False,
81
+ # )
82
+
83
+ # class Outputs:
84
+ # data = Output(name="data", type=TomwerScanBase, doc="one scan to be process")
85
+ # future_tomo_obj = Output(
86
+ # name="future_tomo_obj",
87
+ # type=FutureTomwerObject,
88
+ # doc="future object (process remotely)",
89
+ # )
90
+
91
+ # LOGGER = _logger
92
+
93
+ # def __init__(self, parent=None):
94
+ # super().__init__(parent)
95
+ # self.__scan = None
96
+
97
+ # # gui definition
98
+ # _layout = gui.vBox(self.mainArea, self.name).layout()
99
+ # self.widget = HelicalPrepareWeightsDouble(parent=self)
100
+ # _layout.addWidget(self.widget)
101
+
102
+ # ## connect signal / slot
103
+ # self.widget.sigConfigChanged.connect(self._updateSettings)
104
+
105
+ # if isinstance(self.task_output_changed_callbacks, set):
106
+ # self.task_output_changed_callbacks.add(self._notify_state)
107
+ # elif isinstance(self.task_output_changed_callbacks, list):
108
+ # self.task_output_changed_callbacks.append(self._notify_state)
109
+ # else:
110
+ # raise NotImplementedError
111
+
112
+ # ## handle settings
113
+ # self._loadSettings()
114
+ # self.task_executor_queue.sigComputationStarted.connect(self._newTaskStarted)
115
+
116
+ # def _updateSettings(self):
117
+ # config = self.widget.getConfiguration()
118
+ # for key in ("transition_width", "processes_file"):
119
+ # self._ewoks_default_inputs[key] = config[key] # pylint: disable=E1137
120
+
121
+ # @property
122
+ # def request_input(self):
123
+ # return self.__request_input
124
+
125
+ # @request_input.setter
126
+ # def request_input(self, request):
127
+ # self.__request_input = request
128
+
129
+ # def get_task_inputs(self):
130
+ # assert self.__scan is not None
131
+ # return {
132
+ # "data": self.__scan,
133
+ # "transition_width": self.widget.getConfiguration()["transition_width"],
134
+ # "processes_file": self.widget.getConfiguration()["processes_file"],
135
+ # }
136
+
137
+ # def handleNewSignals(self) -> None:
138
+ # """Invoked by the workflow signal propagation manager after all
139
+ # signals handlers have been called.
140
+ # """
141
+ # # for now we want to avoid propagation any processing.
142
+ # # task will be executed only when the user validates the dialog
143
+ # data = super().get_task_inputs().get("data", None)
144
+ # if data is not None:
145
+ # if not isinstance(data, NXtomoScan):
146
+ # raise TypeError(
147
+ # f"data is expected to be an instance of NXtomoScan. {type(data)} are not handled"
148
+ # )
149
+ # self.add(data.path)
150
+
151
+ # def _loadSettings(self):
152
+ # self.widget.setConfiguration(self._ewoks_default_inputs)
153
+
154
+ # def _newTaskStarted(self):
155
+ # try:
156
+ # task_executor = self.sender()
157
+ # scan = task_executor.current_task.inputs.data
158
+ # self.notify_on_going(scan)
159
+ # except Exception:
160
+ # pass
161
+
162
+ # def _notify_state(self):
163
+ # try:
164
+ # task_executor = self.sender()
165
+ # task_suceeded = task_executor.succeeded
166
+ # scan = task_executor.current_task.outputs.data
167
+ # if task_suceeded:
168
+ # self.notify_succeed(scan=scan)
169
+ # else:
170
+ # self.notify_failed(scan=scan)
171
+ # except Exception as e:
172
+ # _logger.error(f"failed to handle task finished callback. Raiseon is {e}")
173
+
174
+ # @Inputs.data
175
+ # def process_data(self, scan: Optional[TomwerScanBase]):
176
+ # if scan is None:
177
+ # return
178
+ # else:
179
+ # self.__scan = scan
180
+ # self.notify_pending(scan=scan)
181
+ # self.execute_ewoks_task()
182
+
183
+ # def sizeHint(self) -> qt.QSize:
184
+ # return qt.QSize(650, 60)
@@ -281,7 +281,6 @@ class _OMain(ocMain):
281
281
  signal.signal(signal.SIGINT, signal.SIG_DFL)
282
282
  # Disable pyqtgraph's atexit and QApplication.aboutToQuit cleanup handlers.
283
283
  pyqtgraph.setConfigOption("exitCleanup", False)
284
- print("argv are", argv)
285
284
  super().run(argv)
286
285
 
287
286
  def argument_parser(self) -> argparse.ArgumentParser:
tomwer/app/zstitching.py CHANGED
@@ -56,7 +56,6 @@ class MainWidget(qt.QTabWidget):
56
56
  "partition": settingsClass.PARTITION,
57
57
  "n_gpus": settingsClass.N_GPUS_PER_WORKER,
58
58
  "job_name": settingsClass.PROJECT_NAME,
59
- "walltime": settingsClass.DEFAULT_WALLTIME,
60
59
  "python_venv": settingsClass.PYTHON_VENV,
61
60
  }
62
61
  )
@@ -48,7 +48,6 @@ class SlurmClusterConfiguration:
48
48
  queue=_SlurmSettings.PARTITION,
49
49
  n_gpus=_SlurmSettings.N_GPUS_PER_WORKER,
50
50
  project_name=_SlurmSettings.PROJECT_NAME,
51
- walltime=_SlurmSettings.DEFAULT_WALLTIME,
52
51
  python_venv=_SlurmSettings.PYTHON_VENV,
53
52
  n_jobs=_SlurmSettings.N_JOBS,
54
53
  modules_to_load: tuple = _SlurmSettings.MODULES_TO_LOAD,
@@ -60,7 +59,6 @@ class SlurmClusterConfiguration:
60
59
  self._queue = queue
61
60
  self._n_gpus = n_gpus
62
61
  self._project_name = project_name
63
- self._walltime = walltime
64
62
  self._python_venv = python_venv
65
63
  self._modules_to_load = modules_to_load
66
64
  self._n_jobs = n_jobs
@@ -98,10 +96,6 @@ class SlurmClusterConfiguration:
98
96
  def project_name(self):
99
97
  return self._project_name
100
98
 
101
- @property
102
- def walltime(self):
103
- return self._walltime
104
-
105
99
  @property
106
100
  def python_venv(self):
107
101
  return self._python_venv
@@ -132,7 +126,6 @@ class SlurmClusterConfiguration:
132
126
  "partition": self.queue,
133
127
  "n_gpus": self.n_gpus,
134
128
  "job_name": self.project_name,
135
- "walltime": self.walltime,
136
129
  "python_venv": self.python_venv,
137
130
  "modules": self.modules_to_load,
138
131
  "sbatch_extra_params": self.sbatch_extra_params,
@@ -157,8 +150,6 @@ class SlurmClusterConfiguration:
157
150
  self._n_gpus = dict_["n_gpus"]
158
151
  if "job_name" in dict_:
159
152
  self._project_name = dict_["job_name"]
160
- if "walltime" in dict_:
161
- self._walltime = dict_["walltime"]
162
153
  if "python_venv" in dict_:
163
154
  self._python_venv = dict_["python_venv"]
164
155
  modules = dict_.get("modules", None)
@@ -37,7 +37,7 @@ import typing
37
37
  from ewokscore.task import Task as EwoksTask
38
38
  from nxtomomill import converter as nxtomomill_converter
39
39
  from silx.io.utils import h5py_read_dataset
40
- from tomoscan.io import HDF5File
40
+ from silx.io.utils import open as open_hdf5
41
41
 
42
42
  import tomwer.version
43
43
  from tomwer.core import settings
@@ -60,7 +60,10 @@ try:
60
60
  except ImportError:
61
61
  from nxtomomill.converter.hdf5.acquisition.baseacquisition import BaseAcquisition
62
62
 
63
- _SCAN_NUMBER_PATH = BaseAcquisition._SCAN_NUMBER_PATH
63
+ try:
64
+ _SCAN_NUMBER_PATH = BaseAcquisition._SCAN_NUMBER_PATH
65
+ except ImportError:
66
+ _SCAN_NUMBER_PATH = None
64
67
 
65
68
  _logger = logging.getLogger(__name__)
66
69
 
@@ -229,7 +232,7 @@ class DataListener(BaseProcessInfo):
229
232
  """Return the list of scans dir for this bliss_file / entry"""
230
233
 
231
234
  def get_scan_indexes():
232
- with HDF5File(bliss_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
235
+ with open_hdf5(bliss_file) as h5f:
233
236
  entry_node = h5f[entry]
234
237
  if _SCAN_NUMBER_PATH in entry_node:
235
238
  return h5py_read_dataset(entry_node[_SCAN_NUMBER_PATH])
@@ -254,7 +257,7 @@ class DataListener(BaseProcessInfo):
254
257
  """Return the proposal file of the experimentation if registred by the
255
258
  data listener"""
256
259
  if entry is None:
257
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
260
+ with open_hdf5(process_file) as h5f:
258
261
  entries = BaseProcessInfo._get_process_nodes(
259
262
  root_node=h5f, process=DataListener
260
263
  )
@@ -269,7 +272,7 @@ class DataListener(BaseProcessInfo):
269
272
  entry = list(entries.keys())[0]
270
273
  _logger.info("take %s as default entry" % entry)
271
274
 
272
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
275
+ with open_hdf5(process_file) as h5f:
273
276
  dl_nodes = BaseProcessInfo._get_process_nodes(
274
277
  root_node=h5f[entry], process=DataListener
275
278
  )
@@ -311,7 +314,7 @@ class DataListener(BaseProcessInfo):
311
314
  """Return the proposal file of the experimentation if registred by the
312
315
  data listener"""
313
316
  if entry is None:
314
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
317
+ with open_hdf5(process_file) as h5f:
315
318
  entries = BaseProcessInfo._get_process_nodes(
316
319
  root_node=h5f, process=DataListener
317
320
  )
@@ -326,7 +329,7 @@ class DataListener(BaseProcessInfo):
326
329
  entry = list(entries.keys())[0]
327
330
  _logger.info("take %s as default entry" % entry)
328
331
 
329
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
332
+ with open_hdf5(process_file) as h5f:
330
333
  dl_nodes = BaseProcessInfo._get_process_nodes(
331
334
  root_node=h5f[entry], process=DataListener
332
335
  )
@@ -360,7 +363,7 @@ class DataListener(BaseProcessInfo):
360
363
  """Return the proposal file of the experimentation if registred by the
361
364
  data listener"""
362
365
  if entry is None:
363
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
366
+ with open_hdf5(process_file) as h5f:
364
367
  entries = BaseProcessInfo._get_process_nodes(
365
368
  root_node=h5f, process=DataListener
366
369
  )
@@ -375,7 +378,7 @@ class DataListener(BaseProcessInfo):
375
378
  entry = list(entries.keys())[0]
376
379
  _logger.info("take %s as default entry" % entry)
377
380
 
378
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
381
+ with open_hdf5(process_file) as h5f:
379
382
  dl_nodes = BaseProcessInfo._get_process_nodes(
380
383
  root_node=h5f[entry], process=DataListener
381
384
  )
@@ -410,7 +413,7 @@ class DataListener(BaseProcessInfo):
410
413
  specific sequence data
411
414
  """
412
415
  if entry is None:
413
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
416
+ with open_hdf5(process_file) as h5f:
414
417
  entries = BaseProcessInfo._get_process_nodes(
415
418
  root_node=h5f, process=DataListener
416
419
  )
@@ -425,7 +428,7 @@ class DataListener(BaseProcessInfo):
425
428
  entry = list(entries.keys())[0]
426
429
  _logger.info("take %s as default entry" % entry)
427
430
 
428
- with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
431
+ with open_hdf5(process_file) as h5f:
429
432
  dl_nodes = BaseProcessInfo._get_process_nodes(
430
433
  root_node=h5f[entry], process=DataListener
431
434
  )
@@ -503,7 +506,7 @@ class DataListener(BaseProcessInfo):
503
506
  # write
504
507
  def sequence_is_finished():
505
508
  try:
506
- with HDF5File(bliss_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
509
+ with open_hdf5(bliss_file) as h5f:
507
510
  end_scan_path = "/".join((entry, "end_time"))
508
511
  return end_scan_path in h5f
509
512
  except Exception:
@@ -50,15 +50,6 @@ except ImportError:
50
50
  has_rsync = True
51
51
 
52
52
 
53
- def get_info_val(lines, key):
54
- r = range(len(lines))
55
- key = key + "="
56
- for i in r:
57
- if key in lines[i]:
58
- val = float(lines[i].split("=")[1])
59
- return val
60
-
61
-
62
53
  class _DataWatcherEDFProcess(_DataWatcherProcess):
63
54
  """
64
55
  Base class for edf acquisition observation
@@ -76,7 +76,7 @@ else:
76
76
  has_composite_cor_finder = True
77
77
  from silx.io.url import DataUrl
78
78
  from silx.io.utils import h5py_read_dataset
79
- from tomoscan.io import HDF5File, get_swmr_mode
79
+ from silx.io.utils import open as open_hdf5
80
80
 
81
81
  _logger = logging.getLogger(__name__)
82
82
  if not has_composite_cor_finder:
@@ -1164,7 +1164,7 @@ class AxisTask(
1164
1164
  :return:
1165
1165
  """
1166
1166
  if entry is None:
1167
- with HDF5File(process_file, "r", swmr=get_swmr_mode()) as h5f:
1167
+ with open_hdf5(process_file) as h5f:
1168
1168
  entries = AxisTask._get_process_nodes(root_node=h5f, process=AxisTask)
1169
1169
  if len(entries) == 0:
1170
1170
  _logger.info("unable to find a Axis process in %s" % process_file)
@@ -1175,7 +1175,7 @@ class AxisTask(
1175
1175
  entry = list(entries.keys())[0]
1176
1176
  _logger.info("take %s as default entry" % entry)
1177
1177
 
1178
- with HDF5File(process_file, "r", swmr=get_swmr_mode()) as h5f:
1178
+ with open_hdf5(process_file) as h5f:
1179
1179
  axis_nodes = AxisTask._get_process_nodes(
1180
1180
  root_node=h5f[entry], process=AxisTask
1181
1181
  )
@@ -62,10 +62,10 @@ _WITH_PAG = "withpag"
62
62
  _NO_PAG = "nopag"
63
63
 
64
64
 
65
- DEFAULT_CMP_THETA = 10
66
- DEFAULT_CMP_N_SUBSAMPLING_Y = 10
65
+ DEFAULT_CMP_THETA = 5
66
+ DEFAULT_CMP_N_SUBSAMPLING_Y = 40
67
67
  DEFAULT_CMP_NEAR_POS = 0
68
- DEFAULT_CMP_NEAR_WIDTH = 20
68
+ DEFAULT_CMP_NEAR_WIDTH = 40
69
69
  DEFAULT_CMP_OVERSAMPLING = 4
70
70
  DEFAULT_CMP_TAKE_LOG = True
71
71