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. More...
 
void addLogData (std::unique_ptr< Kernel::Property > p, bool overwrite=false)
 Add a log entry. More...
 
template<class TYPE >
void addProperty (const std::string &name, const TYPE &value, bool overwrite=false)
 Add a property of given type. More...
 
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. More...
 
void addProperty (Kernel::Property *prop, bool overwrite=false)
 Add data to the object in the form of a property. More...
 
void addProperty (std::unique_ptr< Kernel::Property > prop, bool overwrite=false)
 Add data to the object in the form of a property. More...
 
void clearLogs ()
 Clear the logs. More...
 
void clearOutdatedTimeSeriesLogValues ()
 Empty all but the last value out of all TimeSeriesProperty logs. More...
 
void clearTimeSeriesLogs ()
 Empty the values out of all TimeSeriesProperty logs. More...
 
const Types::Core::DateAndTime endTime () const
 Return the run end time. More...
 
void filterByLog (const Kernel::TimeSeriesProperty< bool > &filter, const std::vector< std::string > &excludedFromFiltering=std::vector< std::string >())
 Filter the run by the given boolean log. More...
 
virtual void filterByTime (const Types::Core::DateAndTime start, const Types::Core::DateAndTime stop)
 Filter the logs by time. More...
 
Kernel::TimeSeriesProperty< bool > * getInvalidValuesFilter (const std::string &logName) const
 returns the invalid values log if the log has a matching invalid values log filter More...
 
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. More...
 
Kernel::PropertygetLogData (const std::string &name) const
 Access a single log entry. More...
 
virtual size_t getMemorySize () const
 Return an approximate memory size for the object in bytes. More...
 
const std::vector< Kernel::Property * > & getProperties () const
 Return all of the current properties. More...
 
Kernel::PropertygetProperty (const std::string &name) const
 Returns the named property as a pointer. More...
 
int getPropertyAsIntegerValue (const std::string &name) const
 Returns a property as an integer value. More...
 
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. More...
 
template<typename HeldType >
HeldType getPropertyValueAsType (const std::string &name) const
 Get the value of a property as the given TYPE. More...
 
double getTimeAveragedStd (const std::string &name) const
 Get the time averaged standard deviation for a log. More...
 
template<typename T >
Kernel::TimeSeriesProperty< T > * getTimeSeriesProperty (const std::string &name) const
 Returns a property as a time series property. More...
 
bool hasInvalidValuesFilter (const std::string &logName) const
 returns true if the log has a matching invalid values log filter More...
 
bool hasProperty (const std::string &name) const
 Does the property exist on the object. More...
 
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. More...
 
virtual void loadNexus (::NeXus::File *file, const std::string &group, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, const std::string &prefix, bool keepOpen=false)
 Load the run from a NeXus file with a given group name. More...
 
 LogManager ()
 
 LogManager (const LogManager &other)
 
bool operator!= (const LogManager &other) const
 
LogManageroperator= (const LogManager &other)
 
bool operator== (const LogManager &other) const
 
void removeLogData (const std::string &name, const bool delproperty=true)
 Remove a named log entry. More...
 
void removeProperty (const std::string &name, bool delProperty=true)
 Remove a named property. More...
 
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. More...
 
void setStartAndEndTime (const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &end)
 Set the run start and end. More...
 
virtual void splitByTime (Kernel::TimeSplitterType &splitter, std::vector< LogManager * > outputs) const
 Split the logs based on the given intervals. More...
 
const Types::Core::DateAndTime startTime () const
 Return the run start time. More...
 
virtual ~LogManager ()
 Destructor. More...
 

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

Protected Member Functions

void loadNexus (::NeXus::File *file, const Mantid::Kernel::NexusHDF5Descriptor &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. More...
 

Protected Attributes

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

Static Protected Attributes

static const char * PROTON_CHARGE_LOG_NAME = "gd_prtn_chrg"
 Name of the log entry containing the proton charge when retrieved using getProtonCharge. More...
 

Private Attributes

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

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 96 of file LogManager.cpp.

◆ LogManager() [2/2]

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

Definition at line 101 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 122 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 219 of file LogManager.h.

References addProperty(), 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 233 of file LogManager.h.

References addProperty(), 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 79 of file LogManager.h.

Referenced by Mantid::DataHandling::LoadILLTOF2::addAllNexusFieldsAsProperties(), Mantid::DataHandling::LoadILLTOF2::addEnergyToRun(), Mantid::MDAlgorithms::ConvertToMD::addExperimentInfo(), Mantid::DataHandling::LoadILLTOF2::addFacility(), Mantid::DataHandling::ISISRunLogs::addPeriodLogs(), addProperty(), Mantid::Algorithms::SampleLogsBehaviour::addPropertyForList(), Mantid::Algorithms::SampleLogsBehaviour::addPropertyForTimeSeries(), Mantid::DataHandling::LoadILLTOF2::addPulseInterval(), WorkspaceCreationHelper::addTSPEntry(), Mantid::Crystal::LoadIsawPeaks::appendFile(), Mantid::MDAlgorithms::MDWSTransform::buildQTrahsf(), Mantid::Algorithms::ConvertUnits::convertViaTOF(), Mantid::Algorithms::AddLogDerivative::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::LoadILLSANS::loadDataFromD16ScanMonitors(), Mantid::DataHandling::LoadILLSANS::loadDataFromMonitors(), Mantid::DataHandling::LoadEMU< FD >::loadDopplerParameters(), Mantid::DataHandling::LoadILLSANS::loadMetaData(), Mantid::API::Run::loadNexusCommon(), Mantid::DataHandling::LoadILLIndirect2::loadNexusEntriesIntoProperties(), Mantid::DataHandling::LoadNexusLogs::loadNPeriods(), Mantid::DataHandling::LoadPLN::loadParameters(), Mantid::DataHandling::LoadMuonNexusV2::loadPeriodInfo(), Mantid::DataHandling::LoadISISNexusHelper::loadRunDetails(), Mantid::DataHandling::LoadMuonNexus1::loadRunDetails(), Mantid::DataHandling::LoadMuonNexus2::loadRunDetails(), Mantid::DataHandling::LoadLLB::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::LoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::DataHandling::LoadSwans::setMetaDataAsWorkspaceProperties(), Mantid::API::Run::setProtonCharge(), Mantid::API::MatrixWorkspace::setTitle(), Mantid::DataHandling::LoadEMU< Kernel::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 247 of file LogManager.cpp.

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

◆ clearLogs()

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

Clear the logs.

Definition at line 561 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 429 of file LogManager.cpp.

References getProperties().

◆ 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 412 of file LogManager.cpp.

References getProperties().

◆ endTime()

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

Return the run end time.

Return the run end time as given by the 'end_time' or 'run_end' property.

'end_time' is tried first, falling back to 'run_end' if the former isn't found.

Returns
The end time of the run
Exceptions
std::runtime_errorif neither property is defined

Definition at line 165 of file LogManager.cpp.

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

Referenced by export_Run(), and Mantid::API::ExperimentInfo::getAvailableWorkspaceEndDate().

◆ filterByLog()

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

Filter the run by the given boolean log.

It replaces all time series properties with filtered time series properties

Parameters
filter:: A boolean time series to filter each log on
excludedFromFiltering:: A string list of logs that will be excluded from filtering

Definition at line 231 of file LogManager.cpp.

References m_manager, and m_singleValueCache.

Referenced by Mantid::DataHandling::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 a run by time.

Takes out any TimeSeriesProperty log entries outside of the given absolute time range.

Parameters
start:: Absolute start time. Any log entries at times >= to this time are kept.
stop:: Absolute stop time. Any log entries at times < than this time are kept.

Reimplemented in Mantid::API::Run.

Definition at line 196 of file LogManager.cpp.

References m_manager.

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

◆ 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 576 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 565 of file LogManager.cpp.

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

Referenced by getInvalidValuesFilter(), and hasInvalidValuesFilter().

◆ 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 149 of file LogManager.h.

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 134 of file LogManager.h.

Referenced by export_Run(), 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 292 of file LogManager.cpp.

References m_manager.

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 287 of file LogManager.cpp.

References m_manager.

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

◆ getProperty()

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

◆ 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 381 of file LogManager.cpp.

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

Referenced by Mantid::DataHandling::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 349 of file LogManager.cpp.

References getProperty(), and m_singleValueCache.

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

◆ getPropertyValueAsType()

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

◆ 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 322 of file LogManager.cpp.

Referenced by export_Run().

◆ 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

Definition at line 308 of file LogManager.cpp.

References getProperty().

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

◆ 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 570 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 265 of file LogManager.cpp.

References m_manager.

Referenced by 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::Algorithms::ConvertSpectrumAxis2::getEfixed(), Mantid::DataHandling::ISISRunLogs::getLogNamesExcludedFromFiltering(), Mantid::Algorithms::PDDetermineCharacterizations::getLogValue(), Mantid::DataHandling::SaveGSS::getLogValue(), Mantid::Algorithms::Qxy::getQminFromWs(), Mantid::API::ExperimentInfo::getRunNumber(), hasInvalidValuesFilter(), Mantid::API::Run::integrateProtonCharge(), Mantid::API::Run::loadNexus(), Mantid::API::Run::loadNexusCommon(), Mantid::DataHandling::LoadNexusLogs::loadNPeriods(), Mantid::Algorithms::CopyLogs::mergeKeepExisting(), Mantid::Algorithms::CopyLogs::mergeReplaceExisting(), Mantid::DataHandling::LoadHelper::recurseAndAddNexusFieldsToWsRun(), Mantid::DataHandling::LoadEventNexus::runLoadNexusLogs(), Mantid::API::Run::saveNexus(), Mantid::API::Run::setProtonCharge(), Mantid::DataHandling::LoadILLDiffraction::setSampleLogs(), startTime(), Mantid::MDAlgorithms::LoadDNSSCD::updateProperties(), and Mantid::DataHandling::LoadISISNexus2::validateMultiPeriodLogs().

◆ loadNexus() [1/4]

void Mantid::API::LogManager::loadNexus ( ::NeXus::File *  file,
const Mantid::Kernel::NexusHDF5Descriptor 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 542 of file LogManager.cpp.

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

◆ 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 484 of file LogManager.cpp.

References loadNexus().

◆ loadNexus() [4/4]

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

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

Load the object from an open NeXus file.

Overload that uses NexusHDF5Descriptor for faster metadata lookup

Parameters
filecurrently opened NeXus file
groupcurrent group (relative name)
fileInfodescriptor with in-memory index with all entries
prefixindicates current group location in file (absolute name)
keepOpen

Not used.

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 471 of file LogManager.cpp.

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

◆ operator!=()

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

Definition at line 590 of file LogManager.cpp.

References m_manager.

◆ operator=()

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

Definition at line 109 of file LogManager.cpp.

References m_manager, and m_singleValueCache.

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

◆ operator==()

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

Definition at line 588 of file LogManager.cpp.

References m_manager.

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

◆ removeLogData()

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

◆ 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)
Returns
True if the property exists, false otherwise

Definition at line 275 of file LogManager.cpp.

References m_manager, and m_singleValueCache.

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 445 of file LogManager.cpp.

References Mantid::API::g_log, m_manager, 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 121 of file LogManager.cpp.

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

◆ splitByTime()

void Mantid::API::LogManager::splitByTime ( Kernel::TimeSplitterType splitter,
std::vector< LogManager * >  outputs 
) const
virtual

Split the logs based on the given intervals.

Split a run by time (splits the TimeSeriesProperties contained).

Parameters
splitter:: TimeSplitterType with the intervals and destinations.
outputs:: Vector of output runs.

Reimplemented in Mantid::API::Run.

Definition at line 209 of file LogManager.cpp.

References m_manager, and n.

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

◆ startTime()

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

Return the run start time.

Return the run start time as given by the 'start_time' or 'run_start' property.

'start_time' is tried first, falling back to 'run_start' if the former isn't found.

Returns
The start time of the run
Exceptions
std::runtime_errorif neither property is defined

Definition at line 133 of file LogManager.cpp.

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

Referenced by Mantid::Algorithms::SampleLogsBehaviour::addPropertyForTimeSeries(), export_Run(), Mantid::API::ExperimentInfo::getAvailableWorkspaceStartDate(), Mantid::Algorithms::AddSampleLog::getRunStart(), Mantid::API::ExperimentInfo::getWorkspaceStartDate(), 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
private

Cache for the retrieved single values.

Definition at line 205 of file LogManager.h.

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

◆ PROTON_CHARGE_LOG_NAME

const char * 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 201 of file LogManager.h.

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


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