Skip to content
Snippets Groups Projects
Commit 180365b7 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Merge remote-tracking branch 'origin/master' into to_pdfgetn_workflow_algorithm

parents 870aeae0 4e24cdfc
No related merge requests found
......@@ -353,40 +353,54 @@ void ConvertToReflectometryQ::exec() {
TableWorkspace_sptr vertexes =
boost::make_shared<Mantid::DataObjects::TableWorkspace>();
Progress transSelectionProg(this, 0.0, 0.1, 2);
if (outputAsMDWorkspace) {
transSelectionProg.report("Choosing Transformation");
if (transMethod == centerTransform()) {
auto outputMDWS = transform->executeMD(inputWs, bc);
Progress transPerformProg(this, 0.1, 0.7, 5);
transPerformProg.report("Performed transformation");
// Copy ExperimentInfo (instrument, run, sample) to the output WS
ExperimentInfo_sptr ei(inputWs->cloneExperimentInfo());
outputMDWS->addExperimentInfo(ei);
outputWS = outputMDWS;
} else if (transMethod == normPolyTransform()) {
Progress transPerformProg(this, 0.1, 0.7, 5);
const bool dumpVertexes = this->getProperty("DumpVertexes");
auto vertexesTable = vertexes;
// perform the normalised polygon transformation
transPerformProg.report("Performing Transformation");
auto normPolyTrans = transform->executeNormPoly(
inputWs, vertexesTable, dumpVertexes, outputDimensions);
// copy any experiment info from input workspace
normPolyTrans->copyExperimentInfoFrom(inputWs.get());
// produce MDHistoWorkspace from normPolyTrans workspace.
Progress outputToMDProg(this, 0.7, 0.75, 10);
auto outputMDWS = transform->executeMDNormPoly(normPolyTrans);
ExperimentInfo_sptr ei(normPolyTrans->cloneExperimentInfo());
outputMDWS->addExperimentInfo(ei);
outputWS = outputMDWS;
outputToMDProg.report("Successfully output to MD");
} else {
throw std::runtime_error("Unknown rebinning method: " + transMethod);
}
} else if (transMethod == normPolyTransform()) {
transSelectionProg.report("Choosing Transformation");
Progress transPerformProg(this, 0.1, 0.7, 5);
const bool dumpVertexes = this->getProperty("DumpVertexes");
auto vertexesTable = vertexes;
// perform the normalised polygon transformation
transPerformProg.report("Performing Transformation");
auto output2DWS = transform->executeNormPoly(
inputWs, vertexesTable, dumpVertexes, outputDimensions);
// copy any experiment info from input workspace
output2DWS->copyExperimentInfoFrom(inputWs.get());
outputWS = output2DWS;
transPerformProg.report("Transformation Complete");
} else if (transMethod == centerTransform()) {
transSelectionProg.report("Choosing Transformation");
Progress transPerformProg(this, 0.1, 0.7, 5);
transPerformProg.report("Performing Transformation");
auto output2DWS = transform->execute(inputWs);
output2DWS->copyExperimentInfoFrom(inputWs.get());
outputWS = output2DWS;
......@@ -397,6 +411,8 @@ void ConvertToReflectometryQ::exec() {
// Execute the transform and bind to the output.
setProperty("OutputWorkspace", outputWS);
setProperty("OutputVertexes", vertexes);
Progress setPropertyProg(this, 0.8, 1.0, 2);
setPropertyProg.report("Success");
}
} // namespace Mantid
......
......@@ -368,28 +368,23 @@ namespace MantidWidgets
MatrixWorkspace_sptr ws;
auto load = boost::dynamic_pointer_cast<AlgorithmProxy>( AlgorithmManager::Instance().create("MuonLoad") );
load->setChild(true);
load->setRethrows(true);
load->copyPropertiesFrom(*m_loadAlg);
try
{
try {
auto load = AlgorithmManager::Instance().create("MuonLoad");
load->initialize();
load->setPropertyValue( "Filename", fileIt->toStdString() );
load->setPropertyValue( "OutputWorkspace", "__YouDontSeeMeIAmNinja" ); // Is not used
if ( m_fitPropBrowser->rawData() ) // TODO: or vice verca?
load->setPropertyValue( "RebinParams", "" );
load->setChild(true);
load->setRethrows(true);
load->updatePropertyValues(*m_loadAlg);
load->setPropertyValue("Filename", fileIt->toStdString());
load->setPropertyValue("OutputWorkspace", "__YouDontSeeMeIAmNinja");
if (m_fitPropBrowser->rawData()) // TODO: or vice verca?
load->setPropertyValue("RebinParams", "");
load->execute();
ws = load->getProperty("OutputWorkspace");
}
catch(...)
{
QMessageBox::critical(this, "Loading failed",
} catch (...) {
QMessageBox::critical(
this, "Loading failed",
"Unable to load one of the files.\n\nCheck log for details");
break;
}
......
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