From 2d4ad5196aa5eee266caa4a5aaab4edff5971581 Mon Sep 17 00:00:00 2001 From: Elliot Oram <Elliot.Oram@stfc.ac.uk> Date: Thu, 15 Oct 2015 16:57:45 +0100 Subject: [PATCH] Implemented optioanl scale algorithm call before subtraction Refs #13993 --- .../src/Indirect/ContainerSubtraction.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp index 0992f1d648e..7a649c3335f 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp @@ -36,6 +36,8 @@ void ContainerSubtraction::run() { sampleWsName.toStdString()); m_originalSampleUnits = sampleWs->getAxis(0)->unit()->unitID(); + + // If not in wavelength then do conversion if (m_originalSampleUnits != "Wavelength") { g_log.information( @@ -51,6 +53,16 @@ void ContainerSubtraction::run() { AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( canWsName.toStdString()); + if (m_uiForm.ckShiftCan->isChecked()) { + IAlgorithm_sptr scaleX = AlgorithmManager::Instance().create("ScaleX"); + scaleX->initialize(); + scaleX->setProperty("InputWorkspace", canWs); + scaleX->setProperty("OutputWorkspace", canWs->getName()); + scaleX->setProperty("Factor", m_uiForm.spShift->value()); + scaleX->setProperty("Operation", "Add"); + scaleX->execute(); + } + // If not in wavelength then do conversion std::string originalCanUnits = canWs->getAxis(0)->unit()->unitID(); if (originalCanUnits != "Wavelength") { -- GitLab