Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Kernel::TimeSeriesProperty< TYPE > Class Template Reference

A specialised Property class for holding a series of time-value pairs. More...

#include <TimeSeriesProperty.h>

Inheritance diagram for Mantid::Kernel::TimeSeriesProperty< TYPE >:
Mantid::Kernel::Property Mantid::Kernel::ITimeSeriesProperty

Public Member Functions

void addValue (const std::string &time, const TYPE &value)
 Add a value to the map using a string time. More...
 
void addValue (const std::time_t &time, const TYPE &value)
 Add a value to the map using a time_t. More...
 
void addValue (const Types::Core::DateAndTime &time, const TYPE &value)
 Add a value to the map using a DateAndTime object. More...
 
void addValues (const std::vector< Types::Core::DateAndTime > &times, const std::vector< TYPE > &values)
 Adds vectors of values to the map. More...
 
std::pair< double, double > averageAndStdDevInFilter (const std::vector< SplittingInterval > &filter) const override
 Calculate the time-weighted average and standard deviation of a property in a filtered range. More...
 
std::pair< double, double > averageAndStdDevInFilter (const TimeSplitterType &) const
 Function specialization for TimeSeriesProperty<std::string> More...
 
double averageValueInFilter (const std::vector< SplittingInterval > &filter) const override
 Calculate the time-weighted average of a property in a filtered range. More...
 
double averageValueInFilter (const TimeSplitterType &) const
 Function specialization for TimeSeriesProperty<std::string> More...
 
void clear () override
 Deletes the series of values in the property. More...
 
void clearFilter ()
 Restores the property to the unsorted state. More...
 
void clearOutdated () override
 Deletes all but the 'last entry' in the property. More...
 
TimeSeriesProperty< TYPE > * clone () const override
 "Virtual" copy constructor More...
 
PropertycloneWithTimeShift (const double timeShift) const override
 "Virtual" copy constructor with a time shift in seconds More...
 
void countSize () const
 Updates size() More...
 
void create (const std::vector< Types::Core::DateAndTime > &new_times, const std::vector< TYPE > &new_values)
 Clears and creates a TimeSeriesProperty from these parameters. More...
 
void create (const Types::Core::DateAndTime &start_time, const std::vector< double > &time_sec, const std::vector< TYPE > &new_values)
 Clears and creates a TimeSeriesProperty from these parameters. More...
 
void eliminateDuplicates ()
 Detects whether there are duplicated entries (of time) in property & eliminates them. More...
 
void expandFilterToRange (std::vector< SplittingInterval > &, double, double, const TimeInterval &) const
 Function specialization for TimeSeriesProperty<std::string> More...
 
void expandFilterToRange (std::vector< SplittingInterval > &split, double min, double max, const TimeInterval &range) const override
 Make sure an existing filter covers the full time range given. More...
 
void filterByTime (const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &stop) override
 Filter out a run by time. More...
 
void filterByTimes (const std::vector< SplittingInterval > &splittervec)
 Filter by a range of times. More...
 
std::vector< Types::Core::DateAndTime > filteredTimesAsVector () const
 Get filtered times as a vector. More...
 
std::vector< TYPEfilteredValuesAsVector () const
 Get filtered values as a vector. More...
 
void filterWith (const TimeSeriesProperty< bool > *filter)
 Divide the property into allowed and disallowed time intervals according to filter. More...
 
Types::Core::DateAndTime firstTime () const
 Returns the first time regardless of filter. More...
 
TYPE firstValue () const
 Returns the first value regardless of filter. More...
 
std::string getDefault () const override
 Returns the default value. More...
 
std::unique_ptr< TimeSeriesProperty< double > > getDerivative () const
 Return time series property, containing time derivative of current property. More...
 
std::unique_ptr< TimeSeriesProperty< double > > getDerivative () const
 time series derivative specialization for string type More...
 
size_t getMemorySize () const override
 Return the memory used by the property, in bytes. More...
 
TYPE getSingleValue (const Types::Core::DateAndTime &t) const
 Returns the value at a particular time. More...
 
TYPE getSingleValue (const Types::Core::DateAndTime &t, int &index) const
 Returns the value at a particular time. More...
 
std::vector< Mantid::Kernel::SplittingIntervalgetSplittingIntervals () const
 If filtering by log, get the time intervals for splitting. More...
 
TimeSeriesPropertyStatistics getStatistics () const
 Return a TimeSeriesPropertyStatistics object. More...
 
void histogramData (const Types::Core::DateAndTime &tMin, const Types::Core::DateAndTime &tMax, std::vector< double > &counts) const
 generate constant time-step histogram from the property values More...
 
void histogramData (const Types::Core::DateAndTime &tMin, const Types::Core::DateAndTime &tMax, std::vector< double > &counts) const
 
bool isDefault () const override
 Returns if the value is at the default. More...
 
bool isFiltered () const
 
std::string isValid () const override
 This doesn't check anything -we assume these are always valid. More...
 
Types::Core::DateAndTime lastTime () const
 Returns the last time. More...
 
TYPE lastValue () const
 Returns the last value. More...
 
void makeFilterByValue (std::vector< SplittingInterval > &, double, double, double, bool) const
 Function specialization for TimeSeriesProperty<std::string> More...
 
void makeFilterByValue (std::vector< SplittingInterval > &split, double min, double max, double TimeTolerance=0.0, bool centre=false) const override
 Fill a TimeSplitterType that will filter the events by matching. More...
 
TYPE maxValue () const
 Returns the maximum value found in the series. More...
 
double mean () const
 Returns the mean value found in the series. More...
 
TimeSeriesProperty< TYPE > & merge (Property *rhs) override
 Merge the given property with this one. More...
 
TYPE minValue () const
 Returns the minimum value found in the series. More...
 
TimeInterval nthInterval (int n) const
 Returns n-th valid time interval, in a very inefficient way. More...
 
Types::Core::DateAndTime nthTime (int n) const
 Returns n-th time. NOTE: Complexity is order(n)! regardless of filter. More...
 
TYPE nthValue (int n) const
 Returns n-th value of n-th interval in an incredibly inefficient way. More...
 
virtual bool operator!= (const Property &right) const
 Deep comparison (not equal). More...
 
virtual bool operator!= (const TimeSeriesProperty< TYPE > &right) const
 Deep comparison (not equal). More...
 
TimeSeriesPropertyoperator+= (Property const *right) override
 Add the value of another property. More...
 
