mantidproject / mantidimaging

Graphical toolkit for neutron imaging.
https://mantidproject.github.io/mantidimaging
GNU General Public License v3.0
13 stars 6 forks source link

Monitor normalisation: RuntimeError: No logfile available for this stack. #2222

Open samtygier-stfc opened 3 months ago

samtygier-stfc commented 3 months ago

Summary

Monitor normalisation gives an error, because it attempts to apply the operation to the 180 degree stack, which has no log file.

Steps To Reproduce

Load a dataset with a log file. In Operations do Monitor Normalisation

Expected Behaviour

Normalisation is applied to the sample only

Current Behaviour

Operation also gets applied to the 180, which causes an error

Context

Present in main and 2.7. Probably been there for a long time

Failure Logs

2024-06-11 14:07:56,005 [mantidimaging.gui.windows.main.view:L566] ERROR: Traceback (most recent call last):
  File "/home/sam/git/mantidimaging/mantidimaging/gui/dialogs/async_task/model.py", line 62, in _on_task_exit
    self.on_complete_function(self.task)
  File "/home/sam/git/mantidimaging/mantidimaging/gui/windows/operations/presenter.py", line 283, in _post_filter
    self._do_apply_filter_sync([stack.proj180deg])
  File "/home/sam/git/mantidimaging/mantidimaging/gui/windows/operations/presenter.py", line 326, in _do_apply_filter_sync
    self.model.do_apply_filter_sync(apply_to, partial(self._post_filter, apply_to))
  File "/home/sam/git/mantidimaging/mantidimaging/gui/windows/operations/model.py", line 159, in do_apply_filter_sync
    self.apply_to_stacks(stacks)
  File "/home/sam/git/mantidimaging/mantidimaging/gui/windows/operations/model.py", line 118, in apply_to_stacks
    self.apply_to_images(stack, progress=progress)
  File "/home/sam/git/mantidimaging/mantidimaging/gui/windows/operations/model.py", line 130, in apply_to_images
    exec_func(images)
  File "/home/sam/git/mantidimaging/mantidimaging/core/operations/monitor_normalisation/monitor_normalisation.py", line 44, in filter_func
    raise RuntimeError("No logfile available for this stack.")
RuntimeError: No logfile available for this stack.