Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
Mantid::NeXus::NXLog Class Reference

Implements NXlog Nexus class. More...

#include <NexusClasses.h>

Inheritance diagram for Mantid::NeXus::NXLog:
Mantid::NeXus::NXClass Mantid::NeXus::NXObject

Public Member Functions

Kernel::PropertycreateProperty ()
 Creates a property wrapper around the log. More...
 
Kernel::PropertycreateTimeSeries (const std::string &start_time="", const std::string &new_name="")
 Creates a TimeSeriesProperty and returns a pointer to it. More...
 
std::string NX_class () const override
 Nexus class id. More...
 
 NXLog (const NXClass &parent, const std::string &name)
 Constructor. More...
 
- Public Member Functions inherited from Mantid::NeXus::NXClass
void close ()
 Close this class. More...
 
bool containsDataSet (const std::string &query) const
 Returns whether an individual dataset is present. More...
 
bool containsGroup (const std::string &query) const
 Returns whether an individual group (or group) is present. More...
 
std::vector< NXInfo > & datasets () const
 Returns a list of all datasets in this NXClass. More...
 
NXInfo getDataSetInfo (const std::string &name) const
 Returns NXInfo for a dataset. More...
 
double getDouble (const std::string &name) const
 Returns a double. More...
 
float getFloat (const std::string &name) const
 Returns a float. More...
 
int getInt (const std::string &name) const
 Returns a int. More...
 
NXClassInfo getNextEntry ()
 Returns the class information about the next entry (class or dataset) in this class. More...
 
std::string getString (const std::string &name) const
 Returns a string. More...
 
std::vector< NXClassInfo > & groups () const
 Returns a list of all classes (or groups) in this NXClass. More...
 
bool isValid (const std::string &path) const
 Check if a path exists relative to the current class path. More...
 
std::string NX_class () const override
 The NX class identifier. More...
 
 NXClass (const NXClass &parent, const std::string &name)
 Constructor. More...
 
void open ()
 Opens this NXClass using NXopengrouppath. Can be slow (or is slow) More...
 
bool openLocal (const std::string &nxclass="")
 Opens this NXClass using NXopengroup. More...
 
NXChar openNXChar (const std::string &name) const
 Creates and opens a char dataset. More...
 
template<class NX >
NX openNXClass (const std::string &name) const
 Templated method for creating derived NX classes. More...
 
template<class T >
NXDataSetTyped< T > openNXDataSet (const std::string &name) const
 Templated method for creating datasets. More...
 
NXDouble openNXDouble (const std::string &name) const
 Creates and opens a double dataset. More...
 
NXFloat openNXFloat (const std::string &name) const
 Creates and opens a float dataset. More...
 
NXClass openNXGroup (const std::string &name) const
 Creates and opens an arbitrary (non-standard) class (group). More...
 
NXInt openNXInt (const std::string &name) const
 Creates and opens an integer dataset. More...
 
NXSize openNXSize (const std::string &name) const
 Creates and opens a size_t dataset. More...
 
void reset ()
 Creates a new object in the NeXus file at path path. More...
 
- Public Member Functions inherited from Mantid::NeXus::NXObject
std::string name () const
 Returns the name of the object. More...
 
virtual std::string NX_class () const =0
 Return the NX class name for a class (HDF group) or "SDS" for a data set;. More...
 
 NXObject (const NXhandle fileID, const NXClass *parent, const std::string &name)
 NXObject constructor. More...
 
std::string path () const
 Returns the absolute path to the object. More...
 
virtual ~NXObject ()=default
 

Private Member Functions

Kernel::PropertycreateSingleValueProperty ()
 Creates a single value property of the log. More...
 
template<class NX_TYPE , class TIME_TYPE >
Kernel::PropertyloadValues (const std::string &logName, NX_TYPE &value, Types::Core::DateAndTime start_t, const TIME_TYPE &times)
 Loads the values in the log into the workspace. More...
 
template<class TYPE >
Kernel::PropertyparseTimeSeries (const std::string &logName, const TYPE &times, const std::string &time0="")
 Parse a time series. More...
 

Additional Inherited Members

- Public Attributes inherited from Mantid::NeXus::NXObject
NXAttributes attributes
 Attributes. More...
 
NXhandle m_fileID
 Nexus file id. More...
 
- Protected Member Functions inherited from Mantid::NeXus::NXClass
void clear ()
 Deletes content of m_groups and m_datasets. More...
 
void readAllInfo ()
 Fills in m_groups and m_datasets. More...
 
