Mantid
|
A specialised Property class for holding a series of time-value pairs. More...
#include <TimeSeriesProperty.h>
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 > ×, 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... | |
Property * | cloneWithTimeShift (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< TYPE > | filteredValuesAsVector () 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::SplittingInterval > | getSplittingIntervals () 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... | |
TimeSeriesProperty & | operator+= (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 > ×, 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 > ×, 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, TYPE > | valueAsCorrectMap () const |
Return the time series as a correct C++ map<DateAndTime, TYPE>. More... | |
Json::Value | valueAsJson () const override |
std::map< Types::Core::DateAndTime, TYPE > | valueAsMap () const |
Return the time series as a C++ map<DateAndTime, TYPE> More... | |
std::multimap< Types::Core::DateAndTime, TYPE > | valueAsMultiMap () const |
Return the time series as a correct C++ multimap<DateAndTime, TYPE>. More... | |
std::vector< TYPE > | valuesAsVector () 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 Property * | clone () 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 |
IPropertySettings * | getSettings () |
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 Property & | merge (Property *) |
Just returns the property (*this) unless overridden. More... | |
const std::string & | name () const |
Get the property's name. More... | |
virtual Property & | operator+= (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 Property * | cloneWithTimeShift (const double timeShift) const =0 |
virtual void | expandFilterToRange (std::vector< SplittingInterval > &split, double min, double max, const TimeInterval &range) const =0 |
Make sure an existing filter covers the full time range given. 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... | |
A specialised Property class for holding a series of time-value pairs.
Definition at line 94 of file TimeSeriesProperty.h.
|
explicit |
Constructor.
name | :: The name to assign to the property |
Definition at line 32 of file TimeSeriesProperty.cpp.
Mantid::Kernel::TimeSeriesProperty< TYPE >::TimeSeriesProperty | ( | const std::string & | name, |
const std::vector< Types::Core::DateAndTime > & | times, | ||
const std::vector< TYPE > & | values | ||
) |
Constructor.
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().
|
overridedefault |
Virtual destructor.
References Mantid::DataObjects::create(), std::operator!=(), Mantid::API::operator+=(), and std::operator==().
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.
time | :: The time as a string in the format: (ISO 8601) yyyy-mm-ddThh:mm:ss |
value | :: The associated value |
Definition at line 1086 of file TimeSeriesProperty.cpp.
References value.
void Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue | ( | const std::time_t & | time, |
const TYPE & | value | ||
) |
Add a value to the map using a time_t.
time | :: The time as a time_t value |
value | :: The associated value |
Definition at line 1096 of file TimeSeriesProperty.cpp.
References value.
void Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue | ( | const Types::Core::DateAndTime & | time, |
const TYPE & | value | ||
) |
Add a value to the map using a DateAndTime object.
Add a value to the series.
Added values need not be sequential in time.
time | The time |
value | The associated value |
Definition at line 1056 of file TimeSeriesProperty.cpp.
References m_size, Mantid::Kernel::TSSORTED, Mantid::Kernel::TSUNKNOWN, Mantid::Kernel::TSUNSORTED, and value.
Referenced by WorkspaceCreationHelper::addTSPEntry(), Mantid::Kernel::LogParser::createPeriodLog(), Mantid::API::LogFilterGenerator::filterByStatus(), Mantid::Algorithms::FilterEvents::generateSplitterTSP(), Mantid::MDAlgorithms::ConvertSpiceDataToRealSpace::loadRunToMatrixWS(), Mantid::Kernel::LogParser::LogParser(), Mantid::Algorithms::GenerateEventsFilter::setFilterByLogValue(), Mantid::DataHandling::LoadSpiceXML2DDet::setupSampleLogs(), Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTime(), Mantid::Kernel::LogParser::tryParsePeriod(), and Mantid::MDAlgorithms::LoadDNSSCD::updateProperties().
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.
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().
|
private |
Apply a filter.
Definition at line 2028 of file TimeSeriesProperty.cpp.
|
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.
std::pair< double, double > Mantid::Kernel::TimeSeriesProperty< std::string >::averageAndStdDevInFilter | ( | const TimeSplitterType & | ) | const |
Function specialization for TimeSeriesProperty<std::string>
Kernel::Exception::NotImplementedError | always |
Definition at line 921 of file TimeSeriesProperty.cpp.
|
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.
filter | The splitter/filter restricting the range of values included |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 812 of file TimeSeriesProperty.cpp.
double Mantid::Kernel::TimeSeriesProperty< std::string >::averageValueInFilter | ( | const TimeSplitterType & | ) | const |
Function specialization for TimeSeriesProperty<std::string>
Kernel::Exception::NotImplementedError | always |
Definition at line 856 of file TimeSeriesProperty.cpp.
|
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().
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.
|
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.
|
overridevirtual |
"Virtual" copy constructor
Implements Mantid::Kernel::Property.
Definition at line 56 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Kernel::LogFilter::addFilter(), Mantid::Algorithms::MergeLogs::exec(), Mantid::Kernel::LogFilter::LogFilter(), Mantid::Algorithms::CalculateCountRate::setOutLogParameters(), and Mantid::Algorithms::SumEventsByLogValue::sumProtonCharge().
|
overridevirtual |
"Virtual" copy constructor with a time shift in seconds
"Virutal copy constructor with a time shift
timeShift | :: a time shift in seconds |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 64 of file TimeSeriesProperty.cpp.
void Mantid::Kernel::TimeSeriesProperty< TYPE >::countSize |
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:
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.
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:
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().
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().
|
virtual |
Function specialization for TimeSeriesProperty<std::string>
Kernel::Exception::NotImplementedError | always |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 783 of file TimeSeriesProperty.cpp.
|
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.
split | The splitter to modify if necessary |
min | The minimum 'good' value |
max | The maximum 'good' value |
range | The 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().
|
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.
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.
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
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().
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>
Definition at line 1010 of file TimeSeriesProperty.cpp.
References value.
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.
Definition at line 2315 of file TimeSeriesProperty.cpp.
References value.
Referenced by Mantid::Algorithms::ConjoinXRuns::getXAxis().
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().
|
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.
|
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.
DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::firstTime |
Returns the first time regardless of filter.
Definition at line 1166 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, and Mantid::Kernel::DateAndTimeHelpers::g_log.
Referenced by Mantid::Algorithms::AverageLogData::exec(), Mantid::API::MatrixWorkspace::getFirstPulseTime(), Mantid::Algorithms::ChangeTimeZero::getStartTimeFromWorkspace(), Mantid::Algorithms::CalculateCountRate::setOutLogParameters(), and Mantid::Algorithms::FilterEvents::splitTimeSeriesProperty().
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::firstValue |
Returns the first value regardless of filter.
Definition at line 1151 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, and Mantid::Kernel::DateAndTimeHelpers::g_log.
Referenced by Mantid::Algorithms::FilterEvents::generateSplitterTSP(), and Mantid::Algorithms::FilterEvents::splitTimeSeriesProperty().
|
overridevirtual |
Returns the default value.
Implements Mantid::Kernel::Property.
Definition at line 1827 of file TimeSeriesProperty.cpp.
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().
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.
|
overridevirtual |
Return the memory used by the property, in bytes.
Reimplemented from Mantid::Kernel::Property.
Definition at line 123 of file TimeSeriesProperty.cpp.
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::getSingleValue | ( | const Types::Core::DateAndTime & | t | ) | const |
Returns the value at a particular time.
t | :: time |
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().
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::getSingleValue | ( | const Types::Core::DateAndTime & | t, |
int & | index | ||
) | const |
Returns the value at a particular time.
t | :: time |
index | :: index of time |
Definition at line 1460 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, index, and value.
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.
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.
TimeSeriesPropertyStatistics Mantid::Kernel::TimeSeriesProperty< TYPE >::getStatistics |
Return a TimeSeriesPropertyStatistics object.
Return a TimeSeriesPropertyStatistics struct containing the statistics of this TimeSeriesProperty object.
N.B. This method DOES take filtering into account
Definition at line 1842 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::TimeSeriesPropertyStatistics::duration, Mantid::Kernel::getStatistics(), Mantid::Kernel::Statistics::maximum, Mantid::Kernel::TimeSeriesPropertyStatistics::maximum, Mantid::Kernel::Statistics::mean, Mantid::Kernel::TimeSeriesPropertyStatistics::mean, Mantid::Kernel::Statistics::median, Mantid::Kernel::TimeSeriesPropertyStatistics::median, Mantid::Kernel::Statistics::minimum, Mantid::Kernel::TimeSeriesPropertyStatistics::minimum, Mantid::Kernel::Statistics::standard_deviation, Mantid::Kernel::TimeSeriesPropertyStatistics::standard_deviation, Mantid::Kernel::TimeSeriesPropertyStatistics::time_mean, and Mantid::Kernel::TimeSeriesPropertyStatistics::time_standard_deviation.
Referenced by Mantid::WorkflowAlgorithms::DgsConvertToEnergyTransfer::exec(), Mantid::Kernel::filterByStatistic(), Mantid::DataHandling::SaveGSS::getLogValue(), and Mantid::WorkflowAlgorithms::EQSANSLoad::getSourceSlitSize().
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.
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().
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.
|
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.
|
inline |
Definition at line 261 of file TimeSeriesProperty.h.
|
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.
time | :: [input] Time to check |
Definition at line 2343 of file TimeSeriesProperty.cpp.
|
static |
Check if str has the right time format.
str | :: The string to check |
Definition at line 1812 of file TimeSeriesProperty.cpp.
|
overridevirtual |
This doesn't check anything -we assume these are always valid.
Reimplemented from Mantid::Kernel::Property.
Definition at line 1821 of file TimeSeriesProperty.cpp.
DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime |
Returns the last time.
Definition at line 1136 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, and Mantid::Kernel::DateAndTimeHelpers::g_log.
Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::Algorithms::GenerateEventsFilter::findRunEnd(), Mantid::API::MatrixWorkspace::getLastPulseTime(), Mantid::Algorithms::GenerateEventsFilter::setFilterByLogValue(), Mantid::Algorithms::CalculateCountRate::setOutLogParameters(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTime().
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::lastValue |
Returns the last value.
Definition at line 1182 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, and Mantid::Kernel::DateAndTimeHelpers::g_log.
Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput().
|
virtual |
Function specialization for TimeSeriesProperty<std::string>
Kernel::Exception::NotImplementedError | always |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 719 of file TimeSeriesProperty.cpp.
|
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.
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().
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::maxValue |
Returns the maximum value found in the series.
Definition at line 1198 of file TimeSeriesProperty.cpp.
Referenced by Mantid::DataHandling::SaveOpenGenieAscii::calculateXYZDelta(), Mantid::Algorithms::SumEventsByLogValue::createBinnedOutput(), Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::Algorithms::GenerateEventsFilter::processMultipleValueFilters(), and Mantid::Algorithms::GenerateEventsFilter::setFilterByLogValue().
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.
|
overridevirtual |
Merge the given property with this one.
Just returns the property (*this) unless overridden.
rhs | a property that is merged in some descendent classes |
Reimplemented from Mantid::Kernel::Property.
Definition at line 133 of file TimeSeriesProperty.cpp.
References Mantid::API::operator+=(), and rhs.
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::minValue |
Returns the minimum value found in the series.
Definition at line 1194 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::SumEventsByLogValue::createBinnedOutput(), Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::MDAlgorithms::LoadDNSSCD::exec(), Mantid::Algorithms::GenerateEventsFilter::processMultipleValueFilters(), and Mantid::Algorithms::GenerateEventsFilter::setFilterByLogValue().
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
n | :: index |
Definition at line 1513 of file TimeSeriesProperty.cpp.
References Mantid::Geometry::d, Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, and n.
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
n | :: index |
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().
TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::nthValue | ( | int | n | ) | const |
Returns n-th value of n-th interval in an incredibly inefficient way.
The algorithm is migrated from mthInterval()
n | :: index |
Definition at line 1624 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, m_size, n, value, and Mantid::Kernel::TimeValueUnit< TYPE >::value().
Referenced by Mantid::Geometry::XMLInstrumentParameter::createParamValue(), Mantid::Algorithms::GenerateEventsFilter::determineChangingDirection(), Mantid::Kernel::filterByStatistic(), Mantid::Algorithms::GenerateEventsFilter::identifyLogEntry(), and Mantid::Algorithms::GenerateEventsFilter::makeMultipleFiltersByValuesPartialLog().
|
virtual |
Deep comparison (not equal).
right | The other property to compare to. |
Definition at line 228 of file TimeSeriesProperty.cpp.
|
virtual |
Deep comparison (not equal).
right | The other property to compare to. |
Definition at line 219 of file TimeSeriesProperty.cpp.
References right.
|
overridevirtual |
Add the value of another property.
right | the property to add |
Implements Mantid::Kernel::Property.
Definition at line 142 of file TimeSeriesProperty.cpp.
|
virtual |
Deep comparison.
right | The other property to compare to. |
Definition at line 207 of file TimeSeriesProperty.cpp.
|
virtual |
Deep comparison.
right | The other property to compare to. |
Definition at line 171 of file TimeSeriesProperty.cpp.
|
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().
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
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().
|
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.
|
virtual |
Helper function to save a TimeSeriesProperty<>
Reimplemented from Mantid::Kernel::Property.
Definition at line 2200 of file TimeSeriesProperty.cpp.
References index.
|
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.
|
overridevirtual |
Reimplemented from Mantid::Kernel::Property.
Definition at line 2245 of file TimeSeriesProperty.cpp.
References value.
|
private |
Saves the time vector has time + start attribute.
Definition at line 2186 of file TimeSeriesProperty.cpp.
|
overridevirtual |
Set a property from a DataItem.
Exception::NotImplementedError | Not yet implemented |
Implements Mantid::Kernel::Property.
Definition at line 1317 of file TimeSeriesProperty.cpp.
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.
|
overridevirtual |
Set a property from a string.
Set the property from a string value.
Throws a NotImplementedError
Exception::NotImplementedError | Not yet implemented |
Implements Mantid::Kernel::Property.
Definition at line 1295 of file TimeSeriesProperty.cpp.
|
overridevirtual |
Set a property from a string.
Set the property from a Json value.
Throws a NotImplementedError
Exception::NotImplementedError | Not yet implemented |
Implements Mantid::Kernel::Property.
Definition at line 1306 of file TimeSeriesProperty.cpp.
|
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
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.
|
overridevirtual |
Returns the number of values at UNIQUE time intervals in the time series.
Reimplemented from Mantid::Kernel::Property.
Definition at line 1210 of file TimeSeriesProperty.cpp.
References m_size.
Referenced by Mantid::Kernel::LogFilter::addFilter(), Mantid::Algorithms::ConjoinXRuns::checkLogEntry(), Mantid::Algorithms::GenerateEventsFilter::determineChangingDirection(), Mantid::Kernel::filterByStatistic(), Mantid::Kernel::TimeSeriesProperty< TYPE >::filterWith(), Mantid::Algorithms::GenerateEventsFilter::findRunEnd(), Mantid::Algorithms::FilterEvents::generateSplitterTSP(), Mantid::DataHandling::LoadSpiceXML2DDet::getHB3AWavelength(), Mantid::Algorithms::ChangeTimeZero::getStartTimeFromWorkspace(), Mantid::Algorithms::GenerateEventsFilter::identifyLogEntry(), Mantid::Kernel::LogParser::LogParser(), Mantid::Algorithms::AddLogDerivative::makeDerivative(), Mantid::Algorithms::GenerateEventsFilter::makeFilterBySingleValue(), Mantid::Algorithms::GenerateEventsFilter::makeMultipleFiltersByValues(), Mantid::Algorithms::GenerateEventsFilter::makeMultipleFiltersByValuesParallel(), Mantid::Algorithms::GenerateEventsFilter::makeMultipleFiltersByValuesPartialLog(), Mantid::Algorithms::GenerateEventsFilter::processIntegerValueFilter(), Mantid::Algorithms::GetTimeSeriesLogInformation::processTimeRange(), Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTime(), and Mantid::Algorithms::FilterEvents::splitTimeSeriesProperty().
|
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.
|
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.
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().
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().
std::vector< std::string > Mantid::Kernel::TimeSeriesProperty< TYPE >::time_tValue |
New method to return time series value pairs as std::vector<std::string>
Definition at line 1245 of file TimeSeriesProperty.cpp.
|
overridevirtual |
Returns the calculated time weighted average value.
Calculates the time-weighted average of a property.
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 793 of file TimeSeriesProperty.cpp.
|
private |
Time weighted mean and standard deviation.
Definition at line 862 of file TimeSeriesProperty.cpp.
|
overridevirtual |
Return the time series's times as a vector<DateAndTime>
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 993 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::GetTimeSeriesLogInformation::exec(), Mantid::Algorithms::MergeLogs::exec(), Mantid::DataHandling::LoadNexusLogs::execLoader(), Mantid::Kernel::TimeSeriesProperty< TYPE >::filterWith(), Mantid::Kernel::LogParser::LogParser(), Mantid::Algorithms::GenerateEventsFilter::processIntegerValueFilter(), and Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs().
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.
Definition at line 1034 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::AverageLogData::exec(), and Mantid::Algorithms::AddLogDerivative::makeDerivative().
std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::toString |
Stringize the property.
Definition at line 1911 of file TimeSeriesProperty.cpp.
|
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.
|
overridevirtual |
Get the time series property as a string of 'time value'.
Implements Mantid::Kernel::Property.
Definition at line 1222 of file TimeSeriesProperty.cpp.
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.
Definition at line 941 of file TimeSeriesProperty.cpp.
Referenced by Mantid::API::LogFilterGenerator::filterByStatus(), and Mantid::Algorithms::GetAllEi::findChopSpeedAndDelay().
|
overridevirtual |
Implements Mantid::Kernel::Property.
Definition at line 2262 of file TimeSeriesProperty.cpp.
References value.
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.
Definition at line 1267 of file TimeSeriesProperty.cpp.
References Mantid::Geometry::d, and value.
Referenced by Mantid::NeXus::NexusFileIO::writeNumericTimeLog().
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.
std::vector< TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::valuesAsVector |
Return the time series's values (unfiltered) as a vector<TYPE>
Return the time series's values as a vector<TYPE>
Definition at line 960 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::CalculateCountRate::calcRateLog(), Mantid::Algorithms::AverageLogData::exec(), Mantid::Algorithms::GetTimeSeriesLogInformation::exec(), Mantid::Algorithms::PDDetermineCharacterizations::exec(), Mantid::DataHandling::LoadNexusLogs::execLoader(), Mantid::Kernel::TimeSeriesProperty< TYPE >::filterWith(), Mantid::DataHandling::LoadSpiceXML2DDet::getHB3AWavelength(), Mantid::API::Run::integrateProtonCharge(), Mantid::Algorithms::AddLogDerivative::makeDerivative(), and Mantid::Algorithms::GenerateEventsFilter::processIntegerValueFilter().
|
mutableprivate |
The filter.
Definition at line 327 of file TimeSeriesProperty.h.
|
mutableprivate |
True if a filter has been applied.
Definition at line 331 of file TimeSeriesProperty.h.
|
mutableprivate |
Quick reference regions for filter.
Definition at line 329 of file TimeSeriesProperty.h.
|
mutableprivate |
Flag to state whether mP is sorted or not.
Definition at line 324 of file TimeSeriesProperty.h.
|
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().
|
mutableprivate |
Holds the time series data.
Definition at line 317 of file TimeSeriesProperty.h.
Referenced by Mantid::Kernel::TimeSeriesProperty< TYPE >::setValueFromProperty(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTime().