Mantid
Loading...
Searching...
No Matches
ITimeSeriesProperty.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include <vector>
10
11namespace Mantid {
12namespace Types {
13namespace Core {
14class DateAndTime;
15}
16} // namespace Types
17namespace Kernel {
18//---------------------------------------------------------------------------
19// Forward Declarations
20//---------------------------------------------------------------------------
21namespace Math {
22enum StatisticType : int;
23}
25class TimeInterval;
27class Property;
28class TimeROI;
32public:
34 virtual TimeROI makeFilterByValue(double min, double max, bool expand = false,
35 const TimeInterval &expandRange = TimeInterval(0, 1), double TimeTolerance = 0.,
36 bool centre = true, const TimeROI *existingROI = nullptr) const = 0;
38 virtual void makeFilterByValue(std::vector<SplittingInterval> &split, double min, double max, double TimeTolerance,
39 bool centre = true) const = 0;
41 virtual void expandFilterToRange(std::vector<SplittingInterval> &split, double min, double max,
42 const TimeInterval &range) const = 0;
43 // Provide a new instance of the ITimeSeriesProperty with shifted time values
44 // After trying to use return type covariance, but that showed Error C2908
45 // Using property seemed to be the most straightforward solution.
46 virtual Property *cloneWithTimeShift(const double timeShift) const = 0;
47
48 // Create a partial copy of this ITimeSeriesProperty-derived object according to a TimeROI. The partially cloned
49 // object will include all time values enclosed by the ROI regions defined as [roi_begin,roi_end], plus the values
50 // immediately before and after an ROI region, if available.
51 virtual Property *cloneInTimeROI(const TimeROI &timeROI) const = 0;
52
54 virtual std::vector<Types::Core::DateAndTime> timesAsVector() const = 0;
59 virtual double timeAverageValue(const TimeROI *timeRoi = nullptr) const = 0;
63 virtual std::pair<double, double> timeAverageValueAndStdDev(const Kernel::TimeROI *timeRoi = nullptr) const = 0;
65 virtual TimeSeriesPropertyStatistics getStatistics(const TimeROI *roi = nullptr) const = 0;
67 virtual double extractStatistic(Math::StatisticType selection, const TimeROI * = nullptr) const = 0;
69 virtual int realSize() const = 0;
71 virtual void clear() = 0;
73 virtual void clearOutdated() = 0;
74
75 // Returns whether the time series has been filtered
76 virtual bool isFiltered() const = 0;
77
78 // Remove time values outside the TimeROI regions defined as [roi_begin,roi_end].
79 // However, keep the values immediately before and after each ROI region, if available.
80 virtual void removeDataOutsideTimeROI(const TimeROI &timeRoi) = 0;
81
83 virtual ~ITimeSeriesProperty() = default;
84};
85
86} // namespace Kernel
87} // namespace Mantid
A non-templated interface to a TimeSeriesProperty.
virtual int realSize() const =0
Returns the real size of the time series property map:
virtual double extractStatistic(Math::StatisticType selection, const TimeROI *=nullptr) const =0
Filtering the series according to the selected statistical measure.
virtual void removeDataOutsideTimeROI(const TimeROI &timeRoi)=0
virtual bool isFiltered() const =0
virtual Property * cloneWithTimeShift(const double timeShift) const =0
virtual void expandFilterToRange(std::vector< SplittingInterval > &split, double min, double max, const TimeInterval &range) const =0
Make sure an existing filter covers the full time range given.
virtual TimeROI makeFilterByValue(double min, double max, bool expand=false, const TimeInterval &expandRange=TimeInterval(0, 1), double TimeTolerance=0., bool centre=true, const TimeROI *existingROI=nullptr) const =0
Fill a SplittingIntervalVec that will filter the events by matching.
virtual double timeAverageValue(const TimeROI *timeRoi=nullptr) const =0
Returns the calculated time weighted average value.
virtual std::pair< double, double > timeAverageValueAndStdDev(const Kernel::TimeROI *timeRoi=nullptr) const =0
Returns the calculated time weighted mean and standard deviation values.
virtual std::vector< Types::Core::DateAndTime > timesAsVector() const =0
Return the time series's times as a vector<DateAndTime>
virtual TimeSeriesPropertyStatistics getStatistics(const TimeROI *roi=nullptr) const =0
Return a TimeSeriesPropertyStatistics object.
virtual void clearOutdated()=0
Deletes all but the 'last entry' in the property.
virtual Property * cloneInTimeROI(const TimeROI &timeROI) const =0
virtual void clear()=0
Deletes the series of values in the property.
virtual ~ITimeSeriesProperty()=default
Virtual destructor.
virtual void makeFilterByValue(std::vector< SplittingInterval > &split, double min, double max, double TimeTolerance, bool centre=true) const =0
Fill a SplittingIntervalVec that will filter the events by matching.
Base class for properties.
Definition Property.h:94
Class holding a start/end time and a destination for splitting event lists and logs.
Represents a time interval.
Definition DateAndTime.h:25
TimeROI : Object that holds information about when the time measurement was active.
Definition TimeROI.h:18
StatisticType
Maps a "statistic" to a number.
Definition Statistics.h:18
Helper class which provides the Collimation Length for SANS instruments.
Struct holding some useful statistics for a TimeSeriesProperty.