- Protected Attributes inherited from Mantid::NeXus::NXClass
std::shared_ptr< std::vector< NXInfo > > m_datasets
 Holds info about the datasets in this NXClass. More...
 
std::shared_ptr< std::vector< NXClassInfo > > m_groups
 Holds info about the child NXClasses. More...
 
- Protected Attributes inherited from Mantid::NeXus::NXObject
bool m_open
 Set to true if the object has been open. More...
 
std::string m_path
 Keeps the absolute path to the object. More...
 

Detailed Description

Implements NXlog Nexus class.

Definition at line 629 of file NexusClasses.h.

Constructor & Destructor Documentation

◆ NXLog()

Mantid::NeXus::NXLog::NXLog ( const NXClass parent,
const std::string &  name 
)
inline

Constructor.

Parameters
parent:: The parent Nexus class. In terms of HDF it is the group containing the NXClass.
name:: The name of the NXClass relative to its parent

Definition at line 636 of file NexusClasses.h.

Member Function Documentation

◆ createProperty()

Kernel::Property * Mantid::NeXus::NXLog::createProperty ( )

Creates a property wrapper around the log.

Creates a property wrapper around the log entry.

Returns
A valid property pointer or NULL

Definition at line 564 of file NexusClasses.cpp.

References createSingleValueProperty(), createTimeSeries(), Mantid::NeXus::NXClass::getDataSetInfo(), and Mantid::NeXus::NXInfo::stat.

◆ createSingleValueProperty()

Kernel::Property * Mantid::NeXus::NXLog::createSingleValueProperty ( )
private

Creates a single value property of the log.

Returns
A pointer to a newly created property wrapped around the log entry

Definition at line 576 of file NexusClasses.cpp.

References Mantid::NeXus::NXClass::getDataSetInfo(), Mantid::NeXus::NXClass::getDouble(), Mantid::NeXus::NXClass::getInt(), Mantid::NeXus::NXClass::getString(), Mantid::NeXus::NXObject::name(), Mantid::NeXus::NXInfo::type, and value.

Referenced by createProperty().

◆ createTimeSeries()

Kernel::Property * Mantid::NeXus::NXLog::createTimeSeries ( const std::string &  start_time = "",
const std::string &  new_name = "" 
)

Creates a TimeSeriesProperty and returns a pointer to it.

createTimeSeries Create a TimeSeries property form the records of the NXLog group.

Times are in dataset "time" and the values are in dataset "value"

Parameters
start_time:: If the "time" dataset does not have the "start" attribute sets the start time for the series.
new_name:: If not empty it is used as the TimeSeries property name
Returns
The property or NULL

Definition at line 609 of file NexusClasses.cpp.

References Mantid::NeXus::NXObject::attributes, Mantid::NeXus::NXDataSet::dim0(), Mantid::NeXus::NXClass::getDataSetInfo(), Mantid::NeXus::NXDataSetTyped< T >::load(), Mantid::NeXus::NXObject::name(), Mantid::NeXus::NXDataSet::openLocal(), parseTimeSeries(), and Mantid::NeXus::NXInfo::type.

Referenced by createProperty(), and Mantid::DataHandling::LoadMuonNexus2::loadLogs().

◆ loadValues()

template<class NX_TYPE , class TIME_TYPE >
Kernel::Property * Mantid::NeXus::NXLog::loadValues ( const std::string &  logName,
NX_TYPE &  value,
Types::Core::DateAndTime  start_t,
const TIME_TYPE &  times 
)
inlineprivate

Loads the values in the log into the workspace.

Parameters
logName:: the name of the log
value:: the value
start_t:: the start time
times:: the array of time offsets
Returns
a property pointer

Definition at line 708 of file NexusClasses.h.

References value.

◆ NX_class()

std::string Mantid::NeXus::NXLog::NX_class ( ) const
inlineoverridevirtual

Nexus class id.

Reimplemented from Mantid::NeXus::NXClass.

Definition at line 638 of file NexusClasses.h.

◆ parseTimeSeries()

template<class TYPE >
Kernel::Property * Mantid::NeXus::NXLog::parseTimeSeries ( const std::string &  logName,
const TYPE times,
const std::string &  time0 = "" 
)
inlineprivate

Parse a time series.

Definition at line 649 of file NexusClasses.h.

References Mantid::NeXus::NXInfo::dims, Mantid::NeXus::NXInfo::type, and value.

Referenced by createTimeSeries().


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