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

Abstract base class for a Nexus data set. More...

#include <NexusClasses.h>

Inheritance diagram for Mantid::Nexus::NXDataSet:
Mantid::Nexus::NXObject Mantid::Nexus::NXDataSetTyped< T >

Public Member Functions

dimsize_t dim0 () const
 Returns the number of elements along the first dimension.
 
dimsize_t dim1 () const
 Returns the number of elements along the second dimension.
 
dimsize_t dim2 () const
 Returns the number of elements along the third dimension.
 
dimsize_t dim3 () const
 Returns the number of elements along the fourth dimension.
 
dimsize_t dims (std::size_t i) const
 Returns the number of elements along i-th dimension.
 
std::string name () const
 Returns the name of the data set.
 
std::string NX_class () const override
 NX class name. Returns "SDS".
 
 NXDataSet (NXClass const &parent, std::string const &name)
 Constructor.
 
void open ()
 Opens the data set. Does not read in any data. Call load(...) to load the data.
 
void openLocal ()
 Opens datasets faster but the parent group must be already open.
 
std::size_t rank () const
 Returns the rank (number of dimensions) of the data. The maximum is 4.
 
NXnumtype type () const
 Returns the Nexus type of the data. The types are defined in NexusFile_fwd.h.
 
- Public Member Functions inherited from Mantid::Nexus::NXObject
NexusAddress const & address () const
 Returns the absolute address to the object.
 
std::string name () const
 Returns the name of the object.
 
 NXObject (File *fileID, NXClass const *parent, std::string const &name)
 NXObject constructor.
 
 NXObject (std::shared_ptr< File > const &fileID, NXClass const *parent, std::string const &name)
 NXObject constructor.
 
virtual ~NXObject ()=default
 

Public Attributes

NXAttributes attributes
 Attributes.
 
- Public Attributes inherited from Mantid::Nexus::NXObject
std::shared_ptr< File > m_fileID
 Nexus file id.
 

Protected Member Functions

template<typename NumT >
void getData (NumT *data)
 Wrapper to the NXgetdata.
 
template<typename NumT >
void getSlab (NumT *data, DimVector const &start, DimVector const &size)
 Wrapper to the NXgetslab.
 

Private Member Functions

void getAttributes ()
 Reads in attributes.
 

Private Attributes

NXInfo m_info
 Holds the data info.
 

Additional Inherited Members

- Protected Attributes inherited from Mantid::Nexus::NXObject
NexusAddress m_address
 Keeps the absolute address to the object.
 
bool m_open
 Set to true if the object has been open.
 

Detailed Description

Abstract base class for a Nexus data set.

A typical use include:

There is no need to free the memory allocated by the NXDataSet as it is done at the destruction.

Definition at line 127 of file NexusClasses.h.

Constructor & Destructor Documentation

◆ NXDataSet()

Mantid::Nexus::NXDataSet::NXDataSet ( NXClass const &  parent,
std::string const &  name 
)

Constructor.

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

Definition at line 320 of file NexusClasses.cpp.

References m_info, name(), and Mantid::Nexus::NXInfo::nxname.

Member Function Documentation

◆ dim0()

dimsize_t Mantid::Nexus::NXDataSet::dim0 ( ) const

Returns the number of elements along the first dimension.

The size of the first dimension of data.

Returns
An integer indicating the size of the dimension.
Exceptions
out_of_rangeerror if requested on an object of rank 0

Definition at line 354 of file NexusClasses.cpp.

References Mantid::Nexus::NXInfo::dims, m_info, and Mantid::Nexus::NXInfo::rank.

