Commit 3d6d228b authored by Gemma Guest's avatar Gemma Guest
Browse files

Add outline algorithm to do the preprocessing

Add outline algorithm and tests

Re #32125
parent 7c738fc1
...@@ -270,6 +270,7 @@ set(PYTHON_PLUGINS ...@@ -270,6 +270,7 @@ set(PYTHON_PLUGINS
algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py
algorithms/WorkflowAlgorithms/ReflectometryILLSumForeground.py algorithms/WorkflowAlgorithms/ReflectometryILLSumForeground.py
algorithms/WorkflowAlgorithms/ReflectometryILL_common.py algorithms/WorkflowAlgorithms/ReflectometryILL_common.py
algorithms/WorkflowAlgorithms/ReflectometryISISPreprocess.py
algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py
algorithms/WorkflowAlgorithms/ResNorm2.py algorithms/WorkflowAlgorithms/ResNorm2.py
algorithms/WorkflowAlgorithms/SANS/SANSBeamCentreFinder.py algorithms/WorkflowAlgorithms/SANS/SANSBeamCentreFinder.py
......
# -*- coding: utf-8 -*-# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from mantid.api import (AlgorithmFactory, DataProcessorAlgorithm)
class _Prop:
RUNS = 'InputRunList'
GROUP_TOF = 'GroupTOFWorkspaces'
OUTPUT_WS = 'OutputWorkspace'
class ReflectometryISISPreprocess(DataProcessorAlgorithm):
def __init__(self):
"""Initialize an instance of the algorithm."""
DataProcessorAlgorithm.__init__(self)
def category(self):
"""Return the categories of the algorithm."""
return 'ISIS\\Reflectometry;Workflow\\Reflectometry'
def name(self):
"""Return the name of the algorithm."""
return 'ReflectometryISISPreprocess'
def summary(self):
"""Return a summary of the algorithm."""
return "Preprocess ISIS reflectometry data, including optional loading and summing of the input runs."
def seeAlso(self):
"""Return a list of related algorithm names."""
return ['ReflectometryISISLoadAndProcess', 'ReflectometryReductionOneAuto']
def version(self):
"""Return the version of the algorithm."""
return 1
def PyInit(self):
pass
def PyExec(self):
pass
AlgorithmFactory.subscribe(ReflectometryISISPreprocess)
...@@ -59,6 +59,7 @@ set(TEST_PY_FILES ...@@ -59,6 +59,7 @@ set(TEST_PY_FILES
ReflectometryILLPreprocessTest.py ReflectometryILLPreprocessTest.py
ReflectometryILLSumForegroundTest.py ReflectometryILLSumForegroundTest.py
ReflectometryISISLoadAndProcessTest.py ReflectometryISISLoadAndProcessTest.py
ReflectometryISISPreprocessTest.py
ResNorm2Test.py ResNorm2Test.py
SANSDarkRunBackgroundCorrectionTest.py SANSDarkRunBackgroundCorrectionTest.py
SANSFitShiftScaleTest.py SANSFitShiftScaleTest.py
......
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
import unittest
from mantid.api import MatrixWorkspace
from testhelpers import create_algorithm
class ReflectometryISISLoadAndProcessTest(unittest.TestCase):
ALG_NAME = "ReflectometryISISPreprocess"
def test_algorithm_executes(self):
alg = create_algorithm(self.ALG_NAME)
alg.execute()
self.assertTrue(alg.isExecuted())
def test_input_run_is_loaded(self):
args = {'InputRunList': '13460'}
alg = create_algorithm(self.ALG_NAME, **args)
alg.execute()
output_ws = alg.getProperty("OutputWorkspace")
self.assertIsInstance(MatrixWorkspace, output_ws)
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment