Mantid
|
Templated class that defines a filtered time series but still gives access to the original data. More...
#include <FilteredTimeSeriesProperty.h>
Public Member Functions | |
FilteredTimeSeriesProperty ()=delete | |
Disable default constructor. More... | |
FilteredTimeSeriesProperty (std::unique_ptr< const TimeSeriesProperty< HeldType > > seriesProp, const TimeSeriesProperty< bool > &filterProp) | |
Construct with a source time series to take ownership of & a filter property. More... | |
FilteredTimeSeriesProperty (TimeSeriesProperty< HeldType > *seriesProp, const TimeSeriesProperty< bool > &filterProp) | |
Construct with a source time series & a filter property. More... | |
const TimeSeriesProperty< HeldType > * | unfiltered () const |
Access the unfiltered log. More... | |
~FilteredTimeSeriesProperty () override | |
Destructor. More... | |
Public Member Functions inherited from Mantid::Kernel::TimeSeriesProperty< HeldType > | |
void | addValue (const std::string &time, const HeldType &value) |
Add a value to the map using a string time. More... | |
void | addValue (const std::time_t &time, const HeldType &value) |
Add a value to the map using a time_t. More... | |
void | addValue (const Types::Core::DateAndTime &time, const HeldType &value) |
Add a value to the map using a DateAndTime object. More... | |
void | addValues (const std::vector< Types::Core::DateAndTime > ×, const std::vector< HeldType > &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< HeldType > * | 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< HeldType > &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< HeldType > &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< HeldType > | 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... | |
HeldType | 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... | |
HeldType | getSingleValue (const Types::Core::DateAndTime &t) const |
Returns the value at a particular time. More... | |
HeldType | 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... | |
HeldType | 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... | |
HeldType | maxValue () const |
Returns the maximum value found in the series. More... | |
double | mean () const |
Returns the mean value found in the series. More... | |
TimeSeriesProperty< HeldType > & | merge (Property *rhs) override |
Merge the given property with this one. More... | |
HeldType | 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... | |
HeldType | 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< HeldType > &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< HeldType > &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< HeldType > &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< HeldType > &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, HeldType > | valueAsCorrectMap () const |
Return the time series as a correct C++ map<DateAndTime, TYPE>. More... | |
Json::Value | valueAsJson () const override |
std::map< Types::Core::DateAndTime, HeldType > | valueAsMap () const |
Return the time series as a C++ map<DateAndTime, TYPE> More... | |
std::multimap< Types::Core::DateAndTime, HeldType > | valueAsMultiMap () const |
Return the time series as a correct C++ multimap<DateAndTime, TYPE>. More... | |
std::vector< HeldType > | 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... | |
Private Attributes | |
std::unique_ptr< const TimeSeriesProperty< HeldType > > | m_unfiltered |
The original unfiltered property as an owned pointer. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Mantid::Kernel::TimeSeriesProperty< HeldType > | |
static bool | isTimeString (const std::string &str) |
Check if str has the right time format. More... | |
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... | |
Templated class that defines a filtered time series but still gives access to the original data.
Definition at line 20 of file FilteredTimeSeriesProperty.h.
Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::FilteredTimeSeriesProperty | ( | TimeSeriesProperty< HeldType > * | seriesProp, |
const TimeSeriesProperty< bool > & | filterProp | ||
) |
Construct with a source time series & a filter property.
seriesProp | :: A pointer to a property to filter. |
filterProp | :: A boolean series property to filter on |
Definition at line 21 of file FilteredTimeSeriesProperty.cpp.
References Mantid::Kernel::TimeSeriesProperty< HeldType >::filterWith().
Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::FilteredTimeSeriesProperty | ( | std::unique_ptr< const TimeSeriesProperty< HeldType > > | seriesProp, |
const TimeSeriesProperty< bool > & | filterProp | ||
) |
Construct with a source time series to take ownership of & a filter property.
Construct with a source time series & a filter property.
seriesProp | :: A smart pointer to take ownership of pointer to a property to filter. |
filterProp | :: A boolean series property to filter on |
Definition at line 36 of file FilteredTimeSeriesProperty.cpp.
References Mantid::Kernel::TimeSeriesProperty< HeldType >::filterWith().
|
overridedefault |
Destructor.
|
delete |
Disable default constructor.
const TimeSeriesProperty< HeldType > * Mantid::Kernel::FilteredTimeSeriesProperty< HeldType >::unfiltered |
Access the unfiltered log.
Definition at line 53 of file FilteredTimeSeriesProperty.cpp.
|
private |
The original unfiltered property as an owned pointer.
Definition at line 41 of file FilteredTimeSeriesProperty.h.