Skip to content
Snippets Groups Projects
Commit 2d4ad519 authored by Elliot Oram's avatar Elliot Oram
Browse files

Implemented optioanl scale algorithm call before subtraction

Refs #13993
parent 059855c3
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,8 @@ void ContainerSubtraction::run() { ...@@ -36,6 +36,8 @@ void ContainerSubtraction::run() {
sampleWsName.toStdString()); sampleWsName.toStdString());
m_originalSampleUnits = sampleWs->getAxis(0)->unit()->unitID(); m_originalSampleUnits = sampleWs->getAxis(0)->unit()->unitID();
// If not in wavelength then do conversion // If not in wavelength then do conversion
if (m_originalSampleUnits != "Wavelength") { if (m_originalSampleUnits != "Wavelength") {
g_log.information( g_log.information(
...@@ -51,6 +53,16 @@ void ContainerSubtraction::run() { ...@@ -51,6 +53,16 @@ void ContainerSubtraction::run() {
AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
canWsName.toStdString()); 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 // If not in wavelength then do conversion
std::string originalCanUnits = canWs->getAxis(0)->unit()->unitID(); std::string originalCanUnits = canWs->getAxis(0)->unit()->unitID();
if (originalCanUnits != "Wavelength") { if (originalCanUnits != "Wavelength") {
......
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