Skip to content
Snippets Groups Projects
Commit e1eaa767 authored by Dan Nixon's avatar Dan Nixon
Browse files

Fix issues with diffraction

Refs #11326
parent f2d74572
No related branches found
No related tags found
No related merge requests found
......@@ -105,8 +105,10 @@ namespace IDA
addShapeSpecificCanOptions(absCorAlgo, sampleShape);
}
absCorAlgo->setProperty("EMode", getEMode(sampleWs));
absCorAlgo->setProperty("EFixed", getEFixed(sampleWs));
std::string eMode = getEMode(sampleWs);
absCorAlgo->setProperty("EMode", eMode);
if(eMode == "Indirect")
absCorAlgo->setProperty("EFixed", getEFixed(sampleWs));
// Generate workspace names
int nameCutIndex = sampleWsName.lastIndexOf("_");
......
......@@ -94,8 +94,12 @@ namespace IDA
convertAlg->setProperty("InputWorkspace", ws->name());
convertAlg->setProperty("OutputWorkspace", outputName);
convertAlg->setProperty("Target", "Wavelength");
convertAlg->setProperty("EMode", getEMode(ws));
convertAlg->setProperty("EFixed", getEFixed(ws));
std::string eMode = getEMode(ws);
convertAlg->setProperty("EMode", eMode);
if(eMode == "Indirect")
convertAlg->setProperty("EFixed", getEFixed(ws));
m_batchAlgoRunner->addAlgorithm(convertAlg);
......
......@@ -6,6 +6,8 @@
#include "MantidQtAPI/InterfaceManager.h"
#include "MantidQtMantidWidgets/RangeSelector.h"
#include <boost/algorithm/string/find.hpp>
using namespace Mantid::API;
using namespace Mantid::Geometry;
using namespace Mantid::Kernel;
......@@ -287,7 +289,11 @@ namespace CustomInterfaces
std::string IndirectTab::getEMode(Mantid::API::MatrixWorkspace_sptr ws)
{
Mantid::Kernel::Unit_sptr xUnit = ws->getAxis(0)->unit();
if(xUnit->caption() == "dSpacing")
std::string xUnitName = xUnit->caption();
g_log.debug() << "X unit name is: " << xUnitName << std::endl;
if(boost::algorithm::find_first(xUnitName, "d-Spacing"))
return "Elastic";
return "Indirect";
......
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