Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | 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 Mantid::Kernel::FilteredTimeSeriesProperty< double >

Public Member Functions

void addValue (const std::string &time, const TYPE &value)
 Add a value to the map using a string time.
 
void addValue (const std::time_t &time, const TYPE &value)
 Add a value to the map using a time_t.
 
void addValue (const Types::Core::DateAndTime &time, const TYPE &value)
 Add a value to the map using a DateAndTime object.
 
void addValues (const std::vector< Types::Core::DateAndTime > &times, const std::vector< TYPE > &values)
 Adds vectors of values to the map.
 
void clear () override
 Deletes the series of values in the property.
 
void clearOutdated () override
 Deletes all but the 'last entry' in the property.
 
TimeSeriesProperty< TYPE > * clone () const override
 "Virtual" copy constructor
 
PropertycloneInTimeROI (const TimeROI &timeROI) const override
 Create a partial copy according to TimeROI.
 
PropertycloneWithTimeShift (const double timeShift) const override
 "Virtual" copy constructor with a time shift in seconds
 
void countSize () const
 Updates size()
 
void create (const std::vector< Types::Core::DateAndTime > &new_times, const std::vector< TYPE > &new_values)
 Clears and creates a TimeSeriesProperty from these parameters.
 
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.
 
double durationInSeconds (const Kernel::TimeROI *roi=nullptr) const
 Returns the duration of the time series, possibly restricted by a TimeROI object.
 
void eliminateDuplicates ()
 Detects whether there are duplicated entries (of time) in property & eliminates them.
 
void expandFilterToRange (std::vector< SplittingInterval > &, double, double, const TimeInterval &) const
 Function specialization for TimeSeriesProperty<std::string>
 
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.
 
double extractStatistic (Math::StatisticType selection, const TimeROI *roi) const
 Function specialization for TimeSeriesProperty<std::string>
 
double extractStatistic (Math::StatisticType selection, const TimeROI *roi=nullptr) const override
 Calculate a particular statistical quantity from the values of the time series.
 
virtual std::vector< Types::Core::DateAndTime > filteredTimesAsVector () const
 
virtual std::vector< Types::Core::DateAndTime > filteredTimesAsVector (const Kernel::TimeROI *roi) const
 Get filtered times as a vector.
 
virtual std::vector< TYPEfilteredValuesAsVector () const
 
virtual std::vector< TYPEfilteredValuesAsVector (const Kernel::TimeROI *roi) const
 Get filtered values as a vector.
 
Types::Core::DateAndTime firstTime () const
 Returns the first time regardless of filter.
 
TYPE firstValue () const
 Returns the first value regardless of filter.
 
TYPE firstValue (const Kernel::TimeROI &roi) const
 Returns the first value in the TimeROI.
 
std::string getDefault () const override
 Returns the default value.
 
std::unique_ptr< TimeSeriesProperty< double > > getDerivative () const
 Return time series property, containing time derivative of current property.
 
std::unique_ptr< TimeSeriesProperty< double > > getDerivative () const
 time series derivative specialization for string type
 
size_t getMemorySize () const override
 Return the memory used by the property, in bytes.
 
TYPE getSingleValue (const Types::Core::DateAndTime &t) const
 Returns the value at a particular time.
 
TYPE getSingleValue (const Types::Core::DateAndTime &t, int &index) const
 Returns the value at a particular time.
 
TimeSeriesPropertyStatistics getStatistics (const Kernel::TimeROI *roi=nullptr) const override
 Return a TimeSeriesPropertyStatistics object.
 
TimeSeriesPropertyStatistics getStatistics (const TimeROI *) const
 Return a TimeSeriesPropertyStatistics object.
 
virtual std::vector< Mantid::Kernel::TimeIntervalgetTimeIntervals () const
 If filtering by log, get the time intervals for splitting.
 
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
 
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.
 
bool isFiltered () const override
 
std::string isValid () const override
 This doesn't check anything -we assume these are always valid.
 
Types::Core::DateAndTime lastTime () const
 Returns the last time.
 
TYPE lastValue () const
 Returns the last value.
 
TYPE lastValue (const Kernel::TimeROI &roi) const
 Returns the last value in the TimeROI.
 
TimeROI makeFilterByValue (double min, double max, bool expand=false, const TimeInterval &expandRange=TimeInterval(0, 1), double TimeTolerance=0.0, bool centre=false, const TimeROI *existingROI=nullptr) const override
 Fill a SplittingIntervalVec that will filter the events by matching.
 
TimeROI makeFilterByValue (double, double, bool, const TimeInterval &, double, bool, const TimeROI *) const
 Function specialization for TimeSeriesProperty<std::string>
 
void makeFilterByValue (std::vector< SplittingInterval > &, double, double, double, bool) const
 Function specialization for TimeSeriesProperty<std::string>
 
void makeFilterByValue (std::vector< SplittingInterval > &split, double min, double max, double TimeTolerance=0.0, bool centre=false) const override
 Fill a SplittingIntervalVec that will filter the events by matching.
 
TYPE maxValue () const
 Returns the maximum value found in the series.
 
double mean () const
 Returns the mean value found in the series.
 
TimeSeriesProperty< TYPE > & merge (Property *rhs) override
 Merge the given property with this one.
 
TYPE minValue () const
 Returns the minimum value found in the series.
 
virtual TimeInterval nthInterval (int n) const
 Returns n-th valid time interval, in a very inefficient way.
 
virtual Types::Core::DateAndTime nthTime (int n) const
 Returns n-th time. NOTE: Complexity is order(n)! regardless of filter.
 
virtual TYPE nthValue (int n) const
 Returns n-th value of n-th interval in an incredibly inefficient way.
 
virtual bool operator!= (const Property &right) const
 Deep comparison (not equal).
 
virtual bool operator!= (const TimeSeriesProperty< TYPE > &right) const
 Deep comparison (not equal).
 
TimeSeriesPropertyoperator+= (Property const *right) override
 Add the value of another property.
 
virtual bool operator== (const Property &right) const
 Deep comparison.
 
virtual bool operator== (const TimeSeriesProperty< TYPE > &right) const
 Deep comparison.
 
int realSize () const override
 Returns the real size of the time series property map:
 
void removeDataOutsideTimeROI (const TimeROI &timeRoi) override
 Remove time values outside of TimeROI regions each defined as [roi_begin,roi_end].
 
void replaceValues (const std::vector< Types::Core::DateAndTime > &times, const std::vector< TYPE > &values)
 Replaces the time series with new values time series values.
 
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.
 
void saveProperty (Nexus::File *file)
 Helper function to save a TimeSeriesProperty<>
 
void saveProperty (Nexus::File *file)
 Helper function to save a TimeSeriesProperty<bool> At the time of writing NeXus does not support boolean directly.
 
void saveProperty (Nexus::File *file) override
 
std::string setDataItem (const std::shared_ptr< DataItem > &) override
 Set a property from a DataItem.
 
void setName (const std::string &name)
 Set name of property.
 
std::string setValue (const std::string &) override
 Set a property from a string.
 
std::string setValueFromJson (const Json::Value &) override
 Set a property from a string.
 
int size () const override
 Returns the number of values at UNIQUE time intervals in the time series.
 
std::vector< std::string > time_tValue () const
 New method to return time series value pairs as std::vector<std::string>
 
double timeAverageValue (const TimeROI *) const
 Returns the calculated time weighted average value.
 
double timeAverageValue (const TimeROI *timeRoi=nullptr) const override
 Returns the calculated time weighted average value.
 
std::pair< double, double > timeAverageValueAndStdDev (const Kernel::TimeROI *) const
 Function specialization for timeAverageValueAndStdDev<std::string>
 
std::pair< double, double > timeAverageValueAndStdDev (const Kernel::TimeROI *timeRoi=nullptr) const override
 Returns the calculated time weighted mean and standard deviation values.
 
std::vector< Types::Core::DateAndTime > timesAsVector () const override
 Return the time series's times as a vector<DateAndTime>
 
std::vector< double > timesAsVectorSeconds () const
 Return the series as list of times, where the time is the number of seconds since the start.
 
std::vector< double > timesAsVectorSeconds (Types::Core::DateAndTime start) const
 Return the series as list of times, where the time is the number of seconds since the start.
 
 TimeSeriesProperty (const std::string &name)
 Constructor.
 
 TimeSeriesProperty (const std::string &name, const std::vector< Types::Core::DateAndTime > &times, const std::vector< TYPE > &values)
 Constructor.
 
std::string toString () const
 Stringize the property.
 
std::string value () const override
 Get the time series property as a string of 'time value'.
 
std::map< Types::Core::DateAndTime, TYPEvalueAsCorrectMap () const
 Return the time series as a correct C++ map<DateAndTime, TYPE>.
 
Json::Value valueAsJson () const override
 
std::map< Types::Core::DateAndTime, TYPEvalueAsMap () const
 Return the time series as a C++ map<DateAndTime, TYPE>
 
std::multimap< Types::Core::DateAndTime, TYPEvalueAsMultiMap () const
 Return the time series as a correct C++ multimap<DateAndTime, TYPE>.
 
std::vector< TYPEvaluesAsVector () const
 Return the time series's values (unfiltered) as a vector<TYPE>
 
 ~TimeSeriesProperty () override
 Virtual destructor.
 
- 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.
 
bool autoTrim () const
 Returns if the property is set to automatically trim string unput values of whitespace.
 
void clearSettings ()
 Deletes the PropertySettings object contained.
 
virtual const PropertyHistory createHistory () const
 Create a PropertyHistory object representing the current state of the Property.
 
void createTemporaryValue ()
 Create a temporary value for this property.
 
unsigned int direction () const
 returns the direction of the property
 
bool disableReplaceWSButton () const
 Returns if the property is set to disable the creation of the "Replace Workspace" button.
 
const std::string & documentation () const
 Get the property's documentation string.
 
const std::string & getGroup ()
 
IPropertySettingsgetSettings ()
 
const IPropertySettingsgetSettings () const
 
bool hasTemporaryValue () const
 Property is using a temporary value for this property.
 
bool isDynamicDefault () const
 Returns a flag indicating that the property's value has been set programmatically, for example, if the property has a default value which depends on the value of an upstream property.
 
virtual bool isMultipleSelectionAllowed ()
 Is Multiple Selection Allowed.
 
virtual bool isValueSerializable () const
 Whether the string returned by value() can be used for serialization.
 
const std::string & name () const
 Get the property's name.
 
bool remember () const
 Whether to save input values.
 
void setAutoTrim (const bool &setting)
 Sets if the property is set to automatically trim string unput values of whitespace.
 
void setDisableReplaceWSButton (const bool &disable)
 Sets the property to disable the creation of the "Replace Workspace" button.
 
void setDocumentation (const std::string &documentation)
 Sets the user level description of the property.
 
void setGroup (const std::string &group)
 Set the group this property belongs to.
 
void setIsDynamicDefault (const bool &flag)
 Set or clear the flag indicating whether or not the property's value has been set programmatically.
 
void setName (const std::string &name)
 Set the property's name.
 
void setRemember (bool)
 Set wheter to remeber this property input.
 
void setSettings (std::unique_ptr< IPropertySettings > settings)
 Set the PropertySettings object.
 
virtual void setUnits (const std::string &unit)
 Sets the units of the property, as a string.
 
const std::string type () const
 Returns the type of the property as a string.
 
const std::type_info * type_info () const
 Get the property type_info.
 
virtual const std::string & units () const
 Returns the units of the property, if any, as a string.
 
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.
 
virtual ~Property ()
 Virtual destructor.
 
- Public Member Functions inherited from Mantid::Kernel::ITimeSeriesProperty
virtual ~ITimeSeriesProperty ()=default
 Virtual destructor.
 

Static Public Member Functions

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

Protected Member Functions

int findIndex (Types::Core::DateAndTime t) const
 Find the index of the entry of time t in the mP vector (sorted)
 
Types::Core::DateAndTime getFakeEndTime () const
 Returns an end time that will have the same spacing to the right of the last value as the last non-zero time does to the left.
 
void saveTimeVector (Nexus::File *file)
 Saves the time vector has time + start attribute.
 
std::string setValueFromProperty (const Property &right) override
 Set a value from another property.
 
void sortIfNecessary () const
 Sort the property into increasing times, if not already sorted.
 
int upperBound (Types::Core::DateAndTime t, int istart, int iend) const
 Find the upper_bound of time t in container.
 
- Protected Member Functions inherited from Mantid::Kernel::Property
 Property (const Property &right)
 Copy constructor.
 
 Property (std::string name, const std::type_info &type, const unsigned int &direction=Direction::Input)
 Constructor.
 

Protected Attributes

TimeSeriesSortStatus m_propSortedFlag
 Flag to state whether mP is sorted or not.
 
int m_size
 The number of values (or time intervals) in the time series.
 
