|
Mantid
|
Abstract base class for a Nexus data set. More...
#include <NexusClasses.h>
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. | |
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.
| Mantid::Nexus::NXDataSet::NXDataSet | ( | NXClass const & | parent, |
| std::string const & | name | ||
| ) |
Constructor.
| 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.
| dimsize_t Mantid::Nexus::NXDataSet::dim0 | ( | ) | const |
Returns the number of elements along the first dimension.
The size of the first dimension of data.
| out_of_range | error 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().
| dimsize_t Mantid::Nexus::NXDataSet::dim1 | ( | ) | const |
Returns the number of elements along the second dimension.
The size of the second dimension of data.
| out_of_range | error if requested on an object of rank < 2 |
Definition at line 366 of file NexusClasses.cpp.
References Mantid::Nexus::NXInfo::dims, m_info, and Mantid::Nexus::NXInfo::rank.
Referenced by Mantid::DataHandling::LoadNexusProcessed::doAccelleratedMultiPeriodLoading(), Mantid::DataHandling::LoadQKK::exec(), Mantid::DataHandling::LoadILLDiffraction::fillMovingInstrumentScan(), Mantid::DataHandling::LoadHelper::fillMovingWorkspace(), Mantid::DataHandling::LoadILLDiffraction::fillStaticInstrumentScan(), Mantid::DataHandling::LoadHelper::fillStaticWorkspace(), Mantid::DataHandling::LoadILLSANS::getDataDimensions(), 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::loadBlock(), Mantid::DataHandling::LoadNexusProcessed::loadBlock(), Mantid::DataHandling::LoadNexusProcessed::loadBlock(), Mantid::DataHandling::LoadNexusProcessed::loadEntry(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), Mantid::DataHandling::LoadNexusProcessed::loadNonEventEntry(), Mantid::Nexus::NXDataSetTyped< T >::operator()(), and Mantid::Nexus::NXDataSetTyped< T >::operator()().
| dimsize_t Mantid::Nexus::NXDataSet::dim2 | ( | ) | const |
Returns the number of elements along the third dimension.
The size of the third dimension of data.
| out_of_range | error if requested on an object of rank < 3 |
Definition at line 378 of file NexusClasses.cpp.
References Mantid::Nexus::NXInfo::dims, m_info, and Mantid::Nexus::NXInfo::rank.
Referenced by Mantid::DataHandling::LoadQKK::exec(), Mantid::DataHandling::LoadILLDiffraction::fillMovingInstrumentScan(), Mantid::DataHandling::LoadHelper::fillMovingWorkspace(), Mantid::DataHandling::LoadILLDiffraction::fillStaticInstrumentScan(), Mantid::DataHandling::LoadHelper::fillStaticWorkspace(), Mantid::DataHandling::LoadISISNexus2::findSpectraDetRangeInFile(), Mantid::DataHandling::LoadILLSANS::getDataDimensions(), Mantid::DataHandling::LoadMLZ::initWorkspace(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), and Mantid::Nexus::NXDataSetTyped< T >::operator()().
| dimsize_t Mantid::Nexus::NXDataSet::dim3 | ( | ) | const |
Returns the number of elements along the fourth dimension.
The size of the fourth dimension of data.
| out_of_range | error 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().
|
inline |
Returns the number of elements along i-th dimension.
Definition at line 140 of file NexusClasses.h.
|
private |
Reads in attributes.
Definition at line 104 of file NexusClasses.cpp.
References attributes, NXnumtype::CHAR, NXnumtype::INT16, NXnumtype::INT32, Mantid::Nexus::NXObject::m_fileID, Mantid::Nexus::NXAttributes::set(), and NXnumtype::UINT16.
Referenced by open(), and openLocal().
|
inlineprotected |
Wrapper to the NXgetdata.
| data | :: The pointer to the buffer accepting the data from the file. |
| runtime_error | if the operation fails. |
Definition at line 163 of file NexusClasses.h.
References name.
Referenced by Mantid::Nexus::NXDataSetTyped< T >::load().
|
inlineprotected |
Wrapper to the NXgetslab.
| 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. |
| runtime_error | if 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().
|
inline |
Returns the name of the data set.
Definition at line 150 of file NexusClasses.h.
Referenced by NXDataSet(), open(), and openLocal().
|
inlineoverridevirtual |
NX class name. Returns "SDS".
Implements Mantid::Nexus::NXObject.
Definition at line 132 of file NexusClasses.h.
| void Mantid::Nexus::NXDataSet::open | ( | ) |
Opens the data set. Does not read in any data. Call load(...) to load the data.
Definition at line 331 of file NexusClasses.cpp.
References getAttributes(), Mantid::Nexus::NXObject::m_address, Mantid::Nexus::NXObject::m_fileID, m_info, name(), Mantid::Nexus::NexusAddress::parent_path(), and Mantid::Nexus::NexusAddress::root().
Referenced by Mantid::DataHandling::LoadISISNexus2::loadPeriodData(), Mantid::Nexus::NXData::openData(), and Mantid::Nexus::NXClass::openNXDataSet().
| 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().
|
inline |
Returns the rank (number of dimensions) of the data. The maximum is 4.
Definition at line 138 of file NexusClasses.h.
Referenced by Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::DataHandling::LoadNexusProcessed::loadEntry(), and Mantid::DataHandling::LoadNexusProcessed::loadEventEntry().
|
inline |
Returns the Nexus type of the data. The types are defined in NexusFile_fwd.h.
Definition at line 152 of file NexusClasses.h.
| NXAttributes Mantid::Nexus::NXDataSet::attributes |
Attributes.
Definition at line 154 of file NexusClasses.h.
Referenced by getAttributes(), Mantid::DataHandling::LoadNexusProcessed::loadEntry(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::loadFirstGoodDataFromNexus(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::loadLastGoodDataFromNexus(), Mantid::DataHandling::LoadNexusProcessed::loadLeanElasticPeaksEntry(), Mantid::DataHandling::LoadNexusProcessed::loadNonEventEntry(), Mantid::DataHandling::LoadNexusProcessed::loadNumericColumn(), Mantid::DataHandling::LoadNexusProcessed::loadPeaksEntry(), Mantid::DataHandling::LoadISISNexusHelper::loadRunDetails(), Mantid::DataHandling::LoadNexusProcessed::loadV3DColumn(), Mantid::DataHandling::LoadNexusProcessed::loadVectorColumn(), and Mantid::Nexus::NXData::openData().
|
private |
Holds the data info.
Definition at line 186 of file NexusClasses.h.
Referenced by dim0(), dim1(), dim2(), dim3(), NXDataSet(), open(), and openLocal().