Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
Mantid::API::LogManager Class Reference

This class contains the information about the log entries. More...

#include <LogManager.h>

Inheritance diagram for Mantid::API::LogManager:
Mantid::API::Run Mantid::MDAlgorithms::MDWSDescription

Public Member Functions

void addLogData (Kernel::Property *p)
 Add a log entry.
 
void addLogData (std::unique_ptr< Kernel::Property > p, bool overwrite=false)
 Add a log entry.
 
template<class TYPE >
void addProperty (const std::string &name, const TYPE &value, bool overwrite=false)
 Add a property of given type.
 
template<class TYPE >
void addProperty (const std::string &name, const TYPE &value, const std::string &units, bool overwrite=false)
 Add a property of a specified type (Simply creates a Kernel::Property of that type) and set its units.
 
void addProperty (Kernel::Property *prop, bool overwrite=false)
 Add data to the object in the form of a property.
 
void addProperty (std::unique_ptr< Kernel::Property > prop, bool overwrite=false)
 Add data to the object in the form of a property.
 
void clearLogs ()
 Clear the logs.
 
void clearOutdatedTimeSeriesLogValues ()
 Empty all but the last value out of all TimeSeriesProperty logs.
 
void clearSingleValueCache ()
 Clear the cache of calculated statistics.
 
void clearTimeSeriesLogs ()
 Empty the values out of all TimeSeriesProperty logs.
 
LogManagercloneInTimeROI (const Kernel::TimeROI &timeROI)
 Create a new LogManager with a partial copy of its time series properties according to TimeROI.
 
void copyAndFilterProperties (const LogManager &other, const Kernel::TimeROI &timeROI)
 Copy properties from another LogManager; filter copied time series properties according to TimeROI.
 
const Types::Core::DateAndTime endTime () const
 Return the run end time.
 
void filterByLog (Mantid::Kernel::LogFilter *filter, const std::vector< std::string > &excludedFromFiltering=std::vector< std::string >())
 Filter the run by the given log filter.
 
virtual void filterByTime (const Types::Core::DateAndTime start, const Types::Core::DateAndTime stop)
 Filter the logs by time.
 
const Types::Core::DateAndTime getFirstPulseTime () const
 Return the first pulse time from sample logs.
 
Kernel::TimeSeriesProperty< bool > * getInvalidValuesFilter (const std::string &logName) const
 returns the invalid values log if the log has a matching invalid values log filter
 
const Types::Core::DateAndTime getLastPulseTime () const
 Return the last pulse time from sample logs.
 
double getLogAsSingleValue (const std::string &name, Kernel::Math::StatisticType statistic=Kernel::Math::Mean) const
 
const std::vector< Kernel::Property * > & getLogData () const
 Access all log entries.
 
Kernel::PropertygetLogData (const std::string &name) const
 Access a single log entry.
 
virtual size_t getMemorySize () const
 Return an approximate memory size for the object in bytes.
 
const std::vector< Kernel::Property * > & getProperties () const
 Return all of the current properties.
 
Kernel::PropertygetProperty (const std::string &name) const
 Returns the named property as a pointer.
 
int getPropertyAsIntegerValue (const std::string &name) const
 Returns a property as an integer value.
 
double getPropertyAsSingleValue (const std::string &name, Kernel::Math::StatisticType statistic=Kernel::Math::Mean) const
 Returns a property as a single double value from its name.
 
template<typename HeldType >
HeldType getPropertyValueAsType (const std::string &name) const
 Get the value of a property as the given TYPE.
 
const std::string & getProtonChargeLogName () const
 
const std::string & getProtonChargeUnfilteredName () const
 
Kernel::TimeSeriesPropertyStatistics getStatistics (const std::string &name) const
 Returns various statistics computations for a given property.
 
double getTimeAveragedStd (const std::string &name) const
 Get the time averaged standard deviation for a log.
 
double getTimeAveragedValue (const std::string &name) const
 Get the time averaged value for a log.
 
const Kernel::TimeROIgetTimeROI () const
 
template<typename T >
Kernel::TimeSeriesProperty< T > * getTimeSeriesProperty (const std::string &name) const
 Returns a property as a time series property.
 
bool hasInvalidValuesFilter (const std::string &logName) const
 returns true if the log has a matching invalid values log filter
 
bool hasProperty (const std::string &name) const
 Does the property exist on the object.
 
virtual void loadNexus (Nexus::File *file, const std::string &group, bool keepOpen=false)
 Load the run from a NeXus file with a given group name.
 
virtual void loadNexus (Nexus::File *file, const std::string &group, const Mantid::Nexus::NexusDescriptor &fileInfo, const std::string &prefix, bool keepOpen=false)
 Load the run from a NeXus file with a given group name. Overload that uses NexusDescriptor for faster.
 
 LogManager ()
 
 LogManager (const LogManager &other)
 
bool operator!= (const LogManager &other) const
 
LogManageroperator= (const LogManager &other)
 
bool operator== (const LogManager &other) const
 
virtual void removeDataOutsideTimeROI ()
 For the time series properties, remove values according to TimeROI.
 
void removeLogData (const std::string &name, const bool delproperty=true)
 Remove a named log entry.
 
void removeProperty (const std::string &name, bool delProperty=true)
 Remove a named property.
 
virtual void saveNexus (Nexus::File *file, const std::string &group, bool keepOpen=false) const
 Save the run to a NeXus file with a given group name.
 
void setStartAndEndTime (const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &end)
 Set the run start and end.
 
virtual void setTimeROI (const Kernel::TimeROI &timeroi)
 
const Types::Core::DateAndTime startTime () const
 Return the run start time.
 
virtual ~LogManager ()
 Destructor.
 

Static Public Member Functions

static std::string getInvalidValuesFilterLogName (const std::string &logName)
 Gets the correct log name for the matching invalid values log for a given log name.
 

Protected Member Functions

bool hasEndTime () const
 
bool hasStartTime () const
 
bool hasValidProtonChargeLog (std::string &error) const
 Check if the proton_charge log exists, is of valid type, and is not empty.
 
void loadNexus (Nexus::File *file, const Mantid::Nexus::NexusDescriptor &fileInfo, const std::string &prefix)
 
void loadNexus (Nexus::File *file, const std::map< std::string, std::string > &entries)
 Load the run from a NeXus file with a given group name.
 

Protected Attributes

std::unique_ptr< Kernel::PropertyManagerm_manager
 A pointer to a property manager.
 
std::unique_ptr< Kernel::TimeROIm_timeroi
 

Static Protected Attributes

static const std::string PROTON_CHARGE_LOG_NAME = "gd_prtn_chrg"
 Name of the log entry containing the proton charge when retrieved using getProtonCharge.
 
static const std::string PROTON_CHARGE_UNFILTERED_LOG_NAME = LogManager::PROTON_CHARGE_LOG_NAME + "_unfiltered"
 Flag to signify if a filter has been applied to the proton charge log.
 

Private Attributes

std::unique_ptr< Kernel::Cache< std::pair< std::string, Kernel::Math::StatisticType >, double > > m_singleValueCache
 Cache for the retrieved single values.
 

Detailed Description

This class contains the information about the log entries.

Author
Martyn Gigg, Tessella plc
Date
02/10/201

Definition at line 44 of file LogManager.h.

Constructor & Destructor Documentation

◆ LogManager() [1/2]

Mantid::API::LogManager::LogManager ( )

Definition at line 90 of file LogManager.cpp.

Referenced by cloneInTimeROI().

◆ LogManager() [2/2]

Mantid::API::LogManager::LogManager ( const LogManager other)

Definition at line 95 of file LogManager.cpp.

◆ ~LogManager()

Mantid::API::LogManager::~LogManager ( )
virtualdefault

Destructor.

Doesn't need to be virtual as long as nothing inherits from this class.

Member Function Documentation

◆ addLogData() [1/2]

void Mantid::API::LogManager::addLogData ( Kernel::Property p)
inline

◆ addLogData() [2/2]

void Mantid::API::LogManager::addLogData ( std::unique_ptr< Kernel::Property p,
bool  overwrite = false 
)
inline

Add a log entry.

Parameters
p:: A pointer to the property containing the log entry
overwrite:: Overwrite existing if requested

Definition at line 134 of file LogManager.h.

◆ addProperty() [1/4]

template<class TYPE >
void Mantid::API::LogManager::addProperty ( const std::string &  name,
const TYPE value,
bool  overwrite = false 
)

Add a property of given type.

Add a property of a specified type (Simply creates a Kernel::Property of that type.

Parameters
name:: The name of the type
value:: The value of the property
overwrite:: If true, a current value is overwritten. (Default: False)

Definition at line 242 of file LogManager.h.

References addProperty(), name, and value.

◆ addProperty() [2/4]

template<class TYPE >
void Mantid::API::LogManager::addProperty ( const std::string &  name,
const TYPE value,
const std::string &  units,
bool  overwrite = false 
)

Add a property of a specified type (Simply creates a Kernel::Property of that type) and set its units.

Parameters
name:: The name of the type
value:: The value of the property
units:: a string giving the units of the property.
overwrite:: If true, a current value is overwritten. (Default: False)

Definition at line 256 of file LogManager.h.

References addProperty(), name, and value.

◆ addProperty() [3/4]

void Mantid::API::LogManager::addProperty ( Kernel::Property prop,
bool  overwrite = false 
)
inline

Add data to the object in the form of a property.

Deprecated:
new code should use smart pointers

Definition at line 91 of file LogManager.h.

Referenced by Mantid::DataHandling::LoadILLTOF2::addAllNexusFieldsAsProperties(), Mantid::DataHandling::LoadILLTOF3::addAllNexusFieldsAsProperties(), Mantid::DataHandling::LoadILLTOF2::addEnergyToRun(), Mantid::DataHandling::LoadILLTOF3::addEnergyToRun(), Mantid::MDAlgorithms::ConvertToMD::addExperimentInfo(), Mantid::DataHandling::LoadILLTOF2::addFacility(), Mantid::DataHandling::LoadILLTOF3::addFacility(), Mantid::DataHandling::LegacyLoadHelper::addNumericProperty(), Mantid::API::ISISRunLogs::addPeriodLogs(), addProperty(), addProperty(), Mantid::Algorithms::SampleLogsBehaviour::addPropertyForList(), Mantid::Algorithms::SampleLogsBehaviour::addPropertyForTimeSeries(), Mantid::DataHandling::LoadILLTOF2::addPulseInterval(), Mantid::DataHandling::LoadILLTOF3::addPulseInterval(), Mantid::DataHandling::addSinglePointTimeSeriesProperty(), WorkspaceCreationHelper::addTSPEntry(), Mantid::Crystal::LoadIsawPeaks::appendFile(), Mantid::MDAlgorithms::MDWSTransform::buildQTrahsf(), Mantid::Algorithms::ConvertUnits::convertViaTOF(), Mantid::Algorithms::AddLogDerivative::exec(), Mantid::Algorithms::AddLogInterpolated::exec(), Mantid::Algorithms::AddLogSmoothed::exec(), Mantid::Crystal::AnvredCorrection::exec(), Mantid::Crystal::LoadHKL::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::DataHandling::LoadBBY::exec(), Mantid::DataHandling::LoadILLSANS::exec(), Mantid::DataHandling::LoadIsawDetCal::exec(), Mantid::DataHandling::LoadRaw3::exec(), Mantid::MDAlgorithms::ConvertToMDMinMaxLocal::exec(), Mantid::MDAlgorithms::LoadDNSSCD::exec(), Mantid::DataHandling::LoadEMU< FD >::exec(), Mantid::DataHandling::LoadPLN::exec(), Mantid::Crystal::AnvredCorrection::execEvent(), Mantid::DataHandling::LoadBBY2::execLoader(), Mantid::DataHandling::LoadILLSANS::loadDataFromD16ScanMonitors(), Mantid::DataHandling::LoadILLSANS::loadDataFromMonitors(), Mantid::DataHandling::LoadEMU< FD >::loadDopplerParameters(), Mantid::DataHandling::LoadILLSANS::loadMetaData(), Mantid::API::Run::loadNexusCommon(), Mantid::DataHandling::LoadILLReflectometry::loadNexusEntriesIntoProperties(), Mantid::DataHandling::LoadILLIndirect2::loadNexusEntriesIntoProperties(), Mantid::DataHandling::LoadNexusLogs::loadNPeriods(), Mantid::DataHandling::LoadEMU< FD >::loadParameters(), Mantid::DataHandling::LoadPLN::loadParameters(), Mantid::DataHandling::LoadMuonNexusV2::loadPeriodInfo(), Mantid::DataHandling::LoadISISNexusHelper::loadRunDetails(), Mantid::DataHandling::LoadSINQFocus::loadRunDetails(), Mantid::DataHandling::LoadISISNexus2::loadRunDetails(), Mantid::DataHandling::LoadMLZ::loadRunDetails(), Mantid::DataHandling::LoadRawHelper::loadRunParameters(), Mantid::DataHandling::LoadILLSANS::moveDetectorsD33(), Mantid::DataHandling::LoadILLSANS::placeD16(), Mantid::DataHandling::LegacyLoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::DataHandling::LoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::API::Run::setDuration(), Mantid::DataHandling::LoadSwans::setMetaDataAsWorkspaceProperties(), Mantid::API::MatrixWorkspace::setPlotType(), Mantid::API::Run::setProtonCharge(), Mantid::API::MatrixWorkspace::setTitle(), Mantid::DataHandling::LoadEMU< Nexus::NexusDescriptor >::setupDetectorMasks(), Mantid::MDAlgorithms::ConvertCWPDMDToSpectra::setupSampleLogs(), Mantid::Algorithms::SparseWorkspace::SparseWorkspace(), Mantid::Algorithms::SampleLogsBehaviour::updateListProperty(), Mantid::MDAlgorithms::LoadDNSSCD::updateProperties(), and Mantid::Algorithms::SampleLogsBehaviour::updateSumProperty().

◆ addProperty() [4/4]

void Mantid::API::LogManager::addProperty ( std::unique_ptr< Kernel::Property prop,
bool  overwrite = false 
)

Add data to the object in the form of a property.

Parameters
prop:: A pointer to a property whose ownership is transferred to this object
overwrite:: If true, a current value is overwritten. (Default: False)

Definition at line 347 of file LogManager.cpp.

References hasProperty(), m_manager, name, PROTON_CHARGE_LOG_NAME, and removeProperty().

◆ clearLogs()

void Mantid::API::LogManager::clearLogs ( )

Clear the logs.

Definition at line 727 of file LogManager.cpp.

References m_manager.

◆ clearOutdatedTimeSeriesLogValues()

void Mantid::API::LogManager::clearOutdatedTimeSeriesLogValues ( )

Empty all but the last value out of all TimeSeriesProperty logs.

Clears out all but the last entry of all logs of type TimeSeriesProperty Check the documentation/definition of TimeSeriesProperty::clearOutdated for the definition of 'last entry'.

Definition at line 566 of file LogManager.cpp.

References getProperties().

◆ clearSingleValueCache()

void Mantid::API::LogManager::clearSingleValueCache ( )

Clear the cache of calculated statistics.

Definition at line 729 of file LogManager.cpp.

References m_singleValueCache.

Referenced by copyAndFilterProperties(), filterByLog(), removeDataOutsideTimeROI(), and setTimeROI().

◆ clearTimeSeriesLogs()

void Mantid::API::LogManager::clearTimeSeriesLogs ( )

Empty the values out of all TimeSeriesProperty logs.

Clear out the contents of all logs of type TimeSeriesProperty.

Single-value properties will be left unchanged.

The method has been fully implemented here instead of as a pass-through to PropertyManager to limit its visibility to Run clients.

Definition at line 549 of file LogManager.cpp.

References getProperties().

◆ cloneInTimeROI()

LogManager * Mantid::API::LogManager::cloneInTimeROI ( const Kernel::TimeROI timeROI)

Create a new LogManager with a partial copy of its time series properties according to TimeROI.

Create a partial copy of this object such that every time series property is cloned according to the input TimeROI.

A partially cloned time series property 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. Properties that are not time series will be cloned with no changes.

Parameters
timeROI:: a series of time regions used to determine which time series values should be included in the copy.

Definition at line 289 of file LogManager.cpp.

References LogManager(), m_manager, m_timeroi, and Mantid::Kernel::TimeROI::update_or_replace_intersection().

◆ copyAndFilterProperties()

void Mantid::API::LogManager::copyAndFilterProperties ( const LogManager other,
const Kernel::TimeROI timeROI 
)

Copy properties from another LogManager; filter copied time series properties according to TimeROI.

Copy properties from another LogManager object.

Filter copied time series properties according to the input TimeROI.

Parameters
other:: another LogManager object.
timeROI:: a series of time regions used to determine which time series values should be included in the copy.

Definition at line 308 of file LogManager.cpp.

References clearSingleValueCache(), m_manager, and setTimeROI().

◆ endTime()

const Types::Core::DateAndTime Mantid::API::LogManager::endTime ( ) const

Return the run end time.

Find run end time as determined by the following priorities:

  1. "end_time" property
  2. "run_end" property
  3. last log time in "proton_charge" property
    Returns
    The end time of the run
    Exceptions
    std::runtime_errorif end time cannot be determined

Definition at line 166 of file LogManager.cpp.

References getLastPulseTime(), getProperty(), hasProperty(), hasValidProtonChargeLog(), and value.

Referenced by export_Run(), Mantid::API::ExperimentInfo::getAvailableWorkspaceEndDate(), and Mantid::API::Run::operator+=().

◆ filterByLog()

void Mantid::API::LogManager::filterByLog ( Mantid::Kernel::LogFilter filter,
const std::vector< std::string > &  excludedFromFiltering = std::vector<std::string>() 
)

Filter the run by the given log filter.

Filter the run by the given boolean log.

It replaces all time series properties with filtered time series properties

Parameters
filter:: A LogFilter instance to filter each log on
excludedFromFiltering:: A string list of logs that will be excluded from filtering

Definition at line 332 of file LogManager.cpp.

References clearSingleValueCache(), and m_manager.

Referenced by Mantid::API::ISISRunLogs::applyLogFiltering().

◆ filterByTime()

void Mantid::API::LogManager::filterByTime ( const Types::Core::DateAndTime  start,
const Types::Core::DateAndTime  stop 
)
virtual

Filter the logs by time.

Filter out all TimeSeriesProperty log entries outside of the given absolute time range [start,stop), except for the entries immediately before and after the time range.

Parameters
start:: Absolute start time.
stop:: Absolute stop time.

Reimplemented in Mantid::API::Run.

Definition at line 277 of file LogManager.cpp.

References removeDataOutsideTimeROI(), and setTimeROI().

Referenced by Mantid::API::Run::filterByTime().

◆ getFirstPulseTime()

const DateAndTime Mantid::API::LogManager::getFirstPulseTime ( ) const

Return the first pulse time from sample logs.

Return the time of the first pulse received, by accessing the run's sample logs to find the proton_charge.

Returns
the time of the first valid pulse.
Exceptions
runtime_errorif the time of the first pulse is not available.

Definition at line 205 of file LogManager.cpp.

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

Referenced by Mantid::API::MatrixWorkspace::getFirstPulseTime(), and startTime().

◆ getInvalidValuesFilter()

Kernel::TimeSeriesProperty< bool > * Mantid::API::LogManager::getInvalidValuesFilter ( const std::string &  logName) const

returns the invalid values log if the log has a matching invalid values log filter

Definition at line 743 of file LogManager.cpp.

References getInvalidValuesFilterLogName(), and getLogData().

◆ getInvalidValuesFilterLogName()

std::string Mantid::API::LogManager::getInvalidValuesFilterLogName ( const std::string &  logName)
static

Gets the correct log name for the matching invalid values log for a given log name.

Definition at line 733 of file LogManager.cpp.

References Mantid::Kernel::PropertyManager::getInvalidValuesFilterLogName().

Referenced by getInvalidValuesFilter(), and hasInvalidValuesFilter().

◆ getLastPulseTime()

const DateAndTime Mantid::API::LogManager::getLastPulseTime ( ) const

Return the last pulse time from sample logs.

Return the time of the last pulse received, by accessing the run's sample logs to find the proton_charge.

Returns
the time of the last pulse.
Exceptions
runtime_errorif the time of the last pulse is not available.

Definition at line 234 of file LogManager.cpp.

References Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::realSize().

Referenced by endTime(), and Mantid::API::MatrixWorkspace::getLastPulseTime().

◆ getLogAsSingleValue()

double Mantid::API::LogManager::getLogAsSingleValue ( const std::string &  name,
Kernel::Math::StatisticType  statistic = Kernel::Math::Mean 
) const
inline
Parameters
name:: The name of the property
statistic:: Defines how to calculate the single value from series (default=Mean)
Returns
A log as a single value using the given statistic type

Definition at line 161 of file LogManager.h.

References name.

Referenced by Mantid::API::Run::calculateAverageGoniometerMatrix(), Mantid::Algorithms::ConvertSpectrumAxis2::getEfixed(), Mantid::Algorithms::PDDetermineCharacterizations::getLogValue(), MantidQt::MantidWidgets::LogValueFinder::getLogValue(), Mantid::DataHandling::LoadILLDiffraction::setSampleLogs(), and Mantid::Algorithms::SampleLogsBehaviour::updateTimeSeriesProperty().

◆ getLogData() [1/2]

const std::vector< Kernel::Property * > & Mantid::API::LogManager::getLogData ( ) const
inline

Access all log entries.

Returns
A list of all of the log entries

Definition at line 146 of file LogManager.h.

Referenced by export_Run(), Mantid::API::Run::getBadPulseRange(), and getInvalidValuesFilter().

◆ getLogData() [2/2]

Kernel::Property * Mantid::API::LogManager::getLogData ( const std::string &  name) const
inline

◆ getMemorySize()

size_t Mantid::API::LogManager::getMemorySize ( ) const
virtual

Return an approximate memory size for the object in bytes.

Return the total memory used by the run object, in bytes.

Reimplemented in Mantid::API::Run.

Definition at line 391 of file LogManager.cpp.

References m_manager, and m_timeroi.

Referenced by Mantid::API::Run::getMemorySize().

◆ getProperties()

const std::vector< Kernel::Property * > & Mantid::API::LogManager::getProperties ( ) const

Return all of the current properties.

Returns
A vector of the current list of properties

Definition at line 386 of file LogManager.cpp.

References m_manager.

Referenced by clearOutdatedTimeSeriesLogValues(), clearTimeSeriesLogs(), export_Run(), Mantid::API::ISISRunLogs::getLogNamesExcludedFromFiltering(), and Mantid::MDAlgorithms::ConvertCWPDMDToSpectra::setupSampleLogs().

◆ getProperty()

Kernel::Property * Mantid::API::LogManager::getProperty ( const std::string &  name) const

Returns the named property as a pointer.

Get a pointer to a property by name.

Parameters
name:: The name of a property, throws an Exception::NotFoundError if it does not exist
Returns
A pointer to the named property

Definition at line 541 of file LogManager.cpp.

References m_manager, and name.

Referenced by Mantid::Algorithms::AddSampleLog::addSingleValueProperty(), Mantid::Algorithms::AddSampleLog::addStringLog(), Mantid::Algorithms::AddSampleLog::addTimeSeriesProperty(), Mantid::MDAlgorithms::SlicingAlgorithm::createTransform(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), endTime(), Mantid::Algorithms::AddLogDerivative::exec(), Mantid::Algorithms::AddLogInterpolated::exec(), Mantid::Algorithms::AddLogSmoothed::exec(), Mantid::MDAlgorithms::LoadDNSSCD::exec(), export_Run(), Mantid::DataHandling::SaveGSS::generateInstrumentHeader(), Mantid::API::ExperimentInfo::getLog(), Mantid::Algorithms::PDDetermineCharacterizations::getLogValue(), Mantid::DataHandling::SaveGSS::getLogValue(), Mantid::API::MatrixWorkspace::getPlotType(), getPropertyAsIntegerValue(), getPropertyAsSingleValue(), getPropertyValueAsType(), getStatistics(), getTimeSeriesProperty(), Mantid::API::MatrixWorkspace::getTitle(), hasValidProtonChargeLog(), Mantid::API::Run::integrateProtonCharge(), Mantid::API::Run::loadNexus(), Mantid::API::Run::loadNexus(), Mantid::DataHandling::LegacyLoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::DataHandling::LoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), Mantid::API::Run::setDuration(), Mantid::API::Run::setProtonCharge(), Mantid::Algorithms::AddSampleLog::setTimeSeriesData(), startTime(), Mantid::Algorithms::SampleLogsBehaviour::updateListProperty(), Mantid::Algorithms::SampleLogsBehaviour::updateTimeSeriesProperty(), Mantid::Algorithms::AddLogInterpolated::validateInputs(), and Mantid::Algorithms::AddLogSmoothed::validateInputs().

◆ getPropertyAsIntegerValue()

int Mantid::API::LogManager::getPropertyAsIntegerValue ( const std::string &  name) const

Returns a property as an integer value.

Returns a property as a n integer, if the underlying value is an integer.

Throws otherwise.

Parameters
name:: The name of the property
Returns
A single integer value
Exceptions
std::invalid_argumentif property is not an integer type

Definition at line 518 of file LogManager.cpp.

References getProperty(), name, and Mantid::Kernel::Property::value().

Referenced by Mantid::API::ISISRunLogs::applyLogFiltering().

◆ getPropertyAsSingleValue()

double Mantid::API::LogManager::getPropertyAsSingleValue ( const std::string &  name,
Kernel::Math::StatisticType  statistic = Kernel::Math::Mean 
) const

Returns a property as a single double value from its name.

See also
getPropertyAsSingleValue
Parameters
name:: The name of the property
statistic:: The statistic to use to calculate the single value (default=Mean)
See also
StatisticType
Returns
A single double value

Definition at line 485 of file LogManager.cpp.

References getProperty(), getTimeROI(), m_singleValueCache, and name.

Referenced by Mantid::DataHandling::LoadILLTOF2::addPulseInterval(), Mantid::DataHandling::LoadILLTOF3::addPulseInterval(), Mantid::Algorithms::GetEiMonDet3::computeTOF(), and Mantid::API::ExperimentInfo::getLogAsSingleValue().

◆ getPropertyValueAsType()

template<typename HeldType >
HeldType Mantid::API::LogManager::getPropertyValueAsType ( const std::string &  name) const

Get the value of a property as the given TYPE.

Get the value of a property as the requested type.

Throws if the type is not correct

Throws if the type is not correct

Parameters
name:: The name of the property
Returns
The value of as the requested type

Definition at line 468 of file LogManager.cpp.

References getProperty(), and name.

Referenced by Mantid::DataHandling::LoadILLTOF2::addAllNexusFieldsAsProperties(), Mantid::DataHandling::LoadILLTOF3::addAllNexusFieldsAsProperties(), Mantid::MDAlgorithms::ConvertToMD::addExperimentInfo(), Mantid::Algorithms::AddPeak::exec(), Mantid::Algorithms::FilterBadPulses::exec(), Mantid::Crystal::AnvredCorrection::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveIsawPeaks::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), Mantid::DataHandling::LoadIsawDetCal::exec(), Mantid::DataHandling::SaveIsawDetCal::exec(), Mantid::DataHandling::SaveNXSPE::exec(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::exec(), Mantid::Algorithms::NormaliseByCurrent::extractCharge(), Mantid::Crystal::SCDCalibratePanels::findT0(), Mantid::API::ExperimentInfo::getEFixedGivenEMode(), Mantid::API::ExperimentInfo::getEMode(), Mantid::Algorithms::Qxy::getQminFromWs(), Mantid::MDAlgorithms::ConvToMDBase::initialize(), Mantid::DataHandling::LoadEMU< FD >::loadEnvironParameters(), Mantid::DataHandling::LoadPLN::loadEnvironParameters(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), and Mantid::DataHandling::LoadILLDiffraction::setSampleLogs().

◆ getProtonChargeLogName()

const std::string & Mantid::API::LogManager::getProtonChargeLogName ( ) const
inline

Definition at line 205 of file LogManager.h.

◆ getProtonChargeUnfilteredName()

const std::string & Mantid::API::LogManager::getProtonChargeUnfilteredName ( ) const
inline

Definition at line 206 of file LogManager.h.

◆ getStatistics()

Kernel::TimeSeriesPropertyStatistics Mantid::API::LogManager::getStatistics ( const std::string &  name) const

Returns various statistics computations for a given property.

The time filter, if not-empty, is applied when computing. The returned statistics will all be NAN when statistics cannot be computed, such as for a string property.

Parameters
name:: The name of the property.
Returns
A TimeSeriesPropertyStatistics object containing values for Minimum, Maximum, Mean, Median, standard deviation, time weighted average, and time weighted standard deviation.

Definition at line 444 of file LogManager.cpp.

References getProperty(), m_timeroi, name, Mantid::Kernel::TimeSeriesPropertyStatistics::setAllToNan(), and value.

Referenced by Mantid::API::Run::calculateAverageGoniometerMatrix(), export_Run(), getTimeAveragedStd(), and getTimeAveragedValue().

◆ getTimeAveragedStd()

double Mantid::API::LogManager::getTimeAveragedStd ( const std::string &  name) const

Get the time averaged standard deviation for a log.

Returns the time dependent standard deviation.

Parameters
name:: The name of the property
Returns
A single double value

Definition at line 425 of file LogManager.cpp.

References getStatistics(), name, and Mantid::Kernel::TimeSeriesPropertyStatistics::time_standard_deviation.

Referenced by export_Run().

◆ getTimeAveragedValue()

double Mantid::API::LogManager::getTimeAveragedValue ( const std::string &  name) const

Get the time averaged value for a log.

Returns the time averaged value.

Parameters
name:: The name of the property
Returns
A single double value

Definition at line 434 of file LogManager.cpp.

References getStatistics(), name, and Mantid::Kernel::TimeSeriesPropertyStatistics::time_mean.

Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), and export_Run().