virtual bool operator== (const Property &right) const
 Deep comparison. More...
 
virtual bool operator== (const TimeSeriesProperty< TYPE > &right) const
 Deep comparison. More...
 
int realSize () const override
 Returns the real size of the time series property map: More...
 
void replaceValues (const std::vector< Types::Core::DateAndTime > &times, const std::vector< TYPE > &values)
 Replaces the time series with new values time series values. More...
 
void reserve (size_t size)
 Reserve memory for efficient adding values to existing property makes sense only when you have reasonably precise estimate of the total size you'll need easily available in advance. More...
 
void saveProperty (::NeXus::File *file)
 Helper function to save a TimeSeriesProperty<> More...
 
void saveProperty (::NeXus::File *file)
 Helper function to save a TimeSeriesProperty<bool> At the time of writing NeXus does not support boolean directly. More...
 
void saveProperty (::NeXus::File *file) override
 
std::string setDataItem (const std::shared_ptr< DataItem > &) override
 Set a property from a DataItem. More...
 
void setName (const std::string &name)
 Set name of property. More...
 
std::string setValue (const std::string &) override
 Set a property from a string. More...
 
std::string setValueFromJson (const Json::Value &) override
 Set a property from a string. More...
 
int size () const override
 Returns the number of values at UNIQUE time intervals in the time series. More...
 
void splitByTime (std::vector< SplittingInterval > &splitter, std::vector< Property * > outputs, bool isPeriodic) const override
 Split out a time series property by time intervals. More...
 
void splitByTimeVector (const std::vector< Types::Core::DateAndTime > &splitter_time_vec, const std::vector< int > &target_vec, const std::vector< TimeSeriesProperty * > &outputs)
 New split method. More...
 
std::vector< std::string > time_tValue () const
 New method to return time series value pairs as std::vector<std::string> More...
 
double timeAverageValue () const override
 Returns the calculated time weighted average value. More...
 
std::vector< Types::Core::DateAndTime > timesAsVector () const override
 Return the time series's times as a vector<DateAndTime> More...
 
std::vector< double > timesAsVectorSeconds () const
 Return the series as list of times, where the time is the number of seconds since the start. More...
 
 TimeSeriesProperty (const std::string &name)
 Constructor. More...
 
 TimeSeriesProperty (const std::string &name, const std::vector< Types::Core::DateAndTime > &times, const std::vector< TYPE > &values)
 Constructor. More...
 
std::string toString () const
 Stringize the property. More...
 
std::string value () const override
 Get the time series property as a string of 'time value'. More...
 
std::map< Types::Core::DateAndTime, TYPEvalueAsCorrectMap () const
 Return the time series as a correct C++ map<DateAndTime, TYPE>. More...
 
Json::Value valueAsJson () const override
 
std::map< Types::Core::DateAndTime, TYPEvalueAsMap () const
 Return the time series as a C++ map<DateAndTime, TYPE> More...
 
std::multimap< Types::Core::DateAndTime, TYPEvalueAsMultiMap () const
 Return the time series as a correct C++ multimap<DateAndTime, TYPE>. More...
 
std::vector< TYPEvaluesAsVector () const
 Return the time series's values (unfiltered) as a vector<TYPE> More...
 
 ~TimeSeriesProperty () override
 Virtual destructor. More...
 
- Public Member Functions inherited from Mantid::Kernel::Property
virtual std::vector< std::string > allowedValues () const
 Returns the set of valid values for this property, if such a set exists. More...
 
bool autoTrim () const
 Returns if the property is set to automatically trim string unput values of whitespace. More...
 
void clearSettings ()
 Deletes the PropertySettings object contained. More...
 
virtual Propertyclone () const =0
 'Virtual copy constructor' More...
 
virtual const PropertyHistory createHistory () const
 Create a PropertyHistory object representing the current state of the Property. More...
 
void createTemporaryValue ()
 Create a temporary value for this property. More...
 
unsigned int direction () const
 returns the direction of the property More...
 
const std::string & documentation () const
 Get the property's documentation string. More...
 
virtual void filterByTime (const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &stop)
 Filter out a property by time. More...
 
virtual std::string getDefault () const =0
 Get the default value for the property which is the value the property was initialised with. More...
 
const std::string & getGroup ()
 
virtual size_t getMemorySize () const
 
IPropertySettingsgetSettings ()
 
bool hasTemporaryValue () const
 Property is using a temporary value for this property. More...
 
virtual bool isDefault () const =0
 Overriden function that returns if property has the same value that it was initialised with, if applicable. More...
 
virtual bool isMultipleSelectionAllowed ()
 Is Multiple Selection Allowed. More...
 
virtual std::string isValid () const
 Overridden function that checks whether the property, if not overriden returns "". More...
 
virtual bool isValueSerializable () const
 Whether the string returned by value() can be used for serialization. More...
 
virtual Propertymerge (Property *)
 Just returns the property (*this) unless overridden. More...
 
const std::string & name () const
 Get the property's name. More...
 
virtual Propertyoperator+= (Property const *rhs)=0
 Add to this. More...
 
bool remember () const
 Whether to save input values. More...
 
virtual void saveProperty (::NeXus::File *)
 
void setAutoTrim (const bool &setting)
 Sets if the property is set to automatically trim string unput values of whitespace. More...
 
virtual std::string setDataItem (const std::shared_ptr< DataItem > &)=0
 Set the value of the property via a DataItem pointer. More...
 
void setDocumentation (const std::string &documentation)
 Sets the user level description of the property. More...
 
void setGroup (const std::string &group)
 Set the group this property belongs to. More...
 
void setRemember (bool)
 Set wheter to remeber this property input. More...
 
void setSettings (std::unique_ptr< IPropertySettings > settings)
 Set the PropertySettings object. More...
 
virtual void setUnits (const std::string &unit)
 Sets the units of the property, as a string. More...
 
virtual std::string setValue (const std::string &)=0
 Set the value of the property via a string. More...
 
virtual std::string setValueFromJson (const Json::Value &)=0
 Set the value of the property via a Json object. More...
 
virtual std::string setValueFromProperty (const Property &right)=0
 Set the value of the property via a reference to another property. More...
 
virtual int size () const
 Return the size of this property. More...
 
virtual void splitByTime (std::vector< SplittingInterval > &splitter, std::vector< Property * > outputs, bool isProtonCharge=true) const
 Split a property by time. More...
 
