Skip to content

Commit

Permalink
Refs #10028. Solved one issue in filtering by single value.
Browse files Browse the repository at this point in the history
Issue: it was not considered about how to deal with the situation that
if two adjacent log entries' values are identical.

The new algorithm is to extend the previous direction.
  • Loading branch information
wdzhou committed Jul 30, 2014
1 parent 3948c32 commit 3bba77c
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions Code/Mantid/Framework/Algorithms/src/GenerateEventsFilter.cpp
Expand Up @@ -833,15 +833,37 @@ namespace Algorithms
{
if (i == 0)
isGood = false;
else if ((val >= min && val < max) && (t >= startTime && t <= stopTime))
{
// Within the time range and log value range
double diff = val-m_dblLog->nthValue(i-1);
if (diff > 0)
isGood = true;
else if (diff == 0)
isGood = lastGood; // If the log value does not change, then the status follows the previous
else
isGood = false;
}
else
isGood = ((val >= min) && (val < max)) && t >= startTime && t <= stopTime && val-m_dblLog->nthValue(i-1) > 0;
{
isGood = false;
}
}
else if (filterDecrease)
{
if (i == 0)
isGood = false;
else
isGood = ((val >= min) && (val < max)) && t >= startTime && t <= stopTime && val-m_dblLog->nthValue(i-1) < 0;
else if ((val >= min && val < max) && (t >= startTime && t <= stopTime))
{
// Within the time range and log value range
double diff = val-m_dblLog->nthValue(i-1);
if (diff < 0)
isGood = true;
else if (diff == 0)
isGood = lastGood; // If the log value does not change, then the status follows the previous
else
isGood = false;
}
}
else
{
Expand Down Expand Up @@ -874,11 +896,8 @@ namespace Algorithms
{
stop = t;
}
#if 0
split.push_back( SplittingInterval(start, stop, wsindex) );
#else

addNewTimeFilterSplitter(start, stop, wsindex, info);
#endif

//Reset the number of good ones, for next time
numgood = 0;
Expand Down

0 comments on commit 3bba77c

Please sign in to comment.