From de9205b1a6b8467ba1e36c6690177b3e693096fe Mon Sep 17 00:00:00 2001 From: Russell Taylor Date: Fri, 31 Jan 2014 11:49:49 -0500 Subject: [PATCH] Re #8637. Add a scan_index=0 entry at the end time of each run. Will make the normalization and calculations of average log values more correct. --- Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp index c79feaaf100d..c52c33ece3c8 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp @@ -268,6 +268,14 @@ bool StepScan::mergeRuns() addScanIndex->setProperty("LogType","Number Series"); addScanIndex->setProperty("LogText",Strings::toString(i+1)); if ( ! addScanIndex->execute() ) return true; + + // Add a scan_index = 0 to the end time for each workspace + try + { + ws->run().getTimeSeriesProperty("scan_index")->addValue(ws->run().endTime(),0); + } catch (std::runtime_error&) { + /* Swallow the error if there's no run end time. It shouldn't happen for real data. */ + } } IAlgorithm_sptr merge = AlgorithmManager::Instance().create("MergeRuns");