diff --git a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp index b74124f9c5b13a6eb9ab285fc9a24d77f196cb25..731f9f9ae129620e0f5a88490f65de7d88ffc3e5 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp @@ -175,15 +175,37 @@ void ApplyPaalmanPings::run() { case 1: correctionType = "cyl"; break; + case 2: + correctionType = "anl"; + break; } - QString outputWsName = - sampleWsName.left(nameCutIndex) + +"_" + correctionType + "_Corrected"; - if(m_uiForm.ckUseCan->isChecked()){ - QString canWsName = m_uiForm.dsContainer->getCurrentDataName(); - auto canCut = canWsName.indexOf("_"); - outputWsName += "_" + canWsName.left(canCut); + + QString outputWsName = sampleWsName.left(nameCutIndex); + // Using corrections + if (m_uiForm.ckUseCorrections->isChecked()) { + outputWsName += "_" + correctionType + "_Corrected"; + } else { + outputWsName += "_Subtracted"; + } + + // Using container + if (m_uiForm.ckUseCan->isChecked()) { + auto containerWsName = m_uiForm.dsContainer->getCurrentDataName(); + MatrixWorkspace_sptr containerWs = + AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( + containerWsName.toStdString()); + auto run = containerWs->run(); + if (run.hasProperty("run_number")) { + outputWsName += + "_" + QString::fromStdString(run.getProperty("run_number")->value()); + } else { + auto canCutIndex = containerWsName.indexOf("_"); + outputWsName += "_" + containerWsName.left(canCutIndex); + } } + outputWsName += "_red"; + applyCorrAlg->setProperty("OutputWorkspace", outputWsName.toStdString()); // Add corrections algorithm to queue diff --git a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp index e995b82ab75d008ebfe7a182de46721da880e1b6..5d26b284ae93f9351ffa62f4fd605034ea302641 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp @@ -128,20 +128,19 @@ void ContainerSubtraction::run() { containerWsName.toStdString()); std::string runNum = ""; int containerNameCutIndex = 0; - if(containerWs->run().hasProperty("run_number")){ - runNum = containerWs->run().getProperty("run_number")->value(); - }else{ - containerNameCutIndex = containerWsName.indexOf("_"); - if (containerNameCutIndex == -1) - containerNameCutIndex = containerWsName.length(); + if (containerWs->run().hasProperty("run_number")) { + runNum = containerWs->run().getProperty("run_number")->value(); + } else { + containerNameCutIndex = containerWsName.indexOf("_"); + if (containerNameCutIndex == -1) + containerNameCutIndex = containerWsName.length(); } QString outputWsName = sampleWsName.left(sampleNameCutIndex) + "_Subtract_"; if (runNum.compare("") != 0) { - outputWsName += QString::fromStdString(runNum); + outputWsName += QString::fromStdString(runNum); } else { - auto canCut = containerWsName.left(containerNameCutIndex); - outputWsName += canCut; + outputWsName += containerWsName.left(containerNameCutIndex); } outputWsName += "_red";