13#include "MantidKernel/DllConfig.h"
28class SplittingInterval;
81 Types::Core::DateAndTime
time()
const {
return mtime; }
83 void setTime(Types::Core::DateAndTime newtime) {
mtime = newtime; }
98 TimeSeriesProperty(
const std::string &name,
const std::vector<Types::Core::DateAndTime> ×,
99 const std::vector<TYPE> &values);
108 std::unique_ptr<TimeSeriesProperty<double>> getDerivative()
const;
110 void saveProperty(::NeXus::File *file)
override;
111 Json::Value valueAsJson()
const override;
114 Property *cloneWithTimeShift(
const double timeShift)
const override;
116 size_t getMemorySize()
const override;
133 void setName(
const std::string &name);
136 void filterByTime(
const Types::Core::DateAndTime &start,
const Types::Core::DateAndTime &stop)
override;
138 void filterByTimes(
const std::vector<SplittingInterval> &splittervec);
141 void splitByTime(std::vector<SplittingInterval> &splitter, std::vector<Property *> outputs,
142 bool isPeriodic)
const override;
145 void splitByTimeVector(
const std::vector<Types::Core::DateAndTime> &splitter_time_vec,
146 const std::vector<int> &target_vec,
const std::vector<TimeSeriesProperty *> &outputs);
149 void makeFilterByValue(std::vector<SplittingInterval> &split,
double min,
double max,
double TimeTolerance = 0.0,
150 bool centre =
false)
const override;
152 void expandFilterToRange(std::vector<SplittingInterval> &split,
double min,
double max,
155 double averageValueInFilter(
const std::vector<SplittingInterval> &filter)
const override;
157 std::pair<double, double> averageAndStdDevInFilter(
const std::vector<SplittingInterval> &filter)
const override;
159 double timeAverageValue()
const override;
161 void histogramData(
const Types::Core::DateAndTime &tMin,
const Types::Core::DateAndTime &tMax,
162 std::vector<double> &counts)
const;
166 std::map<Types::Core::DateAndTime, TYPE> valueAsCorrectMap()
const;
168 std::vector<TYPE> valuesAsVector()
const;
171 std::multimap<Types::Core::DateAndTime, TYPE> valueAsMultiMap()
const;
173 std::vector<TYPE> filteredValuesAsVector()
const;
176 std::vector<Types::Core::DateAndTime> timesAsVector()
const override;
178 std::vector<Types::Core::DateAndTime> filteredTimesAsVector()
const;
181 std::vector<double> timesAsVectorSeconds()
const;
184 void addValue(
const Types::Core::DateAndTime &time,
const TYPE &
value);
186 void addValue(
const std::string &time,
const TYPE &
value);
188 void addValue(
const std::time_t &time,
const TYPE &
value);
191 void addValues(
const std::vector<Types::Core::DateAndTime> ×,
const std::vector<TYPE> &values);
193 void replaceValues(
const std::vector<Types::Core::DateAndTime> ×,
const std::vector<TYPE> &values);
196 Types::Core::DateAndTime lastTime()
const;
198 TYPE firstValue()
const;
200 Types::Core::DateAndTime firstTime()
const;
202 TYPE lastValue()
const;
212 int size()
const override;
214 int realSize()
const override;
219 std::string
value()
const override;
221 std::vector<std::string> time_tValue()
const;
223 std::map<Types::Core::DateAndTime, TYPE> valueAsMap()
const;
227 std::string setValue(
const std::string &)
override;
229 std::string setValueFromJson(
const Json::Value &)
override;
231 std::string setDataItem(
const std::shared_ptr<DataItem> &)
override;
234 void clear()
override;
236 void clearOutdated()
override;
238 void create(
const Types::Core::DateAndTime &start_time,
const std::vector<double> &time_sec,
239 const std::vector<TYPE> &new_values);
241 void create(
const std::vector<Types::Core::DateAndTime> &new_times,
const std::vector<TYPE> &new_values);
244 TYPE getSingleValue(
const Types::Core::DateAndTime &t)
const;
246 TYPE getSingleValue(
const Types::Core::DateAndTime &t,
int &
index)
const;
251 TYPE nthValue(
int n)
const;
253 Types::Core::DateAndTime nthTime(
int n)
const;
264 void countSize()
const;
267 static bool isTimeString(
const std::string &str);
270 std::string isValid()
const override;
272 std::string getDefault()
const override;
274 bool isDefault()
const override;
281 void eliminateDuplicates();
284 std::string toString()
const;
289 void reserve(
size_t size) { m_values.reserve(size); };
292 std::vector<Mantid::Kernel::SplittingInterval> getSplittingIntervals()
const;
297 void saveTimeVector(::NeXus::File *file);
299 void sortIfNecessary()
const;
301 int findIndex(Types::Core::DateAndTime t)
const;
303 int upperBound(Types::Core::DateAndTime t,
int istart,
int iend)
const;
305 void applyFilter()
const;
308 size_t findNthIndexFromQuickRef(
int n)
const;
310 std::string setValueFromProperty(
const Property &
right)
override;
312 bool isTimeFiltered(
const Types::Core::DateAndTime &time)
const;
314 std::pair<double, double> timeAverageValueAndStdDev()
const;
327 mutable std::vector<std::pair<Types::Core::DateAndTime, bool>>
m_filter;
const std::vector< double > & rhs
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
A non-templated interface to a TimeSeriesProperty.
Base class for properties.
Represents a time interval.
A specialised Property class for holding a series of time-value pairs.
bool m_filterApplied
True if a filter has been applied.
TimeSeriesSortStatus m_propSortedFlag
Flag to state whether mP is sorted or not.
~TimeSeriesProperty() override
Virtual destructor.
int m_size
The number of values (or time intervals) in the time series.
std::vector< std::pair< size_t, size_t > > m_filterQuickRef
Quick reference regions for filter.
std::vector< TimeValueUnit< TYPE > > m_values
Holds the time series data.
void reserve(size_t size)
Reserve memory for efficient adding values to existing property makes sense only when you have reason...
std::vector< std::pair< Types::Core::DateAndTime, bool > > m_filter
The filter.
Class to hold unit value (DateAndTime, T)
bool operator>(const TimeValueUnit &rhs)
TimeValueUnit(const Types::Core::DateAndTime &time, const TYPE &value)
friend bool operator==(const TimeValueUnit &lhs, const TimeValueUnit &rhs)
Types::Core::DateAndTime mtime
friend bool operator<(const TimeValueUnit &lhs, const TimeValueUnit &rhs)
void setTime(Types::Core::DateAndTime newtime)
bool operator==(const TimeValueUnit &rhs)
Types::Core::DateAndTime time() const
friend bool operator>(const TimeValueUnit &lhs, const TimeValueUnit &rhs)
static bool valueCmp(const TimeValueUnit &lhs, const TimeValueUnit &rhs)
bool operator<(const TimeValueUnit &rhs)
MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Adds two workspaces.
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
StatisticType
Maps a "statistic" to a number.
Statistics getStatistics(const std::vector< TYPE > &data, const unsigned int flags=StatOptions::AllStats)
Return a statistics object for the given data set.
double DLLExport filterByStatistic(TimeSeriesProperty< double > const *const propertyToFilter, Kernel::Math::StatisticType statisticType)
Function filtering double TimeSeriesProperties according to the requested statistics.
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator!=(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
Struct holding some useful statistics for a TimeSeriesProperty.
double time_standard_deviation
time weighted standard deviation
double standard_deviation
standard_deviation of the values
double minimum
Minimum value.
double median
Median value.
double time_mean
time weighted average
double duration
Duration in seconds.
double maximum
Maximum value.