|
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. | |
| 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 > ×, 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 | |
| Property * | cloneInTimeROI (const TimeROI &timeROI) const override |
| Create a partial copy according to TimeROI. | |
| Property * | cloneWithTimeShift (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< TYPE > | filteredValuesAsVector () const |
| virtual std::vector< TYPE > | filteredValuesAsVector (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::TimeInterval > | getTimeIntervals () 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). | |
| TimeSeriesProperty & | operator+= (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 > ×, 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 > ×, 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, TYPE > | valueAsCorrectMap () const |
| Return the time series as a correct C++ map<DateAndTime, TYPE>. | |
| Json::Value | valueAsJson () const override |
| std::map< Types::Core::DateAndTime, TYPE > | valueAsMap () const |
| Return the time series as a C++ map<DateAndTime, TYPE> | |
| std::multimap< Types::Core::DateAndTime, TYPE > | valueAsMultiMap () const |
| Return the time series as a correct C++ multimap<DateAndTime, TYPE>. | |
| std::vector< TYPE > | valuesAsVector () 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 () |
| IPropertySettings * | getSettings () |
| const IPropertySettings * | getSettings () 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. | |
A specialised Property class for holding a series of time-value pairs.
Definition at line 137 of file TimeSeriesProperty.h.
|
explicit |
Constructor.
| name | :: The name to assign to the property |
Definition at line 50 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 60 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::TimeSeriesProperty< TYPE >::addValues().
|
overridedefault |
Virtual destructor.
References Mantid::DataObjects::create(), and Mantid::API::operator+=().
|
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.
| p | :: a pointer to a base class object. |
Definition at line 82 of file TimeSeriesProperty.cpp.
| 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 1125 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 1134 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 1096 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(), WorkspaceCreationHelper::createSNAPLiteInstrument(), Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::filterWith(), Mantid::DataHandling::LoadILLLagrange::loadMetaData(), Mantid::MDAlgorithms::ConvertSpiceDataToRealSpace::loadRunToMatrixWS(), Mantid::Kernel::LogParser::LogParser(), Mantid::Kernel::TimeROI::saveNexus(), Mantid::Algorithms::GenerateEventsFilter::setFilterByLogValue(), 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 1146 of file TimeSeriesProperty.cpp.
References m_size, and Mantid::Kernel::TSUNKNOWN.
Referenced by Mantid::DataHandling::LoadEventPreNexus2::setProtonCharge(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::TimeSeriesProperty().
|
private |
Function specialization for TimeSeriesProperty<std::string>
| Kernel::Exception::NotImplementedError | always |
Definition at line 854 of file TimeSeriesProperty.cpp.
|
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.
|
private |
Function specialization for TimeSeriesProperty<std::string>
| Kernel::Exception::NotImplementedError | always |
Definition at line 795 of file TimeSeriesProperty.cpp.
|
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.
| filter | The splitter/filter restricting the range of values included |
Definition at line 744 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::getStatistics(), index, and Mantid::Kernel::Math::Mean.
|
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.
|
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.
|
overridevirtual |
"Virtual" copy constructor
Implements Mantid::Kernel::Property.
Definition at line 73 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Kernel::LogFilter::addFilter(), Mantid::Kernel::LogParser::createRunningLog(), Mantid::Algorithms::MergeLogs::exec(), Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::filterWith(), and Mantid::Algorithms::CalculateCountRate::setOutLogParameters().
|
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.
| 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.
|
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 106 of file TimeSeriesProperty.cpp.
| void Mantid::Kernel::TimeSeriesProperty< TYPE >::countSize | ( | ) | const |
| 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.
| 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.
| 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.
| 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().
|
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.
| 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.
| 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.
| roi | :: TimeROI object defining the time segments to consider. |
Definition at line 1279 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::TimeROI::addMask(), Mantid::Kernel::TimeROI::durationInSeconds(), getTimeIntervals(), and Mantid::Kernel::TimeROI::useAll().
| 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().
|
virtual |
Function specialization for TimeSeriesProperty<std::string>
| Kernel::Exception::NotImplementedError | always |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 698 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 649 of file TimeSeriesProperty.cpp.
References Mantid::EMPTY_DBL(), Mantid::Geometry::split(), Mantid::Kernel::TimeInterval::start(), and Mantid::Kernel::TimeInterval::stop().
|
virtual |
Function specialization for TimeSeriesProperty<std::string>
| Kernel::Exception::NotImplementedError | always |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 1867 of file TimeSeriesProperty.cpp.
References UNUSED_ARG.
|
overridevirtual |
Calculate a particular statistical quantity from the values of the time series.
| selection | : Enum indicating the selected statistical quantity. |
| roi | : optional pointer to TimeROI object for filtering the time series values. |
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().
|
virtual |
Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.
Definition at line 1042 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::filteredTimesAsVector(), and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::filteredTimesAsVector().
|
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.
| roi | :: ROI regions validating any query time. |
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().
|
virtual |
Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.
Definition at line 2231 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::filteredValuesAsVector(), and Mantid::Kernel::FilteredTimeSeriesProperty< double >::intersectFilterWithOther().
|
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.
| roi | :: ROI regions validating any query time. |
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().
|
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.
| DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::firstTime | ( | ) | const |
Returns the first time regardless of filter.
Definition at line 1223 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, and name.
Referenced by Mantid::Kernel::LogFilter::addFilter(), Mantid::Algorithms::AverageLogData::exec(), Mantid::Algorithms::ChangeTimeZero::getStartTimeFromWorkspace(), Mantid::Kernel::TimeROI::replaceROI(), and Mantid::Algorithms::CalculateCountRate::setOutLogParameters().
| TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::firstValue | ( | ) | const |
Returns the first value regardless of filter.
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().
| 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.
|
overridevirtual |
Returns the default value.
Implements Mantid::Kernel::Property.
Definition at line 1771 of file TimeSeriesProperty.cpp.
| 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().
| 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.
|
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.
|
overridevirtual |
Return the memory used by the property, in bytes.
Reimplemented from Mantid::Kernel::Property.
Definition at line 165 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 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().
| 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 1585 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, index, name, and value.
|
overridevirtual |
Return a TimeSeriesPropertyStatistics object.
Return a TimeSeriesPropertyStatistics struct containing the statistics of this TimeSeriesProperty object.
| roi | : Optional TimeROI pointer to get statistics for active time. |
N.B. This method DOES take filtering into account
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 1788 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::TimeSeriesPropertyStatistics::duration, Mantid::Kernel::getStatistics(), Mantid::Kernel::TimeSeriesPropertyStatistics::mean, Mantid::Kernel::TimeSeriesPropertyStatistics::standard_deviation, Mantid::Kernel::TimeSeriesPropertyStatistics::time_mean, and Mantid::Kernel::TimeSeriesPropertyStatistics::time_standard_deviation.
Referenced by Mantid::WorkflowAlgorithms::DgsConvertToEnergyTransfer::exec(), Mantid::DataHandling::SaveGSS::getLogValue(), Mantid::WorkflowAlgorithms::EQSANSLoad::getSourceSlitSize(), and Mantid::MDAlgorithms::ApplyDetailedBalanceMD::getTemperature().
|
virtual |
Return a TimeSeriesPropertyStatistics object.
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 1806 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::TimeSeriesPropertyStatistics::setAllToNan().
|
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.
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().
| 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 2127 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 2151 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 1778 of file TimeSeriesProperty.cpp.
|
inlineoverridevirtual |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 314 of file TimeSeriesProperty.h.
|
static |
Check if str has the right time format.
| str | :: The string to check |
Definition at line 1756 of file TimeSeriesProperty.cpp.
|
overridevirtual |
This doesn't check anything -we assume these are always valid.
Reimplemented from Mantid::Kernel::Property.
Definition at line 1765 of file TimeSeriesProperty.cpp.
| DateAndTime Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime | ( | ) | const |
Returns the last time.
Definition at line 1174 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, and name.
Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::API::LogManager::getLastPulseTime(), Mantid::Kernel::TimeROI::replaceROI(), Mantid::Algorithms::GenerateEventsFilter::setFilterByLogValue(), and Mantid::Algorithms::CalculateCountRate::setOutLogParameters().
| TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::lastValue | ( | ) | const |
Returns the last value.
Definition at line 1239 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, and name.
Referenced by Mantid::Kernel::LogFilter::addFilter(), Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::filterWith(), and Mantid::Kernel::TimeROI::replaceROI().
| 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().
|
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
| 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 |
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().
|
virtual |
Function specialization for TimeSeriesProperty<std::string>
| Kernel::Exception::NotImplementedError | always |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 629 of file TimeSeriesProperty.cpp.
|
virtual |
Function specialization for TimeSeriesProperty<std::string>
| Kernel::Exception::NotImplementedError | always |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 513 of file TimeSeriesProperty.cpp.
|
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.
| 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().
| TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::maxValue | ( | ) | const |
Returns the maximum value found in the series.
Definition at line 1303 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 | ( | ) | 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.
|
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 175 of file TimeSeriesProperty.cpp.
| TYPE Mantid::Kernel::TimeSeriesProperty< TYPE >::minValue | ( | ) | const |
Returns the minimum value found in the series.
Definition at line 1299 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().
|
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
| n | :: index |
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().
|
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
| n | :: index |
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().
|
virtual |
Returns n-th value of n-th interval in an incredibly inefficient way.
The algorithm is migrated from mthInterval()
| n | :: index |
Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.
Definition at line 1698 of file TimeSeriesProperty.cpp.
References Mantid::Kernel::Logger::debug(), error, Mantid::Kernel::DateAndTimeHelpers::g_log, m_size, n, and name.
Referenced by Mantid::Geometry::XMLInstrumentParameter::createParamValue(), Mantid::Algorithms::GenerateEventsFilter::determineChangingDirection(), Mantid::Algorithms::GenerateEventsFilter::identifyLogEntry(), Mantid::Algorithms::GenerateEventsFilter::makeMultipleFiltersByValuesPartialLog(), and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::nthValue().
|
virtual |
Deep comparison (not equal).
| right | The other property to compare to. |
Definition at line 270 of file TimeSeriesProperty.cpp.
References right.
|
virtual |
Deep comparison (not equal).
| right | The other property to compare to. |
Definition at line 261 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 184 of file TimeSeriesProperty.cpp.
|
virtual |
Deep comparison.
| right | The other property to compare to. |
Reimplemented in Mantid::Kernel::FilteredTimeSeriesProperty< double >, and Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >.
Definition at line 249 of file TimeSeriesProperty.cpp.
|
virtual |
Deep comparison.
| right | The other property to compare to. |
Definition at line 213 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::operator==().
|
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().
|
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.
| 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.
| 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 1164 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::CalculateCountRate::calcRateLog().
|
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.
|
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.
|
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.
|
overridevirtual |
Reimplemented from Mantid::Kernel::Property.
Definition at line 2097 of file TimeSeriesProperty.cpp.
References name.
Referenced by Mantid::Kernel::TimeROI::saveNexus().
|
protected |
Saves the time vector has time + start attribute.
Definition at line 2038 of file TimeSeriesProperty.cpp.
|
overridevirtual |
Set a property from a DataItem.
| Exception::NotImplementedError | Not yet implemented |
Implements Mantid::Kernel::Property.
Definition at line 1422 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 277 of file TimeSeriesProperty.cpp.
References name.
|
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 1400 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 1411 of file TimeSeriesProperty.cpp.
|
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
| 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.
|
overridevirtual |
Returns the number of values at UNIQUE time intervals in the time series.
Reimplemented from Mantid::Kernel::Property.
Definition at line 1315 of file TimeSeriesProperty.cpp.
References m_size.
Referenced by Mantid::Kernel::LogFilter::addFilter(), Mantid::Algorithms::ConjoinXRuns::checkLogEntry(), Mantid::Algorithms::GenerateEventsFilter::determineChangingDirection(), Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::filterWith(), Mantid::Algorithms::GenerateEventsFilter::findRunEnd(), Mantid::Algorithms::ChangeTimeZero::getStartTimeFromWorkspace(), Mantid::Algorithms::ConjoinXRuns::getXAxis(), Mantid::Algorithms::GenerateEventsFilter::identifyLogEntry(), 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::TimeROI::replaceROI(), and Mantid::Algorithms::CalculateCountRate::setOutLogParameters().
|
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.
| std::vector< std::string > Mantid::Kernel::TimeSeriesProperty< TYPE >::time_tValue | ( | ) | const |
New method to return time series value pairs as std::vector<std::string>
Definition at line 1350 of file TimeSeriesProperty.cpp.
|
virtual |
Returns the calculated time weighted average value.
| timeRoi | Object that holds information about when the time measurement was active. |
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 733 of file TimeSeriesProperty.cpp.
|
overridevirtual |
Returns the calculated time weighted average value.
| timeRoi | Object that holds information about 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().
|
virtual |
Function specialization for timeAverageValueAndStdDev<std::string>
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 885 of file TimeSeriesProperty.cpp.
|
overridevirtual |
Returns the calculated time weighted mean and standard deviation values.
| timeRoi | Object 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().
|
overridevirtual |
Return the time series's times as a vector<DateAndTime>
Implements Mantid::Kernel::ITimeSeriesProperty.
Definition at line 956 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::GetTimeSeriesLogInformation::exec(), Mantid::Algorithms::MergeLogs::exec(), Mantid::DataHandling::LoadNexusLogs::execLoader(), Mantid::API::LogManager::getFirstPulseTime(), Mantid::API::Run::integrateProtonCharge(), Mantid::Algorithms::GenerateEventsFilter::processIntegerValueFilter(), Mantid::Kernel::TimeROI::replaceROI(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), and Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs().
| 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.
Definition at line 1050 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::AddLogInterpolated::exec(), Mantid::Algorithms::AverageLogData::exec(), and Mantid::Algorithms::AddLogDerivative::makeDerivative().
| 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.
| start | The starting DateAndTime, from which the times in seconds are calculated |
Definition at line 1074 of file TimeSeriesProperty.cpp.
| std::string Mantid::Kernel::TimeSeriesProperty< TYPE >::toString | ( | ) | const |
Stringize the property.
Definition at line 1906 of file TimeSeriesProperty.cpp.
|
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.
|
overridevirtual |
Get the time series property as a string of 'time value'.
Implements Mantid::Kernel::Property.
Definition at line 1327 of file TimeSeriesProperty.cpp.
| 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.
Definition at line 904 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Algorithms::GetAllEi::findChopSpeedAndDelay().
|
overridevirtual |
Implements Mantid::Kernel::Property.
Definition at line 2114 of file TimeSeriesProperty.cpp.
References value.
| 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.
Definition at line 1372 of file TimeSeriesProperty.cpp.
References Mantid::Geometry::d, and value.
| 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.
| std::vector< TYPE > Mantid::Kernel::TimeSeriesProperty< TYPE >::valuesAsVector | ( | ) | const |
Return the time series's values (unfiltered) as a vector<TYPE>
Return the time series's values as a vector<TYPE>
Definition at line 923 of file TimeSeriesProperty.cpp.
Referenced by Mantid::Kernel::LogFilter::addFilter(), Mantid::Algorithms::CalculateCountRate::calcRateLog(), Mantid::Algorithms::AddLogInterpolated::exec(), Mantid::Algorithms::AddLogSmoothed::exec(), Mantid::Algorithms::AverageLogData::exec(), Mantid::Algorithms::GetTimeSeriesLogInformation::exec(), Mantid::Algorithms::PDDetermineCharacterizations::exec(), Mantid::DataHandling::LoadNexusLogs::execLoader(), Mantid::DataHandling::LoadSpiceXML2DDet::getHB3AWavelength(), Mantid::API::Run::integrateProtonCharge(), Mantid::Algorithms::AddLogDerivative::makeDerivative(), Mantid::Algorithms::GenerateEventsFilter::processIntegerValueFilter(), and Mantid::Kernel::TimeROI::replaceROI().
|
mutableprotected |
Flag to state whether mP is sorted or not.
Definition at line 388 of file TimeSeriesProperty.h.
|
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.
|
mutableprotected |
Holds the time series data.
Definition at line 381 of file TimeSeriesProperty.h.
Referenced by Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::setValueFromProperty(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::setValueFromProperty().