const std::string type () const
 Returns the type of the property as a string. More...
 
const std::type_info * type_info () const
 Get the property type_info. More...
 
virtual const std::string & units () const
 Returns the units of the property, if any, as a string. More...
 
virtual std::string value () const =0
 Returns the value of the property as a string. More...
 
virtual Json::Value valueAsJson () const =0
 Returns the value of the property as a Json::Value. More...
 
virtual std::string valueAsPrettyStr (const size_t maxLength=0, const bool collapseLists=true) const
 Returns the value of the property as a pretty printed string. More...
 
virtual ~Property ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Mantid::Kernel::ITimeSeriesProperty
virtual std::pair< double, double > averageAndStdDevInFilter (const std::vector< SplittingInterval > &filter) const =0
 Calculate the time-weighted average and standard deviation of a property in a filtered range. More...
 
virtual double averageValueInFilter (const std::vector< SplittingInterval > &filter) const =0
 Calculate the time-weighted average of a property in a filtered range. More...
 
virtual void clear ()=0
 Deletes the series of values in the property. More...
 
virtual void clearOutdated ()=0
 Deletes all but the 'last entry' in the property. More...
 
virtual PropertycloneWithTimeShift (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. More...
 
virtual void makeFilterByValue (std::vector< SplittingInterval > &split, double min, double max, double TimeTolerance, bool centre=true) const =0
 Fill a TimeSplitterType that will filter the events by matching. More...
 
virtual int realSize () const =0
 Returns the real size of the time series property map: More...
 
virtual double timeAverageValue () const =0
 Returns the calculated time weighted average value. More...
 
virtual std::vector< Types::Core::DateAndTime > timesAsVector () const =0
 Return the time series's times as a vector<DateAndTime> More...
 
virtual ~ITimeSeriesProperty ()=default
 Virtual destructor. More...
 

Static Public Member Functions

static bool isTimeString (const std::string &str)
 Check if str has the right time format. More...
 

Private Member Functions

void applyFilter () const
 Apply a filter. More...
 
int findIndex (Types::Core::DateAndTime t) const
 Find the index of the entry of time t in the mP vector (sorted) More...
 
size_t findNthIndexFromQuickRef (int n) const
 A new algorithm to find Nth index. More...
 
bool isTimeFiltered (const Types::Core::DateAndTime &time) const
 Find if time lies in a filtered region. More...
 
void saveTimeVector (::NeXus::File *file)
 Saves the time vector has time + start attribute. More...
 
std::string setValueFromProperty (const Property &right) override
 Set a value from another property. More...
 
void sortIfNecessary () const
 Sort the property into increasing times, if not already sorted. More...
 
std::pair< double, double > timeAverageValueAndStdDev () const
 Time weighted mean and standard deviation. More...
 
int upperBound (Types::Core::DateAndTime t, int istart, int iend) const
 Find the upper_bound of time t in container. More...
 

Private Attributes

std::vector< std::pair< Types::Core::DateAndTime, bool > > m_filter
 The filter. More...
 
bool m_filterApplied
 True if a filter has been applied. More...
 
std::vector< std::pair< size_t, size_t > > m_filterQuickRef
 Quick reference regions for filter. More...
 
TimeSeriesSortStatus m_propSortedFlag
 Flag to state whether mP is sorted or not. More...
 
int m_size
 The number of values (or time intervals) in the time series. More...
 
std::vector< TimeValueUnit< TYPE > > m_values
 Holds the time series data. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::Kernel::Property
 Property (const Property &right)
 Copy constructor. More...
 
 Property (std::string name, const std::type_info &type, const unsigned int &direction=Direction::Input)
 Constructor. More...
 
- Protected Attributes inherited from Mantid::Kernel::Property
std::string m_name
 The name of the property. More...
 

Detailed Description

template<typename TYPE>
class Mantid::Kernel::TimeSeriesProperty< TYPE >

A specialised Property class for holding a series of time-value pairs.

Definition at line 94 of file TimeSeriesProperty.h.

Constructor & Destructor Documentation

◆ TimeSeriesProperty() [1/2]

template<typename TYPE >
Mantid::Kernel::TimeSeriesProperty< TYPE >::TimeSeriesProperty ( const std::string &  name)
explicit

Constructor.

Parameters
name:: The name to assign to the property

Definition at line 32 of file TimeSeriesProperty.cpp.

◆ TimeSeriesProperty() [2/2]

template<typename TYPE >
Mantid::Kernel::TimeSeriesProperty< TYPE >::TimeSeriesProperty ( const std::string &  name,
const std::vector< Types::Core::DateAndTime > &  times,
const std::vector< TYPE > &  values 
)

Constructor.

Parameters
name:: The name to assign to the property
times:: A vector of DateAndTime objects
values:: A vector of TYPE

Definition at line 43 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeSeriesProperty< TYPE >::addValues().

◆ ~TimeSeriesProperty()

template<typename TYPE >
Mantid::Kernel::TimeSeriesProperty< TYPE >::~TimeSeriesProperty ( )
overridedefault

Member Function Documentation

◆ addValue() [1/3]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue ( const std::string &  time,
const TYPE value 
)

Add a value to the map using a string time.

Add a value to the map.

Parameters
time:: The time as a string in the format: (ISO 8601) yyyy-mm-ddThh:mm:ss
value:: The associated value
Returns
True if insertion successful (i.e. identical time not already in map

Definition at line 1086 of file TimeSeriesProperty.cpp.

References value.

◆ addValue() [2/3]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue ( const std::time_t &  time,
const TYPE value 
)

Add a value to the map using a time_t.

Parameters
time:: The time as a time_t value
value:: The associated value
Returns
True if insertion successful (i.e. identical time not already in map

Definition at line 1096 of file TimeSeriesProperty.cpp.

References value.

◆ addValue() [3/3]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue ( const Types::Core::DateAndTime &  time,
const TYPE value 
)

◆ addValues()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::addValues ( const std::vector< Types::Core::DateAndTime > &  times,
const std::vector< TYPE > &  values 
)

Adds vectors of values to the map.

Should be much faster than repeated calls to addValue.

Should be much faster than repeated calls to addValue.

Parameters
times:: The time as a boost::posix_time::ptime value
values:: The associated value

Definition at line 1108 of file TimeSeriesProperty.cpp.

References m_size, and Mantid::Kernel::TSUNKNOWN.

Referenced by Mantid::DataHandling::FilterEventsByLogValuePreNexus::setProtonCharge(), Mantid::DataHandling::LoadEventPreNexus2::setProtonCharge(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::TimeSeriesProperty().

◆ applyFilter()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::applyFilter
private

Apply a filter.

Definition at line 2028 of file TimeSeriesProperty.cpp.

◆ averageAndStdDevInFilter() [1/2]

template<typename TYPE >
std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< TYPE >::averageAndStdDevInFilter ( const std::vector< SplittingInterval > &  filter) const
overridevirtual

Calculate the time-weighted average and standard deviation of a property in a filtered range.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 876 of file TimeSeriesProperty.cpp.

References index, and value.

◆ averageAndStdDevInFilter() [2/2]

std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< std::string >::averageAndStdDevInFilter ( const TimeSplitterType ) const

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Definition at line 921 of file TimeSeriesProperty.cpp.

◆ averageValueInFilter() [1/2]

template<typename TYPE >
double Mantid::Kernel::TimeSeriesProperty< TYPE >::averageValueInFilter ( const std::vector< SplittingInterval > &  filter) const
overridevirtual

Calculate the time-weighted average of a property in a filtered range.

Calculates the time-weighted average of a property in a filtered range.

This is written for that case of logs whose values start at the times given.

Parameters
filterThe splitter/filter restricting the range of values included
Returns
The time-weighted average value of the log in the range within the filter.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 812 of file TimeSeriesProperty.cpp.

References index, and value.

◆ averageValueInFilter() [2/2]

double Mantid::Kernel::TimeSeriesProperty< std::string >::averageValueInFilter ( const TimeSplitterType ) const

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Definition at line 856 of file TimeSeriesProperty.cpp.

◆ clear()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::clear
overridevirtual

Deletes the series of values in the property.

Clears out the values in the property.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 1325 of file TimeSeriesProperty.cpp.

References m_size, and Mantid::Kernel::TSSORTED.

Referenced by Mantid::Algorithms::FilterEvents::generateSplitterTSP().

◆ clearFilter()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::clearFilter

Restores the property to the unsorted state.

Restores the property to the unsorted & unfiltered state.

Definition at line 1778 of file TimeSeriesProperty.cpp.

◆ clearOutdated()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::clearOutdated
overridevirtual

Deletes all but the 'last entry' in the property.

Clears out all but the last value in the property.

The last value is the last entry in the m_values vector - no sorting is done or checked for to ensure that the last value is the most recent in time. It is up to the client to call sortIfNecessary() first if this is a requirement.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 1340 of file TimeSeriesProperty.cpp.

References m_size.

◆ clone()

template<typename TYPE >
TimeSeriesProperty< TYPE > * Mantid::Kernel::TimeSeriesProperty< TYPE >::clone
overridevirtual

◆ cloneWithTimeShift()

template<typename TYPE >
Property * Mantid::Kernel::TimeSeriesProperty< TYPE >::cloneWithTimeShift ( const double  timeShift) const
overridevirtual

"Virtual" copy constructor with a time shift in seconds

"Virutal copy constructor with a time shift

Parameters
timeShift:: a time shift in seconds

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 64 of file TimeSeriesProperty.cpp.

◆ countSize()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::countSize

Updates size()

Definition at line 1786 of file TimeSeriesProperty.cpp.

References m_size.

◆ create() [1/2]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::create ( const std::vector< Types::Core::DateAndTime > &  new_times,
const std::vector< TYPE > &  new_values 
)

Clears and creates a TimeSeriesProperty from these parameters.

Clears and creates a TimeSeriesProperty from these parameters:

Parameters
new_times:: A vector of DateAndTime.
new_values:: A vector of values, each corresponding to the time off set in new_time. Vector sizes must match.

Definition at line 1384 of file TimeSeriesProperty.cpp.

References m_size, Mantid::Kernel::TSSORTED, and Mantid::Kernel::TSUNSORTED.

◆ create() [2/2]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::create ( const Types::Core::DateAndTime &  start_time,
const std::vector< double > &  time_sec,
const std::vector< TYPE > &  new_values 
)

Clears and creates a TimeSeriesProperty from these parameters.

Clears and creates a TimeSeriesProperty from these parameters:

Parameters
start_time:: The reference time as a boost::posix_time::ptime value
time_sec:: A vector of time offset (from start_time) in seconds.
new_values:: A vector of values, each corresponding to the time offset in time_sec. Vector sizes must match.

Definition at line 1359 of file TimeSeriesProperty.cpp.

References Mantid::DataObjects::create().

Referenced by Mantid::DataHandling::LoadNexusLogs::execLoader(), and Mantid::DataHandling::LoadNexusLogs::loadVetoPulses().

◆ eliminateDuplicates()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::eliminateDuplicates

Detects whether there are duplicated entries (of time) in property & eliminates them.

Definition at line 1872 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::Kernel::DateAndTimeHelpers::g_log, value, and Mantid::Kernel::Logger::warning().

Referenced by Mantid::Algorithms::GenerateEventsFilter::setFilterByLogValue().

◆ expandFilterToRange() [1/2]

void Mantid::Kernel::TimeSeriesProperty< std::string >::expandFilterToRange ( std::vector< SplittingInterval > &  ,
double  ,
double  ,
const TimeInterval  
) const
virtual

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 783 of file TimeSeriesProperty.cpp.

◆ expandFilterToRange() [2/2]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::expandFilterToRange ( std::vector< SplittingInterval > &  split,
double  min,
double  max,
const TimeInterval range 
) const
overridevirtual

Make sure an existing filter covers the full time range given.

If the first and/or last values in a log are between min & max, expand and existing TimeSplitter (created by makeFilterByValue) if necessary to cover the full TimeInterval given.

This method is used by the FilterByLogValue algorithm.

Parameters
splitThe splitter to modify if necessary
minThe minimum 'good' value
maxThe maximum 'good' value
rangeThe full time range that we want this splitter to cover

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 738 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeInterval::begin(), Mantid::EMPTY_DBL(), Mantid::Kernel::TimeInterval::end(), maxValue, minValue, and Mantid::Geometry::split().

Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput().

◆ filterByTime()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::filterByTime ( const Types::Core::DateAndTime &  start,
const Types::Core::DateAndTime &  stop 
)
overridevirtual

Filter out a run by time.

Takes out any TimeSeriesProperty log entries outside of the given absolute time range. Be noticed that this operation is not reversible.

Use case 1: if start time of the filter fstart is in between t1 and t2 of the TimeSeriesProperty, then, the new start time is fstart and the value of the log is the log value @ t1

Use case 2: if the start time of the filter in on t1 or before log start time t0, then the new start time is t1/t0/filter start time.

EXCEPTION: If there is only one entry in the list, it is considered to mean "constant" so the value is kept even if the time is outside the range.

Parameters
start:: Absolute start time. Any log entries at times >= to this time are kept.
stop:: Absolute stop time. Any log entries at times < than this time are kept.

Reimplemented from Mantid::Kernel::Property.

Definition at line 260 of file TimeSeriesProperty.cpp.

◆ filterByTimes()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::filterByTimes ( const std::vector< SplittingInterval > &  splittervec)

Filter by a range of times.

If current property has a single value it remains unaffected

Parameters
splittervec:: A list of intervals to split filter on

Definition at line 318 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::Kernel::DateAndTimeHelpers::g_log, m_size, value, and Mantid::Kernel::Logger::warning().

◆ filteredTimesAsVector()

template<typename TYPE >
std::vector< DateAndTime > Mantid::Kernel::TimeSeriesProperty< TYPE >::filteredTimesAsVector

Get filtered times as a vector.

Return the time series's filtered times as a vector<DateAndTime>

Returns
A vector of DateAndTime objects

Definition at line 1010 of file TimeSeriesProperty.cpp.

References value.

◆ filteredValuesAsVector()

template<typename TYPE >
std::vector< TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::filteredValuesAsVector

Get filtered values as a vector.

Get a vector of values taking the filter into account.

Values will be excluded if their times lie in a region where the filter is false.

Returns
:: Vector of included values only

Definition at line 2315 of file TimeSeriesProperty.cpp.

References value.

Referenced by Mantid::Algorithms::ConjoinXRuns::getXAxis().

◆ filterWith()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::filterWith ( const TimeSeriesProperty< bool > *  filter)

Divide the property into allowed and disallowed time intervals according to filter.

Definition at line 1709 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeSeriesProperty< TYPE >::size(), Mantid::Kernel::TimeSeriesProperty< TYPE >::timesAsVector(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::valuesAsVector().

◆ findIndex()

template<typename TYPE >
int Mantid::Kernel::TimeSeriesProperty< TYPE >::findIndex ( Types::Core::DateAndTime  t) const
private

Find the index of the entry of time t in the mP vector (sorted)

Find the index of the entry of time t in the mP vector (sorted) Return @ if t is within log.begin and log.end, then the index of the log equal or just smaller than t if t is earlier (less) than the starting time, return -1 if t is later (larger) than the ending time, return m_value.size.

Definition at line 1950 of file TimeSeriesProperty.cpp.

References value.

◆ findNthIndexFromQuickRef()

template<typename TYPE >
size_t Mantid::Kernel::TimeSeriesProperty< TYPE >::findNthIndexFromQuickRef ( int  n) const
private

A new algorithm to find Nth index.

It is simple and leave a lot work to the callers

Definition at line 2136 of file TimeSeriesProperty.cpp.

References index, and n.

◆ firstTime()

template<typename TYPE >
DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::firstTime

◆ firstValue()

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::firstValue

◆ getDefault()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::getDefault
overridevirtual

Returns the default value.

Implements Mantid::Kernel::Property.

Definition at line 1827 of file TimeSeriesProperty.cpp.

◆ getDerivative() [1/2]

template<typename TYPE >
std::unique_ptr< TimeSeriesProperty< double > > Mantid::Kernel::TimeSeriesProperty< TYPE >::getDerivative

Return time series property, containing time derivative of current property.

The property itself and the returned time derivative become sorted by time and the derivative is calculated in seconds^-1. (e.g. dValue/dT where dT=t2-t1 is time difference in seconds for subsequent time readings and dValue=Val1-Val2 is difference in subsequent values)

Definition at line 87 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Algorithms::GetAllEi::findChopSpeedAndDelay(), and Mantid::Algorithms::CalculateCountRate::setOutLogParameters().

◆ getDerivative() [2/2]

std::unique_ptr< TimeSeriesProperty< double > > Mantid::Kernel::TimeSeriesProperty< std::string >::getDerivative ( ) const

time series derivative specialization for string type

Definition at line 116 of file TimeSeriesProperty.cpp.

◆ getMemorySize()

template<typename TYPE >
size_t Mantid::Kernel::TimeSeriesProperty< TYPE >::getMemorySize
overridevirtual

Return the memory used by the property, in bytes.

Reimplemented from Mantid::Kernel::Property.

Definition at line 123 of file TimeSeriesProperty.cpp.

◆ getSingleValue() [1/2]

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::getSingleValue ( const Types::Core::DateAndTime &  t) const

Returns the value at a particular time.

Parameters
t:: time
Returns
Value at time t

Definition at line 1413 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, index, and value.

Referenced by Mantid::Algorithms::SumEventsByLogValue::createBinnedOutput(), and Mantid::Algorithms::SumEventsByLogValue::filterEventList().

◆ getSingleValue() [2/2]

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::getSingleValue ( const Types::Core::DateAndTime &  t,
int &  index 
) const

Returns the value at a particular time.

Parameters
t:: time
index:: index of time
Returns
Value at time t

Definition at line 1460 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, index, and value.

◆ getSplittingIntervals()

template<typename TYPE >
std::vector< SplittingInterval > Mantid::Kernel::TimeSeriesProperty< TYPE >::getSplittingIntervals

If filtering by log, get the time intervals for splitting.

Get a list of the splitting intervals, if filtering is enabled.

Otherwise the interval is just first time - last time.

Returns
:: Vector of splitting intervals

Count along to find the next time in the filter for which value is 'val'

Definition at line 2373 of file TimeSeriesProperty.cpp.

References index.

◆ getStatistics()

◆ histogramData() [1/2]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::histogramData ( const Types::Core::DateAndTime &  tMin,
const Types::Core::DateAndTime &  tMax,
std::vector< double > &  counts 
) const

generate constant time-step histogram from the property values

Calculate constant step histogram of the time series data.

Parameters
tMin– minimal time to include in histogram
tMax– maximal time to constrain the histogram data
counts– vector of output histogrammed data. On input, the size of the vector defines the number of points in the histogram. On output, adds all property elements belonging to the time interval [tMin+n*dT;tMin+(n+1)*dT] to the initial values of each n-th element of the counts vector, where dT = (tMax-tMin)/counts.size()

Definition at line 2275 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Algorithms::CalculateCountRate::buildVisWSNormalization().

◆ histogramData() [2/2]

void Mantid::Kernel::TimeSeriesProperty< std::string >::histogramData ( const Types::Core::DateAndTime &  tMin,
const Types::Core::DateAndTime &  tMax,
std::vector< double > &  counts 
) const

Definition at line 2299 of file TimeSeriesProperty.cpp.

References UNUSED_ARG.

◆ isDefault()

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::isDefault
overridevirtual

Returns if the value is at the default.

A TimeSeriesProperty never has a default.

Implements Mantid::Kernel::Property.

Definition at line 1834 of file TimeSeriesProperty.cpp.

◆ isFiltered()

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::isFiltered ( ) const
inline

Definition at line 261 of file TimeSeriesProperty.h.

◆ isTimeFiltered()

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::isTimeFiltered ( const Types::Core::DateAndTime &  time) const
private

Find if time lies in a filtered region.

Find out if the given time is included in the filtered data i.e.

it does not lie in an excluded region. This function assumes the filter is not empty, it has been applied and the values are sorted by time.

Parameters
time:: [input] Time to check
Returns
:: True if time is in an included region, false if the filter excludes it.

Definition at line 2343 of file TimeSeriesProperty.cpp.

◆ isTimeString()

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::isTimeString ( const std::string &  str)
static

Check if str has the right time format.

Parameters
str:: The string to check
Returns
True if the format is correct, false otherwise.

Definition at line 1812 of file TimeSeriesProperty.cpp.

◆ isValid()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::isValid
overridevirtual

This doesn't check anything -we assume these are always valid.

Returns
an empty string ""

Reimplemented from Mantid::Kernel::Property.

Definition at line 1821 of file TimeSeriesProperty.cpp.

◆ lastTime()

template<typename TYPE >
DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime

◆ lastValue()

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::lastValue

◆ makeFilterByValue() [1/2]

void Mantid::Kernel::TimeSeriesProperty< std::string >::makeFilterByValue ( std::vector< SplittingInterval > &  ,
double  ,
double  ,
double  ,
bool   
) const
virtual

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 719 of file TimeSeriesProperty.cpp.

◆ makeFilterByValue() [2/2]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::makeFilterByValue ( std::vector< SplittingInterval > &  split,
double  min,
double  max,
double  TimeTolerance = 0.0,
bool  centre = false 
) const
overridevirtual

Fill a TimeSplitterType that will filter the events by matching.

Fill a TimeSplitterType that will filter the events by matching log values >= min and <= max.

Creates SplittingInterval's where times match the log values, and going to index==0. This method is used by the FilterByLogValue algorithm.

Parameters
split:: Splitter that will be filled.
min:: min value
max:: max value
TimeTolerance:: offset added to times in seconds (default: 0)
centre:: Whether the log value time is considered centred or at the beginning (the default).

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 639 of file TimeSeriesProperty.cpp.

References Mantid::EMPTY_DBL(), maxValue, minValue, and Mantid::Geometry::split().

Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput().

◆ maxValue()

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::maxValue

◆ mean()

template<typename TYPE >
double Mantid::Kernel::TimeSeriesProperty< TYPE >::mean

Returns the mean value found in the series.

Definition at line 1202 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::getStatistics(), Mantid::Kernel::Statistics::mean, and Mantid::Kernel::StatOptions::Mean.

◆ merge()

template<typename TYPE >
TimeSeriesProperty< TYPE > & Mantid::Kernel::TimeSeriesProperty< TYPE >::merge ( Property rhs)
overridevirtual

Merge the given property with this one.

Just returns the property (*this) unless overridden.

Parameters
rhsa property that is merged in some descendent classes
Returns
a property with the value

Reimplemented from Mantid::Kernel::Property.

Definition at line 133 of file TimeSeriesProperty.cpp.

References Mantid::API::operator+=(), and rhs.

◆ minValue()

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::minValue

◆ nthInterval()

template<typename TYPE >
TimeInterval Mantid::Kernel::TimeSeriesProperty< TYPE >::nthInterval ( int  n) const

Returns n-th valid time interval, in a very inefficient way.

Here are some special cases (1) If empty property, throw runtime_error (2) If double or more entries, skip! (3) If n = size of property, use dt from last interval (4) If n > size of property, return Interval = 0

Parameters
n:: index
Returns
n-th time interval

Definition at line 1513 of file TimeSeriesProperty.cpp.

References Mantid::Geometry::d, Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, and n.

◆ nthTime()

template<typename TYPE >
Types::Core::DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::nthTime ( int  n) const

Returns n-th time. NOTE: Complexity is order(n)! regardless of filter.

Returns n-th time, or the last time if fewer than n entries.

Special cases: There is no special cases

Parameters
n:: index
Returns
DateAndTime

Definition at line 1677 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, and n.

Referenced by Mantid::Algorithms::GenerateEventsFilter::findRunEnd(), Mantid::API::MatrixWorkspace::getFirstPulseTime(), Mantid::Algorithms::AddLogDerivative::makeDerivative(), Mantid::Algorithms::GenerateEventsFilter::makeFilterBySingleValue(), and Mantid::Algorithms::GenerateEventsFilter::makeMultipleFiltersByValuesPartialLog().

◆ nthValue()

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::nthValue ( int  n) const

◆ operator!=() [1/2]

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::operator!= ( const Property right) const
virtual

Deep comparison (not equal).

Parameters
rightThe other property to compare to.
Returns
true if the are not equal.

Definition at line 228 of file TimeSeriesProperty.cpp.

◆ operator!=() [2/2]

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::operator!= ( const TimeSeriesProperty< TYPE > &  right) const
virtual

Deep comparison (not equal).

Parameters
rightThe other property to compare to.
Returns
true if the are not equal.

Definition at line 219 of file TimeSeriesProperty.cpp.

References right.

◆ operator+=()

template<typename TYPE >
TimeSeriesProperty< TYPE > & Mantid::Kernel::TimeSeriesProperty< TYPE >::operator+= ( Property const *  right)
overridevirtual

Add the value of another property.

Parameters
rightthe property to add
Returns
the sum

Implements Mantid::Kernel::Property.

Definition at line 142 of file TimeSeriesProperty.cpp.

References rhs, and right.

◆ operator==() [1/2]

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::operator== ( const Property right) const
virtual

Deep comparison.

Parameters
rightThe other property to compare to.
Returns
true if the are equal.

Definition at line 207 of file TimeSeriesProperty.cpp.

◆ operator==() [2/2]

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::operator== ( const TimeSeriesProperty< TYPE > &  right) const
virtual

Deep comparison.

Parameters
rightThe other property to compare to.
Returns
true if the are equal.

Definition at line 171 of file TimeSeriesProperty.cpp.

◆ realSize()

template<typename TYPE >
int Mantid::Kernel::TimeSeriesProperty< TYPE >::realSize
overridevirtual

Returns the real size of the time series property map:

Returns the real size of the time series property map: the number of entries, including repeated ones.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 1216 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::Algorithms::SumEventsByLogValue::filterEventList(), and Mantid::Algorithms::CalculateCountRate::setOutLogParameters().

◆ replaceValues()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::replaceValues ( const std::vector< Types::Core::DateAndTime > &  times,
const std::vector< TYPE > &  values 
)

Replaces the time series with new values time series values.

replace vectors of values to the map.

First we clear the vectors and then we run addValues

Parameters
times:: The time as a boost::posix_time::ptime value
values:: The associated value

Definition at line 1126 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Algorithms::CalculateCountRate::calcRateLog(), and Mantid::Kernel::LogParser::LogParser().

◆ reserve()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::reserve ( size_t  size)
inline

Reserve memory for efficient adding values to existing property makes sense only when you have reasonably precise estimate of the total size you'll need easily available in advance.


Definition at line 289 of file TimeSeriesProperty.h.

◆ saveProperty() [1/3]

void Mantid::Kernel::TimeSeriesProperty< std::string >::saveProperty ( ::NeXus::File *  file)
virtual

Helper function to save a TimeSeriesProperty<>

Reimplemented from Mantid::Kernel::Property.

Definition at line 2200 of file TimeSeriesProperty.cpp.

References index.

◆ saveProperty() [2/3]

void Mantid::Kernel::TimeSeriesProperty< bool >::saveProperty ( ::NeXus::File *  file)
virtual

Helper function to save a TimeSeriesProperty<bool> At the time of writing NeXus does not support boolean directly.

We will use a UINT8 for the value and add an attribute boolean to inidcate it is actually a bool

Reimplemented from Mantid::Kernel::Property.

Definition at line 2233 of file TimeSeriesProperty.cpp.

References value.

◆ saveProperty() [3/3]

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::saveProperty ( ::NeXus::File *  file)
overridevirtual

Reimplemented from Mantid::Kernel::Property.

Definition at line 2245 of file TimeSeriesProperty.cpp.

References value.

◆ saveTimeVector()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::saveTimeVector ( ::NeXus::File *  file)
private

Saves the time vector has time + start attribute.

Definition at line 2186 of file TimeSeriesProperty.cpp.

◆ setDataItem()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::setDataItem ( const std::shared_ptr< DataItem > &  )
overridevirtual

Set a property from a DataItem.

Exceptions
Exception::NotImplementedErrorNot yet implemented
Returns
Nothing in this case

Implements Mantid::Kernel::Property.

Definition at line 1317 of file TimeSeriesProperty.cpp.

◆ setName()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::setName ( const std::string &  name)

Set name of property.

Set name of the property.

Definition at line 235 of file TimeSeriesProperty.cpp.

◆ setValue()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::setValue ( const std::string &  )
overridevirtual

Set a property from a string.

Set the property from a string value.

Throws a NotImplementedError

Exceptions
Exception::NotImplementedErrorNot yet implemented
Returns
Nothing in this case

Implements Mantid::Kernel::Property.

Definition at line 1295 of file TimeSeriesProperty.cpp.

◆ setValueFromJson()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::setValueFromJson ( const Json::Value &  )
overridevirtual

Set a property from a string.

Set the property from a Json value.

Throws a NotImplementedError

Exceptions
Exception::NotImplementedErrorNot yet implemented
Returns
Nothing in this case

Implements Mantid::Kernel::Property.

Definition at line 1306 of file TimeSeriesProperty.cpp.

◆ setValueFromProperty()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::setValueFromProperty ( const Property right)
overrideprivatevirtual

Set a value from another property.

Set the value of the property via a reference to another property.

If the value is unacceptable the value is not changed but a string is returned. The value is only accepted if the other property has the same type as this

Parameters
right:: A reference to a property.

Implements Mantid::Kernel::Property.

Definition at line 2170 of file TimeSeriesProperty.cpp.

References m_size, Mantid::Kernel::TimeSeriesProperty< TYPE >::m_values, and right.

◆ size()

template<typename TYPE >
int Mantid::Kernel::TimeSeriesProperty< TYPE >::size
overridevirtual

◆ sortIfNecessary()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::sortIfNecessary
private

Sort the property into increasing times, if not already sorted.

Definition at line 1928 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::Logger::information(), Mantid::Kernel::TSSORTED, Mantid::Kernel::TSUNKNOWN, and Mantid::Kernel::TSUNSORTED.

◆ splitByTime()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTime ( std::vector< SplittingInterval > &  splitter,
std::vector< Property * >  outputs,
bool  isPeriodic 
) const
overridevirtual

Split out a time series property by time intervals.

Split this time series property by time intervals to multiple time series property according to number of distinct splitters' indexes, such as 0 and 1.

NOTE: If the input TSP has a single value, it is assumed to be a constant and so is not split, but simply copied to all output.

Parameters
splitter:: a TimeSplitterType object containing the list of intervals and destinations.
outputs:: A vector of output TimeSeriesProperty pointers of the same type.
isPeriodic:: whether the log (this TSP) is periodic. For example proton-charge is periodic log.

Reimplemented from Mantid::Kernel::Property.

Definition at line 400 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue(), Mantid::Kernel::Logger::debug(), Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime(), Mantid::Kernel::TimeSeriesProperty< TYPE >::m_size, Mantid::Kernel::TimeSeriesProperty< TYPE >::m_values, and Mantid::Kernel::TimeSeriesProperty< TYPE >::size().

◆ splitByTimeVector()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTimeVector ( const std::vector< Types::Core::DateAndTime > &  splitter_time_vec,
const std::vector< int > &  target_vec,
const std::vector< TimeSeriesProperty< TYPE > * > &  outputs 
)

New split method.

Split this TimeSeriresProperty by a vector of time with N entries, and by the wsIndex workspace index defined by inputWorkspaceIndicies Requirements: vector output must be defined before this method is called.

Definition at line 506 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::DateAndTimeHelpers::g_log, and Mantid::Kernel::Logger::warning().

Referenced by Mantid::Algorithms::FilterEvents::splitTimeSeriesProperty().

◆ time_tValue()

template<typename TYPE >
std::vector< std::string > Mantid::Kernel::TimeSeriesProperty< TYPE >::time_tValue

New method to return time series value pairs as std::vector<std::string>

Returns
time series property values as a string vector "<time_t> value"

Definition at line 1245 of file TimeSeriesProperty.cpp.

◆ timeAverageValue()

template<typename TYPE >
double Mantid::Kernel::TimeSeriesProperty< TYPE >::timeAverageValue
overridevirtual

Returns the calculated time weighted average value.

Calculates the time-weighted average of a property.

Returns
The time-weighted average value of the log.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 793 of file TimeSeriesProperty.cpp.

◆ timeAverageValueAndStdDev()

template<typename TYPE >
std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< TYPE >::timeAverageValueAndStdDev
private

Time weighted mean and standard deviation.

Definition at line 862 of file TimeSeriesProperty.cpp.

◆ timesAsVector()

template<typename TYPE >
std::vector< DateAndTime > Mantid::Kernel::TimeSeriesProperty< TYPE >::timesAsVector
overridevirtual

◆ timesAsVectorSeconds()

template<typename TYPE >
std::vector< double > Mantid::Kernel::TimeSeriesProperty< TYPE >::timesAsVectorSeconds

Return the series as list of times, where the time is the number of seconds since the start.

Returns
Return the series as list of times, where the time is the number of seconds since the start.

Definition at line 1034 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Algorithms::AverageLogData::exec(), and Mantid::Algorithms::AddLogDerivative::makeDerivative().

◆ toString()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::toString

Stringize the property.

Definition at line 1911 of file TimeSeriesProperty.cpp.

◆ upperBound()

template<typename TYPE >
int Mantid::Kernel::TimeSeriesProperty< TYPE >::upperBound ( Types::Core::DateAndTime  t,
int  istart,
int  iend 
) const
private

Find the upper_bound of time t in container.

Search range: begin+istart to begin+iend Return C[ir] == t or C[ir] > t and C[ir-1] < t -1: exceeding lower bound mP.size(): exceeding upper bound

Definition at line 1984 of file TimeSeriesProperty.cpp.

References index, and value.

◆ value()

template<typename TYPE >
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::value
overridevirtual

Get the time series property as a string of 'time value'.

Implements Mantid::Kernel::Property.

Definition at line 1222 of file TimeSeriesProperty.cpp.

◆ valueAsCorrectMap()

template<typename TYPE >
std::map< DateAndTime, TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::valueAsCorrectMap

Return the time series as a correct C++ map<DateAndTime, TYPE>.

All values

All values are included.

Returns
time series property values as map

Definition at line 941 of file TimeSeriesProperty.cpp.

Referenced by Mantid::API::LogFilterGenerator::filterByStatus(), and Mantid::Algorithms::GetAllEi::findChopSpeedAndDelay().

◆ valueAsJson()

template<typename TYPE >
Json::Value Mantid::Kernel::TimeSeriesProperty< TYPE >::valueAsJson
overridevirtual
Returns
the value as a Json object. The string representation is used as the underlying type

Implements Mantid::Kernel::Property.

Definition at line 2262 of file TimeSeriesProperty.cpp.

References value.

◆ valueAsMap()

template<typename TYPE >
std::map< DateAndTime, TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::valueAsMap

Return the time series as a C++ map<DateAndTime, TYPE>

WARNING: THIS ONLY RETURNS UNIQUE VALUES, AND SKIPS ANY REPEATED VALUES! USE AT YOUR OWN RISK! Try valueAsCorrectMap() instead.

Returns
time series property values as map

Definition at line 1267 of file TimeSeriesProperty.cpp.

References Mantid::Geometry::d, and value.

Referenced by Mantid::NeXus::NexusFileIO::writeNumericTimeLog().

◆ valueAsMultiMap()

template<typename TYPE >
std::multimap< DateAndTime, TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::valueAsMultiMap

Return the time series as a correct C++ multimap<DateAndTime, TYPE>.

Return the time series as a C++ multimap<DateAndTime, TYPE>.

All values

All values. This method is used in parsing the ISIS ICPevent log file: different commands can be recorded against the same time stamp but all must be present.

Definition at line 978 of file TimeSeriesProperty.cpp.

◆ valuesAsVector()

template<typename TYPE >
std::vector< TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::valuesAsVector

Member Data Documentation

◆ m_filter

template<typename TYPE >
std::vector<std::pair<Types::Core::DateAndTime, bool> > Mantid::Kernel::TimeSeriesProperty< TYPE >::m_filter
mutableprivate

The filter.

Definition at line 327 of file TimeSeriesProperty.h.

◆ m_filterApplied

template<typename TYPE >
bool Mantid::Kernel::TimeSeriesProperty< TYPE >::m_filterApplied
mutableprivate

True if a filter has been applied.

Definition at line 331 of file TimeSeriesProperty.h.

◆ m_filterQuickRef

template<typename TYPE >
std::vector<std::pair<size_t, size_t> > Mantid::Kernel::TimeSeriesProperty< TYPE >::m_filterQuickRef
mutableprivate

Quick reference regions for filter.

Definition at line 329 of file TimeSeriesProperty.h.

◆ m_propSortedFlag

template<typename TYPE >
TimeSeriesSortStatus Mantid::Kernel::TimeSeriesProperty< TYPE >::m_propSortedFlag
mutableprivate

Flag to state whether mP is sorted or not.

Definition at line 324 of file TimeSeriesProperty.h.

◆ m_size

template<typename TYPE >
int Mantid::Kernel::TimeSeriesProperty< TYPE >::m_size
mutableprivate

The number of values (or time intervals) in the time series.

It can be different from m_propertySeries.size()

Definition at line 321 of file TimeSeriesProperty.h.

Referenced by Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTime().

◆ m_values

template<typename TYPE >
std::vector<TimeValueUnit<TYPE> > Mantid::Kernel::TimeSeriesProperty< TYPE >::m_values
mutableprivate

The documentation for this class was generated from the following files: