Skip to content

Commit

Permalink
Refs #10742 Temporary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmborr committed Dec 10, 2014
1 parent 1c9d4c6 commit 7e653b4
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Code/Mantid/MantidQt/CustomInterfaces/src/Fury.cpp
Expand Up @@ -191,14 +191,34 @@ namespace IDA

QString wsName = uiForm().fury_dsInput->getCurrentDataName();
QString resName = uiForm().fury_dsResInput->getCurrentDataName();
if(wsName.isEmpty() || resName.isEmpty())
return;

double energyMin = m_dblManager->value(m_properties["ELow"]);
double energyMax = m_dblManager->value(m_properties["EHigh"]);
long numBins = static_cast<long>(m_dblManager->value(m_properties["SampleBinning"]));

if(wsName.isEmpty() || resName.isEmpty() || numBins == 0)
// Estimate number of SampleBinning according to whether the workspace has angles or momentum transfer
MatrixWorkspace_const_sptr workspace;
try
{
workspace = Mantid::API::AnalysisDataService::Instance().retrieveWS<const MatrixWorkspace>(wsName.toStdString());
}
catch(Mantid::Kernel::Exception::NotFoundError&)
{
showMessageBox(QString("Unable to retrieve workspace: " + wsName));
return;
}
long numBins = static_cast<long>(m_dblManager->value(m_properties["SampleBinning"])); // Default value
const std::string unitID( workspace->getAxis(0)->unit()->unitID() );
if( unitID == "MomentumTransfer")
{
numBins = 1;
}

if(numBins == 0)
return;


bool verbose = uiForm().fury_ckVerbose->isChecked();

IAlgorithm_sptr furyAlg = AlgorithmManager::Instance().create("Fury");
Expand Down

0 comments on commit 7e653b4

Please sign in to comment.