From 9949f586930003859ce050083ed061575260f68e Mon Sep 17 00:00:00 2001
From: Conor Finn <conor.finn@stfc.ac.uk>
Date: Mon, 20 Jan 2020 16:46:48 +0000
Subject: [PATCH] RE #26849 Fix issue with non-sequent ranges

If the user defined a list of spectra to use that were not sequential,
the algorithm would take tha max and min values rather than the actual
list of specta. Eg "10-19, 50-59" would have resulted in the spectra
10-59 being used, which broke the algorithm.
---
 scripts/Engineering/EnggUtils.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/Engineering/EnggUtils.py b/scripts/Engineering/EnggUtils.py
index 803fc2261db..441f7f14a36 100644
--- a/scripts/Engineering/EnggUtils.py
+++ b/scripts/Engineering/EnggUtils.py
@@ -328,10 +328,9 @@ def crop_data(parent, ws, indices):
     @returns cropped workspace, with only the spectra corresponding to the indices requested
     """
     # Leave only spectra between min and max
-    alg = parent.createChildAlgorithm('CropWorkspace')
+    alg = parent.createChildAlgorithm('ExtractSpectra')
     alg.setProperty('InputWorkspace', ws)
-    alg.setProperty('StartWorkspaceIndex', min(indices))
-    alg.setProperty('EndWorkspaceIndex', max(indices))
+    alg.setProperty('WorkspaceIndexList', indices)
     alg.execute()
 
     return alg.getProperty('OutputWorkspace').value
-- 
GitLab