Skip to content
Snippets Groups Projects
Commit d0b18613 authored by Conor Finn's avatar Conor Finn
Browse files

RE #27012 Implement plotting functionality

Initially the plot buttons and parameters didn't do anything in the model. Checking the box now sets if plots are created for the workspaces.
parent c6855c38
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
from Engineering.gui.engineering_diffraction.tabs.common import vanadium_corrections from Engineering.gui.engineering_diffraction.tabs.common import vanadium_corrections
from mantid.simpleapi import EnggFocus, Load, logger from mantid.simpleapi import EnggFocus, Load, logger, AnalysisDataService as Ads
from mantidqt.plotting.functions import plot
SAMPLE_RUN_WORKSPACE_NAME = "engggui_focusing_input_ws" SAMPLE_RUN_WORKSPACE_NAME = "engggui_focusing_input_ws"
FOCUSED_OUTPUT_WORKSPACE_NAME = "engggui_focusing_output_ws_bank_" FOCUSED_OUTPUT_WORKSPACE_NAME = "engggui_focusing_output_ws_bank_"
...@@ -25,6 +26,8 @@ class FocusModel(object): ...@@ -25,6 +26,8 @@ class FocusModel(object):
for name in banks: for name in banks:
output_workspace_name = FOCUSED_OUTPUT_WORKSPACE_NAME + str(name) output_workspace_name = FOCUSED_OUTPUT_WORKSPACE_NAME + str(name)
self._run_focus(sample_workspace, output_workspace_name, integration_workspace, curves_workspace, name) self._run_focus(sample_workspace, output_workspace_name, integration_workspace, curves_workspace, name)
if plot_output:
self._plot_focused_workspace(output_workspace_name)
@staticmethod @staticmethod
def _run_focus(input_workspace, output_workspace, vanadium_integration_ws, def _run_focus(input_workspace, output_workspace, vanadium_integration_ws,
...@@ -50,3 +53,8 @@ class FocusModel(object): ...@@ -50,3 +53,8 @@ class FocusModel(object):
"Error while loading sample data for focusing. Could not load the sample with filename: " "Error while loading sample data for focusing. Could not load the sample with filename: "
+ sample_path + ". Error Description: " + str(e)) + sample_path + ". Error Description: " + str(e))
raise RuntimeError raise RuntimeError
@staticmethod
def _plot_focused_workspace(focused):
focused_wsp = Ads.retrieve(focused)
plot([focused_wsp], wksp_indices=[0])
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment