Skip to content
Snippets Groups Projects
Commit 3c34ac85 authored by Samuel Jones's avatar Samuel Jones
Browse files

Re #22896 Utilise Child algorithms

parent ad30b644
Branches 28310_cancel_script_during_alg_in_workbench
No related tags found
No related merge requests found
...@@ -36,18 +36,6 @@ MinMaxTuple calculateXIntersection(MatrixWorkspace_const_sptr &lhsWS, ...@@ -36,18 +36,6 @@ MinMaxTuple calculateXIntersection(MatrixWorkspace_const_sptr &lhsWS,
/// Check if a double is not zero and returns a bool indicating success /// Check if a double is not zero and returns a bool indicating success
bool isNonzero(double i) { return (0 != i); } bool isNonzero(double i) { return (0 != i); }
/** Sort x axis (Dx will be handled only for point data)
@param ws :: Input workspace
@return A shared pointer to the resulting MatrixWorkspace
*/
void sortXAxis(MatrixWorkspace_sptr &ws) {
Mantid::Algorithms::SortXAxis alg;
alg.initialize();
alg.setProperty("InputWorkspace", ws);
alg.setProperty("OutputWorkspace", "outputSearch");
alg.execute();
}
} // namespace } // namespace
namespace Mantid { namespace Mantid {
...@@ -637,11 +625,12 @@ void Stitch1D::exec() { ...@@ -637,11 +625,12 @@ void Stitch1D::exec() {
result = conjoinXAxis(lhs, rhs); result = conjoinXAxis(lhs, rhs);
if (!result) if (!result)
g_log.error("Could not retrieve joined workspace."); g_log.error("Could not retrieve joined workspace.");
sortXAxis(result);
MatrixWorkspace_sptr outputSearch = // Sort the X Axis
boost::dynamic_pointer_cast<MatrixWorkspace>( Mantid::API::Algorithm_sptr childAlg = createChildAlgorithm("SortXAxis");
AnalysisDataService::Instance().retrieve("outputSearch")); childAlg->setProperty("InputWorkspace", result);
result = outputSearch; childAlg->execute();
result = childAlg->getProperty("OutputWorkspace");
} }
setProperty("OutputWorkspace", result); setProperty("OutputWorkspace", result);
setProperty("OutScaleFactor", m_scaleFactor); setProperty("OutScaleFactor", m_scaleFactor);
......
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