std::vector< TimeValueUnit< TYPE > > m_values
 Holds the time series data.
 
- Protected Attributes inherited from Mantid::Kernel::Property
std::string m_name
 The name of the property.
 

Private Member Functions

std::pair< double, double > averageAndStdDevInFilter (const std::vector< TimeInterval > &) const
 Function specialization for TimeSeriesProperty<std::string>
 
std::pair< double, double > averageAndStdDevInFilter (const std::vector< TimeInterval > &intervals) const
 Calculate the time-weighted average and std-deviation of a property in a filtered range.
 
double averageValueInFilter (const std::vector< TimeInterval > &) const
 Function specialization for TimeSeriesProperty<std::string>
 
double averageValueInFilter (const std::vector< TimeInterval > &filter) const
 Calculate the time-weighted average of a property in a filtered range.
 
void createFilteredData (const TimeROI &timeROI, std::vector< TimeValueUnit< TYPE > > &filteredData) const
 Fill in the supplied vector of time series data according to the input TimeROI.
 
 TimeSeriesProperty (const Property *const p)
 Construct a TimeSeriesProperty object with the base class data only.
 

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 137 of file TimeSeriesProperty.h.

Constructor & Destructor Documentation

◆ TimeSeriesProperty() [1/3]

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 50 of file TimeSeriesProperty.cpp.

◆ TimeSeriesProperty() [2/3]

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 60 of file TimeSeriesProperty.cpp.

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

◆ ~TimeSeriesProperty()

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

Virtual destructor.

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

◆ TimeSeriesProperty() [3/3]

template<typename TYPE >
Mantid::Kernel::TimeSeriesProperty< TYPE >::TimeSeriesProperty ( const Property *const  p)
private

Construct a TimeSeriesProperty object with the base class data only.

Construct a TimeSeriesProperty object with the base class data only, no time series data.

Parameters
p:: a pointer to a base class object.

Definition at line 82 of file TimeSeriesProperty.cpp.

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

Definition at line 1125 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

Definition at line 1134 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 1146 of file TimeSeriesProperty.cpp.

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

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

◆ averageAndStdDevInFilter() [1/2]

std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< std::string >::averageAndStdDevInFilter ( const std::vector< TimeInterval > &  ) const
private

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Definition at line 854 of file TimeSeriesProperty.cpp.

◆ averageAndStdDevInFilter() [2/2]

template<typename TYPE >
std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< TYPE >::averageAndStdDevInFilter ( const std::vector< TimeInterval > &  intervals) const
private

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

Definition at line 803 of file TimeSeriesProperty.cpp.

References index.

◆ averageValueInFilter() [1/2]

double Mantid::Kernel::TimeSeriesProperty< std::string >::averageValueInFilter ( const std::vector< TimeInterval > &  ) const
private

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Definition at line 795 of file TimeSeriesProperty.cpp.

◆ averageValueInFilter() [2/2]

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

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.

Definition at line 744 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::getStatistics(), index, and Mantid::Kernel::Math::Mean.

◆ 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 1430 of file TimeSeriesProperty.cpp.

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

◆ 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 1445 of file TimeSeriesProperty.cpp.

References m_size.

◆ clone()

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

◆ cloneInTimeROI()

template<typename TYPE >
Property * Mantid::Kernel::TimeSeriesProperty< TYPE >::cloneInTimeROI ( const TimeROI timeROI) const
overridevirtual

Create a partial copy according to TimeROI.

Create a partial copy of this object according to a TimeROI.

The partially cloned object should include all time values enclosed by the ROI regions, each defined as [roi_begin,roi_end], plus the values immediately before and after an ROI region, if available.

Parameters
timeROI:: time region of interest, i.e. time boundaries used to determine which values should be included in the copy.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 92 of file TimeSeriesProperty.cpp.

◆ 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 106 of file TimeSeriesProperty.cpp.

◆ countSize()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::countSize ( ) const

Updates size()

Definition at line 1747 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 the parameters.

It is extremely similar to the other TSP::create with specialized conversion.

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 1504 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 the parameters.

It is extremely similar to the other TSP::create with specialized conversion.

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 1465 of file TimeSeriesProperty.cpp.

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

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

◆ createFilteredData()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::createFilteredData ( const TimeROI timeROI,
std::vector< TimeValueUnit< TYPE > > &  filteredData 
) const
private

Fill in the supplied vector of time series data according to the input TimeROI.

Include all time values within ROI regions, defined as [roi_begin,roi_end], plus the values immediately before and after each ROI region, if available.

Parameters
timeROI:: time region of interest, i.e. time boundaries used to determine which values should be included in the filtered data vector
filteredData:: (output) a vector of TimeValueUnit pairs to be filled in

Definition at line 288 of file TimeSeriesProperty.cpp.

◆ durationInSeconds()

template<typename TYPE >
double Mantid::Kernel::TimeSeriesProperty< TYPE >::durationInSeconds ( const Kernel::TimeROI roi = nullptr) const

Returns the duration of the time series, possibly restricted by a TimeROI object.

Returns duration of the time series, possibly restricted by a TimeROI object.

If no TimeROI is provided or the TimeROI is empty, the whole span of the time series plus and additional extra time is returned. This extra time is the time span between the last two log entries. The extra time ensures that the mean and the time-weighted mean are the same for time series containing log entries equally spaced in time.

Parameters
roi:: TimeROI object defining the time segments to consider.
Returns
duration, in seconds.

Definition at line 1279 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeROI::addMask(), Mantid::Kernel::TimeROI::durationInSeconds(), getTimeIntervals(), and Mantid::Kernel::TimeROI::useAll().

◆ 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 1879 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::DateAndTimeHelpers::g_log, m_size, name, and Mantid::Kernel::Logger::notice().

Referenced by Mantid::Kernel::TimeROI::replaceROI(), and 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 698 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 649 of file TimeSeriesProperty.cpp.

References Mantid::EMPTY_DBL(), Mantid::Geometry::split(), Mantid::Kernel::TimeInterval::start(), and Mantid::Kernel::TimeInterval::stop().

◆ extractStatistic() [1/2]

double Mantid::Kernel::TimeSeriesProperty< std::string >::extractStatistic ( Math::StatisticType  selection,
const TimeROI roi 
) const
virtual

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 1867 of file TimeSeriesProperty.cpp.

References UNUSED_ARG.

◆ extractStatistic() [2/2]

template<typename TYPE >
double Mantid::Kernel::TimeSeriesProperty< TYPE >::extractStatistic ( Math::StatisticType  selection,
const TimeROI roi = nullptr 
) const
overridevirtual

Calculate a particular statistical quantity from the values of the time series.

Parameters
selection: Enum indicating the selected statistical quantity.
roi: optional pointer to TimeROI object for filtering the time series values.
Returns
The value of the computed statistical quantity.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 1820 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::getStatistics(), Mantid::Kernel::Statistics::maximum, Mantid::Kernel::Statistics::mean, Mantid::Kernel::Statistics::median, Mantid::Kernel::Statistics::minimum, Mantid::Kernel::Statistics::standard_deviation, and Mantid::Kernel::TimeROI::useAll().

Referenced by Mantid::Geometry::XMLInstrumentParameter::createParamValue().

◆ filteredTimesAsVector() [1/2]

template<typename TYPE >
std::vector< DateAndTime > Mantid::Kernel::TimeSeriesProperty< TYPE >::filteredTimesAsVector ( ) const
virtual

◆ filteredTimesAsVector() [2/2]

template<typename TYPE >
std::vector< DateAndTime > Mantid::Kernel::TimeSeriesProperty< TYPE >::filteredTimesAsVector ( const Kernel::TimeROI roi) const
virtual

Get filtered times as a vector.

A view of the times as seen within a the TimeROI's regions.

A values will be excluded if its times lie outside the ROI's regions or coincides with the upper boundary of a ROI region. For instance, time "2007-11-30T16:17:30" is excluded in the ROI ["2007-11-30T16:17:00", "2007-11-30T16:17:30"). However, a value at time "2007-11-30T16:16:00" will be included with a time of "2007-11-30T16:17:00" because that is when the ROI starts.

Parameters
roi:: ROI regions validating any query time.
Returns
A vector of DateAndTime objects

Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.

Definition at line 979 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeROI::firstTime(), Mantid::Kernel::TimeROI::toTimeIntervals(), and Mantid::Kernel::TimeROI::useAll().

◆ filteredValuesAsVector() [1/2]

template<typename TYPE >
std::vector< TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::filteredValuesAsVector ( ) const
virtual

◆ filteredValuesAsVector() [2/2]

template<typename TYPE >
std::vector< TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::filteredValuesAsVector ( const Kernel::TimeROI roi) const
virtual

Get filtered values as a vector.

A view of the times as seen within a the TimeROI's regions.

A values will be excluded if its times lie outside the ROI's regions or coincides with the upper boundary of a ROI region. For instance, time "2007-11-30T16:17:30" is excluded in the ROI ["2007-11-30T16:17:00", "2007-11-30T16:17:30"). However, a value at time "2007-11-30T16:16:00" will be included because it is valid at the beginning of the TimeROI.

Parameters
roi:: ROI regions validating any query time.
Returns
:: Vector of included values only.

Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.

Definition at line 2170 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeROI::firstTime(), Mantid::Kernel::TimeROI::toTimeIntervals(), Mantid::Kernel::TimeROI::useAll(), and value.

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

◆ findIndex()

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

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 1946 of file TimeSeriesProperty.cpp.

References value.

◆ firstTime()

template<typename TYPE >
DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::firstTime ( ) const

◆ firstValue() [1/2]

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::firstValue ( ) const

Returns the first value regardless of filter.

Returns
Value

Definition at line 1189 of file TimeSeriesProperty.cpp.

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

Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::timeAverageValue().

◆ firstValue() [2/2]

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::firstValue ( const Kernel::TimeROI roi) const

Returns the first value in the TimeROI.

Definition at line 1201 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeROI::firstTime(), and index.

◆ getDefault()

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

Returns the default value.

Implements Mantid::Kernel::Property.

Definition at line 1771 of file TimeSeriesProperty.cpp.

◆ getDerivative() [1/2]

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

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 129 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 158 of file TimeSeriesProperty.cpp.

◆ getFakeEndTime()

template<typename TYPE >
Types::Core::DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::getFakeEndTime ( ) const
protected

Returns an end time that will have the same spacing to the right of the last value as the last non-zero time does to the left.

Definition at line 1673 of file TimeSeriesProperty.cpp.

◆ getMemorySize()

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

Return the memory used by the property, in bytes.

Reimplemented from Mantid::Kernel::Property.

Definition at line 165 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 1538 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, index, name, 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 1585 of file TimeSeriesProperty.cpp.

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

◆ getStatistics() [1/2]

template<typename TYPE >
TimeSeriesPropertyStatistics Mantid::Kernel::TimeSeriesProperty< TYPE >::getStatistics ( const Kernel::TimeROI roi = nullptr) const
overridevirtual

◆ getStatistics() [2/2]

TimeSeriesPropertyStatistics Mantid::Kernel::TimeSeriesProperty< std::string >::getStatistics ( const TimeROI roi) const
virtual

◆ getTimeIntervals()

template<typename TYPE >
std::vector< TimeInterval > Mantid::Kernel::TimeSeriesProperty< TYPE >::getTimeIntervals ( ) const
virtual

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

Splitting interval for the whole time series.

The interval's starting time is that of the first log entry. The interval's ending time is that of the last log entry plus an additional extra time. This extra time is the time span between the last two log entries. The extra time ensures that the mean and the time-weighted mean are the same for time series containing log entries equally spaced in time.

Returns
:: Vector containing a single splitting interval.

Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.

Definition at line 2243 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::getTimeIntervals().

◆ 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 2127 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 2151 of file TimeSeriesProperty.cpp.

References UNUSED_ARG.

◆ isDefault()

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

Returns if the value is at the default.

A TimeSeriesProperty never has a default.

Implements Mantid::Kernel::Property.

Definition at line 1778 of file TimeSeriesProperty.cpp.

◆ isFiltered()

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

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 314 of file TimeSeriesProperty.h.

◆ 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 1756 of file TimeSeriesProperty.cpp.

◆ isValid()

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

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

Returns
an empty string ""

Reimplemented from Mantid::Kernel::Property.

Definition at line 1765 of file TimeSeriesProperty.cpp.

◆ lastTime()

template<typename TYPE >
DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime ( ) const

◆ lastValue() [1/2]

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::lastValue ( ) const

◆ lastValue() [2/2]

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::lastValue ( const Kernel::TimeROI roi) const

Returns the last value in the TimeROI.

Definition at line 1251 of file TimeSeriesProperty.cpp.

References index, and Mantid::Kernel::TimeROI::lastTime().

◆ makeFilterByValue() [1/4]

template<typename TYPE >
TimeROI Mantid::Kernel::TimeSeriesProperty< TYPE >::makeFilterByValue ( double  min,
double  max,
bool  expand = false,
const TimeInterval expandRange = TimeInterval(0, 1),
double  TimeTolerance = 0.0,
bool  centre = false,
const TimeROI existingROI = nullptr 
) const
overridevirtual

Fill a SplittingIntervalVec that will filter the events by matching.

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

Creates TimeROI where times match the log values This method is only used by FilterByLogValue and SumEventsByLogValue

Parameters
min:: min value
max:: max value
expand:: bool to expand ROI to the expanded Range
expandRange:: TimeInterval for the expanded ROI
TimeTolerance:: offset added to times in seconds (default: 0)
centre:: Whether the log value time is considered centred or at the beginning (the default).
existingROI:: Optional TimeROI to be intersected with created TimeROI
Returns
The effective TimeROI

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 538 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::TimeROI::addROI(), Mantid::EMPTY_DBL(), Mantid::Kernel::TimeInterval::start(), Mantid::Kernel::TimeInterval::stop(), Mantid::Kernel::TimeROI::update_intersection(), Mantid::Kernel::TimeROI::USE_NONE, and Mantid::Kernel::TimeROI::useAll().

◆ makeFilterByValue() [2/4]

TimeROI Mantid::Kernel::TimeSeriesProperty< std::string >::makeFilterByValue ( double  ,
double  ,
bool  ,
const TimeInterval ,
double  ,
bool  ,
const TimeROI  
) const
virtual

Function specialization for TimeSeriesProperty<std::string>

Exceptions
Kernel::Exception::NotImplementedErroralways

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 629 of file TimeSeriesProperty.cpp.

◆ makeFilterByValue() [3/4]

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 513 of file TimeSeriesProperty.cpp.

◆ makeFilterByValue() [4/4]

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 SplittingIntervalVec that will filter the events by matching.

Fill a SplittingIntervalVec 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 433 of file TimeSeriesProperty.cpp.

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

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

◆ maxValue()

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::maxValue ( ) const

◆ mean()

template<typename TYPE >
double Mantid::Kernel::TimeSeriesProperty< TYPE >::mean ( ) const

Returns the mean value found in the series.

Definition at line 1307 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 175 of file TimeSeriesProperty.cpp.

◆ minValue()

template<typename TYPE >
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::minValue ( ) const

◆ nthInterval()

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

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

Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.

Definition at line 1638 of file TimeSeriesProperty.cpp.

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

Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::nthInterval().

◆ nthTime()

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

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

Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.

Definition at line 1729 of file TimeSeriesProperty.cpp.

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

Referenced by Mantid::Algorithms::GenerateEventsFilter::findRunEnd(), 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
virtual

◆ 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 270 of file TimeSeriesProperty.cpp.

References right.

◆ 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 261 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 184 of file TimeSeriesProperty.cpp.

◆ 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.

Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.

Definition at line 249 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 213 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::operator==().

◆ realSize()

template<typename TYPE >
int Mantid::Kernel::TimeSeriesProperty< TYPE >::realSize ( ) const
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 1321 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::Algorithms::SumEventsByLogValue::filterEventList(), Mantid::API::LogManager::getFirstPulseTime(), Mantid::API::LogManager::getLastPulseTime(), and Mantid::API::LogManager::hasValidProtonChargeLog().

◆ removeDataOutsideTimeROI()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::removeDataOutsideTimeROI ( const TimeROI timeROI)
overridevirtual

Remove time values outside of TimeROI regions each defined as [roi_begin,roi_end].

However, keep the values immediately before and after each ROI region, if available.

Parameters
timeROI:: a series of time regions used to determine which values to remove or to keep

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 392 of file TimeSeriesProperty.cpp.

References m_size.

◆ 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 1164 of file TimeSeriesProperty.cpp.

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

◆ 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 349 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 2052 of file TimeSeriesProperty.cpp.

References NXnumtype::CHAR, index, and name.

◆ 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 2085 of file TimeSeriesProperty.cpp.

References name, and 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 2097 of file TimeSeriesProperty.cpp.

References name.

Referenced by Mantid::Kernel::TimeROI::saveNexus().

◆ saveTimeVector()

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

Saves the time vector has time + start attribute.

Definition at line 2038 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 1422 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 277 of file TimeSeriesProperty.cpp.

References name.

◆ 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 1400 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 1411 of file TimeSeriesProperty.cpp.