Referenced by Mantid::DataHandling::LoadISISNexus2::exec(), Mantid::DataHandling::LoadNexusProcessed2::extractMappingInfoNew(), Mantid::DataHandling::LoadHelper::fillMovingWorkspace(), Mantid::DataHandling::LoadHelper::fillStaticWorkspace(), Mantid::DataHandling::LoadISISNexusHelper::findNumberOfSpectra(), Mantid::DataHandling::LoadISISNexus2::findSpectraDetRangeInFile(), Mantid::DataHandling::LoadILLSANS::getDataDimensions(), Mantid::DataHandling::LoadHelper::getTimeBinningFromNexusAddress(), Mantid::DataHandling::LoadILLSANS::getVariableTimeBinning(), Mantid::DataHandling::LoadSINQFocus::initWorkSpace(), Mantid::DataHandling::LoadMLZ::initWorkspace(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::DataHandling::LoadNexusProcessed::loadEntry(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), Mantid::DataHandling::LoadNexusProcessed::loadLeanElasticPeaksEntry(), Mantid::DataHandling::LoadNexusProcessed::loadNonEventEntry(), Mantid::DataHandling::LoadNexusProcessed::loadNumericColumn(), Mantid::DataHandling::ANSTO::Anxs::loadNXDataSet(), Mantid::DataHandling::LoadNexusProcessed::loadPeaksEntry(), Mantid::DataHandling::LoadISISNexus2::loadPeriodData(), Mantid::DataHandling::LoadISISNexusHelper::loadTimeData(), Mantid::DataHandling::LoadNexusProcessed::loadV3DColumn(), Mantid::DataHandling::LoadILLTOF3::prepareAxis(), and Mantid::DataHandling::LoadNexusProcessed::readBinMasking().

◆ dim1()

dimsize_t Mantid::Nexus::NXDataSet::dim1 ( ) const

◆ dim2()

dimsize_t Mantid::Nexus::NXDataSet::dim2 ( ) const

◆ dim3()

dimsize_t Mantid::Nexus::NXDataSet::dim3 ( ) const

Returns the number of elements along the fourth dimension.

The size of the fourth dimension of data.

Returns
An integer indicating the size of the dimension
Exceptions
out_of_rangeerror if requested on an object of rank < 4

Definition at line 390 of file NexusClasses.cpp.

References Mantid::Nexus::NXInfo::dims, m_info, and Mantid::Nexus::NXInfo::rank.

Referenced by Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), and Mantid::Nexus::NXDataSetTyped< T >::load().

◆ dims()

dimsize_t Mantid::Nexus::NXDataSet::dims ( std::size_t  i) const
inline

Returns the number of elements along i-th dimension.

Definition at line 140 of file NexusClasses.h.

◆ getAttributes()

void Mantid::Nexus::NXDataSet::getAttributes ( )
private

◆ getData()

template<typename NumT >
void Mantid::Nexus::NXDataSet::getData ( NumT *  data)
inlineprotected

Wrapper to the NXgetdata.

Parameters
data:: The pointer to the buffer accepting the data from the file.
Exceptions
runtime_errorif the operation fails.

Definition at line 163 of file NexusClasses.h.

References name.

Referenced by Mantid::Nexus::NXDataSetTyped< T >::load().

◆ getSlab()

template<typename NumT >
void Mantid::Nexus::NXDataSet::getSlab ( NumT *  data,
DimVector const &  start,
DimVector const &  size 
)
inlineprotected

Wrapper to the NXgetslab.

Parameters
data:: The pointer to the buffer accepting the data from the file.
start:: The array of starting indeces to read in from the file. The size of the array must be equal to the rank of the data.
size:: The array of numbers of data elements to read along each dimenstion. The number of dimensions (the size of the array) must be equal to the rank of the data.
Exceptions
runtime_errorif the operation fails.

Definition at line 179 of file NexusClasses.h.

References name.

Referenced by Mantid::Nexus::NXDataSetTyped< T >::load(), and Mantid::Nexus::NXDataSetTyped< T >::load().

◆ name()

std::string Mantid::Nexus::NXDataSet::name ( ) const
inline

Returns the name of the data set.

Definition at line 150 of file NexusClasses.h.

Referenced by NXDataSet(), open(), and openLocal().

◆ NX_class()

std::string Mantid::Nexus::NXDataSet::NX_class ( ) const
inlineoverridevirtual

NX class name. Returns "SDS".

Implements Mantid::Nexus::NXObject.

Definition at line 132 of file NexusClasses.h.

◆ open()

void Mantid::Nexus::NXDataSet::open ( )

◆ openLocal()

void Mantid::Nexus::NXDataSet::openLocal ( )

Opens datasets faster but the parent group must be already open.

Definition at line 342 of file NexusClasses.cpp.

References getAttributes(), Mantid::Nexus::NXObject::m_fileID, m_info, and name().

Referenced by Mantid::DataHandling::LoadNexusProcessed::doAccelleratedMultiPeriodLoading().

◆ rank()

std::size_t Mantid::Nexus::NXDataSet::rank ( ) const
inline

◆ type()

NXnumtype Mantid::Nexus::NXDataSet::type ( ) const
inline

Returns the Nexus type of the data. The types are defined in NexusFile_fwd.h.

Definition at line 152 of file NexusClasses.h.

Member Data Documentation

◆ attributes

NXAttributes Mantid::Nexus::NXDataSet::attributes

◆ m_info

NXInfo Mantid::Nexus::NXDataSet::m_info
private

Holds the data info.

Definition at line 186 of file NexusClasses.h.

Referenced by dim0(), dim1(), dim2(), dim3(), NXDataSet(), open(), and openLocal().


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