Skip to content

Commit

Permalink
Re #4048 Added start_time for HFIR SANS
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Nov 4, 2011
1 parent 0bd4f17 commit 6ce7f97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ namespace Mantid
{
throw Kernel::Exception::NotFoundError("No root element in Spice XML file", fileName);
}

// Read in start time
const std::string start_time = pRootElem->getAttribute("start_time");

Element* sasEntryElem = pRootElem->getChildElement("Header");
throwException(sasEntryElem, "Header", fileName);

Expand Down Expand Up @@ -344,6 +348,7 @@ namespace Mantid
ws->mutableRun().addProperty("wavelength-spread", dwavelength, "Angstrom", true);
ws->mutableRun().addProperty("timer", countingTime, "sec", true);
ws->mutableRun().addProperty("monitor", monitorCounts, "", true);
ws->mutableRun().addProperty("start_time", start_time, "", true);

// Move the detector to the right position
API::IAlgorithm_sptr mover = createSubAlgorithm("MoveInstrumentComponent");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from data_cat import DataCatalog as BaseCatalog
from data_cat import DataSet as BaseDataSet
import os
import time

# Check whether Mantid is available
try:
Expand Down Expand Up @@ -53,7 +54,8 @@ def read_series(prop):

title = read_prop("run_title")
t_str = read_prop("start_time")
run_start = ""
t = time.strptime(t_str, '%Y-%m-%d %H:%M:%S')
run_start = time.strftime('%y-%m-%d %H:%M', t)

duration = read_prop("timer")
try:
Expand Down

0 comments on commit 6ce7f97

Please sign in to comment.