Skip to content

Commit

Permalink
Merge remote branch 'origin/feature/6462_filter_int_log'
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Apr 24, 2013
2 parents 50b0a07 + 8198c98 commit b844c09
Show file tree
Hide file tree
Showing 3 changed files with 524 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Algorithms
class DLLExport GenerateEventsFilter : public API::Algorithm
{
public:
GenerateEventsFilter();
explicit GenerateEventsFilter();
virtual ~GenerateEventsFilter();

/// Algorithm's name for identification overriding a virtual method
Expand All @@ -83,34 +83,51 @@ namespace Algorithms
void setFilterByTimeOnly();
void setFilterByLogValue(std::string logname);

void processSingleValueFilter(Kernel::TimeSeriesProperty<double>* mlog, double minvalue, double maxvalue,
void processSingleValueFilter(double minvalue, double maxvalue,
bool filterincrease, bool filterdecrease);

void processMultipleValueFilters(Kernel::TimeSeriesProperty<double>* mlog, double minvalue, double maxvalue,
void processMultipleValueFilters(double minvalue, double maxvalue,
bool filterincrease, bool filterdecrease);

void makeFilterByValue(Kernel::TimeSeriesProperty<double>* mlog,
Kernel::TimeSplitterType& split, double min, double max, double TimeTolerance, bool centre,
void makeFilterByValue(Kernel::TimeSplitterType& split, double min, double max, double TimeTolerance, bool centre,
bool filterIncrease, bool filterDecrease, Kernel::DateAndTime startTime, Kernel::DateAndTime stopTime,
int wsindex);

void makeMultipleFiltersByValues(Kernel::TimeSeriesProperty<double>* mlog,
Kernel::TimeSplitterType& split, std::map<size_t, int> indexwsindexmap, std::vector<double> logvalueranges,
void makeMultipleFiltersByValues(Kernel::TimeSplitterType& split, std::map<size_t, int> indexwsindexmap, std::vector<double> logvalueranges,
bool centre, bool filterIncrease, bool filterDecrease, Kernel::DateAndTime startTime, Kernel::DateAndTime stopTime);

void processIntegerValueFilter(Kernel::TimeSplitterType &splitters, int minvalue, int maxvalue,
bool filterIncrease, bool filterDecrease, Kernel::DateAndTime runend);

size_t searchValue(std::vector<double> sorteddata, double value);

DataObjects::EventWorkspace_const_sptr mEventWS;
API::ISplittersWorkspace_sptr mSplitters;
API::ITableWorkspace_sptr mFilterInfoWS;
DataObjects::EventWorkspace_const_sptr m_dataWS;
API::ISplittersWorkspace_sptr m_splitWS;
API::ITableWorkspace_sptr m_filterInfoWS;

Kernel::DateAndTime mStartTime;
Kernel::DateAndTime mStopTime;

double m_convertfactor;
double m_timeUnitConvertFactor;

Kernel::TimeSeriesProperty<double>* m_dblLog;
Kernel::TimeSeriesProperty<int>* m_intLog;

bool m_logAtCentre;
double m_logTimeTolerance;

};

/** Generate a new time splitter and add to a list of splitters
*/
void make_splitter(Kernel::DateAndTime start, Kernel::DateAndTime stop, int group, Kernel::time_duration tolerance,
Kernel::TimeSplitterType& splitters)
{
Kernel::SplittingInterval newsplit(start - tolerance, stop - tolerance, group);
splitters.push_back(newsplit);

return;
}

} // namespace Algorithms
} // namespace Mantid
Expand Down

0 comments on commit b844c09

Please sign in to comment.