◆ setValueFromProperty()

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

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 2022 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 ( ) const
overridevirtual

◆ sortIfNecessary()

template<typename TYPE >
void Mantid::Kernel::TimeSeriesProperty< TYPE >::sortIfNecessary ( ) const
protected

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

Definition at line 1923 of file TimeSeriesProperty.cpp.

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

◆ time_tValue()

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

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 1350 of file TimeSeriesProperty.cpp.

◆ timeAverageValue() [1/2]

double Mantid::Kernel::TimeSeriesProperty< std::string >::timeAverageValue ( const TimeROI timeRoi) const
virtual

Returns the calculated time weighted average value.

Parameters
timeRoiObject that holds information about when the time measurement was active.
Returns
The time-weighted average value of the log when the time measurement was active.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 733 of file TimeSeriesProperty.cpp.

◆ timeAverageValue() [2/2]

template<typename TYPE >
double Mantid::Kernel::TimeSeriesProperty< TYPE >::timeAverageValue ( const TimeROI timeRoi = nullptr) const
overridevirtual

Returns the calculated time weighted average value.

Parameters
timeRoiObject that holds information about when the time measurement was active.
Returns
The time-weighted average value of the log when the time measurement was active.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 709 of file TimeSeriesProperty.cpp.

References Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::getStatistics(), getTimeIntervals(), Mantid::Kernel::Math::Mean, Mantid::Kernel::TimeROI::toTimeIntervals(), Mantid::Kernel::TimeROI::useAll(), Mantid::Kernel::TimeROI::useNone(), and Mantid::Kernel::Logger::warning().

Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::timeAverageValue().

◆ timeAverageValueAndStdDev() [1/2]

std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< std::string >::timeAverageValueAndStdDev ( const Kernel::TimeROI ) const
virtual

Function specialization for timeAverageValueAndStdDev<std::string>

Returns
pair (Nan, Nan) always.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 885 of file TimeSeriesProperty.cpp.

◆ timeAverageValueAndStdDev() [2/2]

template<typename TYPE >
std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< TYPE >::timeAverageValueAndStdDev ( const Kernel::TimeROI timeRoi = nullptr) const
overridevirtual

Returns the calculated time weighted mean and standard deviation values.

Parameters
timeRoiObject that holds information about when the time measurement was active.

Implements Mantid::Kernel::ITimeSeriesProperty.

Definition at line 861 of file TimeSeriesProperty.cpp.

References getTimeIntervals(), Mantid::Kernel::TimeROI::toTimeIntervals(), and Mantid::Kernel::TimeROI::useAll().

◆ timesAsVector()

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

◆ timesAsVectorSeconds() [1/2]

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

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 1050 of file TimeSeriesProperty.cpp.

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

◆ timesAsVectorSeconds() [2/2]

template<typename TYPE >
std::vector< double > Mantid::Kernel::TimeSeriesProperty< TYPE >::timesAsVectorSeconds ( Types::Core::DateAndTime  start) const

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

Parameters
startThe starting DateAndTime, from which the times in seconds are calculated
Returns
Return the series as list of times, where the time is the number of seconds since the start.

Definition at line 1074 of file TimeSeriesProperty.cpp.

◆ toString()

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

Stringize the property.

Definition at line 1906 of file TimeSeriesProperty.cpp.

◆ upperBound()

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

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 1980 of file TimeSeriesProperty.cpp.

References value.

◆ value()

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

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

Implements Mantid::Kernel::Property.

Definition at line 1327 of file TimeSeriesProperty.cpp.

◆ valueAsCorrectMap()

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

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 904 of file TimeSeriesProperty.cpp.

Referenced by Mantid::Algorithms::GetAllEi::findChopSpeedAndDelay().

◆ valueAsJson()

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

Implements Mantid::Kernel::Property.

Definition at line 2114 of file TimeSeriesProperty.cpp.

References value.

◆ valueAsMap()

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

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 1372 of file TimeSeriesProperty.cpp.

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

◆ valueAsMultiMap()

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

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 941 of file TimeSeriesProperty.cpp.

◆ valuesAsVector()

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

Member Data Documentation

◆ m_propSortedFlag

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

Flag to state whether mP is sorted or not.

Definition at line 388 of file TimeSeriesProperty.h.

◆ m_size

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

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

It can be different from m_propertySeries.size()

Definition at line 385 of file TimeSeriesProperty.h.

◆ m_values

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

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