◆ getTimeROI()

const Kernel::TimeROI & Mantid::API::LogManager::getTimeROI ( ) const

◆ getTimeSeriesProperty()

template<typename T >
Kernel::TimeSeriesProperty< T > * Mantid::API::LogManager::getTimeSeriesProperty ( const std::string &  name) const

Returns a property as a time series property.

It will throw if it is not valid

It will throw if it is not valid or the property does not exist

Parameters
nameThe name of a time-series property
Returns
A pointer to the time-series property
Exceptions
invalid_argumentif the named property is not a time-series property

Definition at line 411 of file LogManager.cpp.

References getProperty(), and name.

Referenced by Mantid::Algorithms::SampleLogsBehaviour::addPropertyForTimeSeries(), Mantid::API::ISISRunLogs::applyLogFiltering(), Mantid::DataHandling::LoadEMU< FD >::exec(), Mantid::DataHandling::LoadPLN::exec(), Mantid::DataHandling::LoadEMU< FD >::loadDopplerParameters(), and Mantid::Algorithms::SampleLogsBehaviour::updateTimeSeriesProperty().

◆ hasEndTime()

bool Mantid::API::LogManager::hasEndTime ( ) const
protected

Definition at line 194 of file LogManager.cpp.

References hasProperty(), and hasValidProtonChargeLog().

◆ hasInvalidValuesFilter()

bool Mantid::API::LogManager::hasInvalidValuesFilter ( const std::string &  logName) const

returns true if the log has a matching invalid values log filter

Definition at line 738 of file LogManager.cpp.

References getInvalidValuesFilterLogName(), and hasProperty().

◆ hasProperty()

bool Mantid::API::LogManager::hasProperty ( const std::string &  name) const

Does the property exist on the object.

Returns true if the named property exists.

Parameters
name:: The name of the property
Returns
True if the property exists, false otherwise

Definition at line 365 of file LogManager.cpp.

References m_manager, and name.

Referenced by Mantid::DataHandling::LegacyLoadHelper::addNumericProperty(), addProperty(), Mantid::DataHandling::LoadNexusProcessed::applyLogFiltering(), Mantid::Algorithms::GetEiMonDet3::computeTOF(), Mantid::DataHandling::SaveCanSAS1D::createSASProcessElement(), Mantid::DataHandling::SaveCanSAS1D2::createSASProcessElement(), Mantid::MDAlgorithms::SlicingAlgorithm::createTransform(), endTime(), Mantid::Algorithms::AddLogDerivative::exec(), Mantid::Algorithms::AddPeak::exec(), Mantid::Algorithms::AddSampleLog::exec(), Mantid::Algorithms::FilterBadPulses::exec(), Mantid::Crystal::AnvredCorrection::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveIsawPeaks::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), Mantid::DataHandling::LoadIsawDetCal::exec(), Mantid::DataHandling::LoadPreNexus::exec(), Mantid::DataHandling::SaveIsawDetCal::exec(), Mantid::DataHandling::SaveNXSPE::exec(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::exec(), export_Run(), Mantid::DataHandling::SaveGSS::generateInstrumentHeader(), Mantid::API::Run::getBadPulseRange(), Mantid::Algorithms::ConvertSpectrumAxis2::getEfixed(), Mantid::API::ExperimentInfo::getEFixedGivenEMode(), Mantid::API::ISISRunLogs::getLogNamesExcludedFromFiltering(), Mantid::Algorithms::PDDetermineCharacterizations::getLogValue(), Mantid::DataHandling::SaveGSS::getLogValue(), Mantid::Algorithms::Qxy::getQminFromWs(), Mantid::API::ExperimentInfo::getRunNumber(), hasEndTime(), hasInvalidValuesFilter(), hasStartTime(), hasValidProtonChargeLog(), Mantid::API::Run::integrateProtonCharge(), Mantid::API::Run::loadNexus(), Mantid::API::Run::loadNexus(), Mantid::API::Run::loadNexusCommon(), Mantid::DataHandling::LoadNexusLogs::loadNPeriods(), Mantid::Algorithms::CopyLogs::mergeKeepExisting(), Mantid::Algorithms::CopyLogs::mergeReplaceExisting(), Mantid::DataHandling::LegacyLoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::DataHandling::LoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), Mantid::API::Run::saveNexus(), Mantid::API::Run::setDuration(), Mantid::API::Run::setProtonCharge(), Mantid::DataHandling::LoadILLDiffraction::setSampleLogs(), startTime(), Mantid::MDAlgorithms::LoadDNSSCD::updateProperties(), Mantid::Algorithms::AddLogInterpolated::validateInputs(), Mantid::Algorithms::AddLogSmoothed::validateInputs(), and Mantid::DataHandling::LoadISISNexus2::validateMultiPeriodLogs().

◆ hasStartTime()

bool Mantid::API::LogManager::hasStartTime ( ) const
protected

Definition at line 189 of file LogManager.cpp.

References hasProperty(), and hasValidProtonChargeLog().

◆ hasValidProtonChargeLog()

bool Mantid::API::LogManager::hasValidProtonChargeLog ( std::string &  error) const
protected

Check if the proton_charge log exists, is of valid type, and is not empty.

Parameters
error:: extended error message in case the check fails
Returns
true if a valid proton_charge log exists, false otherwise.

Definition at line 247 of file LogManager.cpp.

References error, getProperty(), hasProperty(), and Mantid::Kernel::TimeSeriesProperty< TYPE >::realSize().

Referenced by endTime(), hasEndTime(), hasStartTime(), and startTime().

◆ loadNexus() [1/4]

void Mantid::API::LogManager::loadNexus ( Nexus::File *  file,
const Mantid::Nexus::NexusDescriptor fileInfo,
const std::string &  prefix 
)
protected

◆ loadNexus() [2/4]

void Mantid::API::LogManager::loadNexus ( Nexus::File *  file,
const std::map< std::string, std::string > &  entries 
)
protected

Load the run from a NeXus file with a given group name.

Load the object from an open NeXus file.

Avoid multiple expensive calls to getEntries().

Parameters
file:: open NeXus file
entries:: The entries available in the current place in the file. load any NXlog in the current open group.

Definition at line 700 of file LogManager.cpp.

References Mantid::Kernel::PropertyNexus::loadProperty(), m_manager, m_timeroi, and Mantid::Kernel::TimeROI::NAME.

◆ loadNexus() [3/4]

void Mantid::API::LogManager::loadNexus ( Nexus::File *  file,
const std::string &  group,
bool  keepOpen = false 
)
virtual

Load the run from a NeXus file with a given group name.

Load the object from an open NeXus file.

Parameters
file:: open NeXus file
group:: name of the group to open. Pass an empty string to NOT open a group
keepOpen:: do not close group on exit to allow overloading and child classes reading from the same group load any NXlog in the current open group.

Reimplemented in Mantid::API::Run.

Definition at line 636 of file LogManager.cpp.

References group, and loadNexus().

◆ loadNexus() [4/4]

void Mantid::API::LogManager::loadNexus ( Nexus::File *  file,
const std::string &  group,
const Mantid::Nexus::NexusDescriptor fileInfo,
const std::string &  prefix,
bool  keepOpen = false 
)
virtual

Load the run from a NeXus file with a given group name. Overload that uses NexusDescriptor for faster.

Load the object from an open NeXus file.

Not used.

Parameters
file:: open NeXus file
group:: name of the group to open. Pass an empty string to NOT open a group
fileInfo:: The corresponding Nexus HDF5 file descriptor
prefix:: The prefix of the provided file
keepOpen:: do not close group on exit to allow overloading and child classes reading from the same group load any NXlog in the current open group.

Reimplemented in Mantid::API::Run.

Definition at line 621 of file LogManager.cpp.

Referenced by loadNexus(), Mantid::API::Run::loadNexus(), and Mantid::API::Run::loadNexus().

◆ operator!=()

bool Mantid::API::LogManager::operator!= ( const LogManager other) const

Definition at line 759 of file LogManager.cpp.

References m_manager, and m_timeroi.

◆ operator=()

LogManager & Mantid::API::LogManager::operator= ( const LogManager other)

Definition at line 104 of file LogManager.cpp.

References m_manager, m_singleValueCache, and m_timeroi.

Referenced by Mantid::API::Run::operator=().

◆ operator==()

bool Mantid::API::LogManager::operator== ( const LogManager other) const

Definition at line 755 of file LogManager.cpp.

