From 1d53d9b194f3ab277327ef42a418424fd78b0567 Mon Sep 17 00:00:00 2001
From: Elliot Oram <Elliot.Oram@stfc.ac.uk>
Date: Thu, 15 Oct 2015 08:52:16 +0100
Subject: [PATCH] Changed PlotPeak to be child algorithm

Refs #13985
---
 .../algorithms/WorkflowAlgorithms/ResNorm2.py | 21 +++++++++++--------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py
index 02de852f096..5af6be76494 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py
@@ -108,14 +108,17 @@ class ResNorm(PythonAlgorithm):
         out_name = getWSprefix(self._res_ws) + 'ResNorm_Fit'
         function = 'name=TabulatedFunction,Workspace=%s,Scaling=1,Shift=0,XScaling=1,ties=(Shift=0)' % self._van_ws
 
-        fit_params = PlotPeakByLogValue(Input=input_str,
-                                        OutputWorkspace=out_name,
-                                        Function=function,
-                                        FitType='Individual',
-                                        PassWSIndexToFunction=True,
-                                        CreateOutput=self._create_output,
-                                        StartX=self._e_min,
-                                        EndX=self._e_max)
+        plot_peaks = self.createChildAlgorithm(name='PlotPeakByLogValue', startProgress=0.02, endProgress=0.94, enableLogging=True)
+        plot_peaks.setProperty('Input', input_str)
+        plot_peaks.setProperty('OutputWorkspace', out_name)
+        plot_peaks.setProperty('Function', function)
+        plot_peaks.setProperty('FitType', 'Individual')
+        plot_peaks.setProperty('PassWSIndexToFunction', True)
+        plot_peaks.setProperty('CreateOutput', self._create_output)
+        plot_peaks.setProperty('StartX', self._e_min)
+        plot_peaks.setProperty('EndX', self._e_max)
+        plot_peaks.execute()
+        fit_params = plot_peaks.getProperty('OutputWorkspace').value
 
         params = {'XScaling':'Stretch', 'Scaling':'Intensity'}
         result_workspaces = []
@@ -133,7 +136,7 @@ class ResNorm(PythonAlgorithm):
         prog_process.report()
         if not self._create_output:
             DeleteWorkspace(fit_params)
-
+        
 
     def _process_res_ws(self, num_hist):
         """
-- 
GitLab