Skip to content
Snippets Groups Projects
Commit 5dc8d231 authored by Elliot Oram's avatar Elliot Oram
Browse files

Added progress tracking to ISIS Energy Transfer

Refs #13974
parent 96df753c
No related branches found
No related tags found
No related merge requests found
...@@ -138,14 +138,19 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm): ...@@ -138,14 +138,19 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm):
plot_reduction) plot_reduction)
self._setup() self._setup()
load_prog = Progress(self, start=0.0, end=0.10, nreports=2)
load_prog.report('loading files')
self._workspace_names, self._chopped_data = load_files(self._data_files, self._workspace_names, self._chopped_data = load_files(self._data_files,
self._ipf_filename, self._ipf_filename,
self._spectra_range[0], self._spectra_range[0],
self._spectra_range[1], self._spectra_range[1],
self._sum_files, self._sum_files,
self._load_logs) self._load_logs)
load_prog.report('files loaded')
process_prog = Progress(self, start=0.1, end=0.9, nreports=len(self._workspace_names))
for c_ws_name in self._workspace_names: for c_ws_name in self._workspace_names:
process_prog.report('processing workspace' + c_ws_name)
is_multi_frame = isinstance(mtd[c_ws_name], WorkspaceGroup) is_multi_frame = isinstance(mtd[c_ws_name], WorkspaceGroup)
# Get list of workspaces # Get list of workspaces
...@@ -263,13 +268,17 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm): ...@@ -263,13 +268,17 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm):
# Rename output workspaces # Rename output workspaces
output_workspace_names = [rename_reduction(ws_name, self._sum_files) for ws_name in self._workspace_names] output_workspace_names = [rename_reduction(ws_name, self._sum_files) for ws_name in self._workspace_names]
summary_prog = Progress(self, start=0.9, end=1.0, nreports=4)
# Save result workspaces # Save result workspaces
if self._save_formats is not None: if self._save_formats is not None:
summary_prog.report('saving')
save_reduction(output_workspace_names, save_reduction(output_workspace_names,
self._save_formats, self._save_formats,
self._output_x_units) self._output_x_units)
# Group result workspaces # Group result workspaces
summary_prog.report('grouping workspaces')
GroupWorkspaces(InputWorkspaces=output_workspace_names, GroupWorkspaces(InputWorkspaces=output_workspace_names,
OutputWorkspace=self._output_ws) OutputWorkspace=self._output_ws)
...@@ -277,8 +286,10 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm): ...@@ -277,8 +286,10 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm):
# Plot result workspaces # Plot result workspaces
if self._plot_type != 'None': if self._plot_type != 'None':
summary_prog.report('Plotting')
for ws_name in mtd[self._output_ws].getNames(): for ws_name in mtd[self._output_ws].getNames():
plot_reduction(ws_name, self._plot_type) plot_reduction(ws_name, self._plot_type)
summary_prog.report('Algorithm complete')
def validateInputs(self): def validateInputs(self):
......
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