References m_manager, and m_timeroi.

Referenced by Mantid::API::Run::operator==().

◆ removeDataOutsideTimeROI()

void Mantid::API::LogManager::removeDataOutsideTimeROI ( )
virtual

For the time series properties, remove values according to TimeROI.

For time series properties, remove time values outside of this object's TimeROI.

Each TimeROI region is defined as [roi_begin,roi_end]. However, keep the values immediately before and after each timeROI region, if available.

Definition at line 319 of file LogManager.cpp.

References clearSingleValueCache(), m_manager, and m_timeroi.

Referenced by Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), and filterByTime().

◆ removeLogData()

void Mantid::API::LogManager::removeLogData ( const std::string &  name,
const bool  delproperty = true 
)
inline

Remove a named log entry.

Parameters
name:: The name of the entry to remove
delproperty:: If true, delete the log entry

Definition at line 152 of file LogManager.h.

References name.

Referenced by Mantid::Algorithms::AddSampleLog::exec(), Mantid::DataHandling::LoadRaw3::exec(), Mantid::DataHandling::LoadRawBin0::exec(), Mantid::DataHandling::LoadRawSpectrum0::exec(), Mantid::Algorithms::CopyLogs::mergeReplaceExisting(), and Mantid::Algorithms::CopyLogs::wipeExisting().

◆ removeProperty()

void Mantid::API::LogManager::removeProperty ( const std::string &  name,
bool  delProperty = true 
)

Remove a named property.

Parameters
name:: The name of the property
delProperty:: If true the property is deleted (default=true)

Definition at line 374 of file LogManager.cpp.

References m_manager, m_singleValueCache, and name.

Referenced by addProperty(), Mantid::DataHandling::LoadPreNexus::exec(), and Mantid::DataHandling::SinglePeriodLoadMuonStrategy::loadGoodFrames().

◆ saveNexus()

void Mantid::API::LogManager::saveNexus ( Nexus::File *  file,
const std::string &  group,
bool  keepOpen = false 
) const
virtual

Save the run to a NeXus file with a given group name.

Save the object to an open NeXus file.

Parameters
file:: open NeXus file
group:: name of the group to create
keepOpen:: do not close group on exit to allow overloading and child classes writing to the same group

Reimplemented in Mantid::API::Run.

Definition at line 589 of file LogManager.cpp.

References Mantid::API::g_log, group, m_manager, m_timeroi, and Mantid::Kernel::Logger::warning().

Referenced by Mantid::API::Run::saveNexus().

◆ setStartAndEndTime()

void Mantid::API::LogManager::setStartAndEndTime ( const Types::Core::DateAndTime &  start,
const Types::Core::DateAndTime &  end 
)

Set the run start and end.

Parameters
start:: The run start
end:: The run end

Definition at line 117 of file LogManager.cpp.

Referenced by Mantid::Algorithms::CreateSampleWorkspace::exec(), and export_Run().

◆ setTimeROI()

void Mantid::API::LogManager::setTimeROI ( const Kernel::TimeROI timeroi)
virtual

◆ startTime()

const Types::Core::DateAndTime Mantid::API::LogManager::startTime ( ) const

Return the run start time.

Find run end time as determined by the following priorities:

  1. "start_time" property
  2. "run_start" property
  3. first valid log time in "proton_charge" property
    Returns
    The start time of the run
    Exceptions
    std::runtime_errorif start time cannot be determined

Definition at line 130 of file LogManager.cpp.

References getFirstPulseTime(), getProperty(), hasProperty(), hasValidProtonChargeLog(), and value.

Referenced by Mantid::Algorithms::SampleLogsBehaviour::addPropertyForTimeSeries(), export_Run(), Mantid::API::ExperimentInfo::getAvailableWorkspaceStartDate(), Mantid::Algorithms::AddSampleLog::getRunStart(), Mantid::API::ExperimentInfo::getWorkspaceStartDate(), Mantid::API::Run::operator+=(), and Mantid::Algorithms::SampleLogsBehaviour::updateTimeSeriesProperty().

Member Data Documentation

◆ m_manager

std::unique_ptr<Kernel::PropertyManager> Mantid::API::LogManager::m_manager
protected

◆ m_singleValueCache

std::unique_ptr<Kernel::Cache<std::pair<std::string, Kernel::Math::StatisticType>, double> > Mantid::API::LogManager::m_singleValueCache
mutableprivate

Cache for the retrieved single values.

Definition at line 228 of file LogManager.h.

Referenced by clearSingleValueCache(), getPropertyAsSingleValue(), operator=(), and removeProperty().

◆ m_timeroi

std::unique_ptr<Kernel::TimeROI> Mantid::API::LogManager::m_timeroi
protected

◆ PROTON_CHARGE_LOG_NAME

const std::string Mantid::API::LogManager::PROTON_CHARGE_LOG_NAME = "gd_prtn_chrg"
staticprotected

Name of the log entry containing the proton charge when retrieved using getProtonCharge.

Definition at line 221 of file LogManager.h.

Referenced by addProperty(), Mantid::API::Run::getProtonCharge(), and Mantid::API::Run::setProtonCharge().

◆ PROTON_CHARGE_UNFILTERED_LOG_NAME

const std::string Mantid::API::LogManager::PROTON_CHARGE_UNFILTERED_LOG_NAME = LogManager::PROTON_CHARGE_LOG_NAME + "_unfiltered"
staticprotected

Flag to signify if a filter has been applied to the proton charge log.

Definition at line 223 of file LogManager.h.

Referenced by Mantid::API::Run::getProtonCharge(), and Mantid::API::Run::integrateProtonCharge().


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