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

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.
parent d917656e
No related merge requests found
......@@ -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
......
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