Skip to content

Commit

Permalink
Re #11699 Filtering by start and end times
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed May 6, 2015
1 parent 1911afa commit 7394979
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/PlotAsymmetryByLogValue.cpp
Expand Up @@ -884,10 +884,23 @@ PlotAsymmetryByLogValue::groupDetectors(API::MatrixWorkspace_sptr &ws,
*doesn't exist.
*/
double PlotAsymmetryByLogValue::getLogValue(MatrixWorkspace &ws) {
auto *property = ws.run().getLogData(g_logName);

const Run& run = ws.run();

// Get the start & end time for the run
Mantid::Kernel::DateAndTime start, end;
if ( run.hasProperty("run_start") && run.hasProperty("run_end") )
{
start = run.getProperty("run_start")->value();
end = run.getProperty("run_end")->value();
}

auto *property = run.getLogData(g_logName);
if (!property) {
throw std::invalid_argument("Log " + g_logName + " does not exist.");
}
property->filterByTime(start, end);

double value = 0;
// try different property types
if (convertLogToDouble<double>(property, value, g_logFunc))
Expand Down

0 comments on commit 7394979

Please sign in to comment.