|
Mantid
|
Templated class implementation of NXDataSet. More...
#include <NexusClasses.h>
Public Member Functions | |
| void | load () |
| Read all of the datablock in. | |
| void | load (dimsize_t const blocksize, dimsize_t const i) |
| void | load (dimsize_t const blocksize, dimsize_t const i, dimsize_t const j) |
| Implementation of the virtual NXDataSet::load(...) method. | |
| NXDataSetTyped (NXClass const &parent, std::string const &name) | |
| Constructor. | |
| T * | operator() () |
| const T * | operator() () const |
| Returns a pointer to the internal data buffer. | |
| T & | operator() (std::size_t i, std::size_t j) |
| const T & | operator() (std::size_t i, std::size_t j) const |
| Returns a value assuming the data is a two-dimensional array. | |
| T & | operator() (std::size_t i, std::size_t j, std::size_t k) |
| const T & | operator() (std::size_t i, std::size_t j, std::size_t k) const |
| Returns a value assuming the data is a tree-dimensional array. | |
| T & | operator[] (std::size_t i) |
| const T & | operator[] (std::size_t i) const |
| Returns the i-th value in the internal buffer. | |
| std::size_t | size () const |
| Returns the size of the data buffer. | |
| container_T< T > & | vecBuffer () |
| Returns a the internal buffer. | |
Public Member Functions inherited from Mantid::Nexus::NXDataSet | |
| 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 |
Private Member Functions | |
| void | alloc (dimsize_t new_size) |
| Allocates memory for the data buffer. | |
| void | rangeError () const |
| A shortcut to "throw std::range_error("Nexus dataset range error");". | |
Private Attributes | |
| container_T< T > | m_data |
| The data buffer. | |
| std::size_t | m_size |
| The buffer size. | |
Additional Inherited Members | |
Public Attributes inherited from Mantid::Nexus::NXDataSet | |
| NXAttributes | attributes |
| Attributes. | |
Public Attributes inherited from Mantid::Nexus::NXObject | |
| std::shared_ptr< File > | m_fileID |
| Nexus file id. | |
Protected Member Functions inherited from Mantid::Nexus::NXDataSet | |
| 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. | |
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. | |
Templated class implementation of NXDataSet.
After loading the data it can be accessed via operators () and [].
Definition at line 196 of file NexusClasses.h.
|
inline |
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 205 of file NexusClasses.h.
|
inlineprivate |
Allocates memory for the data buffer.
| new_size | :: The number of elements to allocate. |
Definition at line 401 of file NexusClasses.h.
References Mantid::Nexus::NXObject::address(), Mantid::Nexus::NXDataSetTyped< T >::m_data, and Mantid::Nexus::NXDataSetTyped< T >::m_size.
Referenced by Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), and Mantid::Nexus::NXDataSetTyped< T >::load().
|
inline |
Read all of the datablock in.
Definition at line 276 of file NexusClasses.h.
References Mantid::Nexus::NXDataSetTyped< T >::alloc(), Mantid::Nexus::NXDataSet::dim0(), Mantid::Nexus::NXDataSet::dim1(), Mantid::Nexus::NXDataSet::dim2(), Mantid::Nexus::NXDataSet::dim3(), Mantid::Nexus::NXDataSet::getData(), Mantid::Nexus::NXDataSetTyped< T >::m_data, and Mantid::Nexus::NXDataSet::rank().
Referenced by Mantid::DataHandling::LoadNexusProcessed::doAccelleratedMultiPeriodLoading(), Mantid::DataHandling::LoadISISNexus2::exec(), Mantid::DataHandling::LoadQKK::exec(), Mantid::DataHandling::LoadNexusProcessed2::extractMappingInfoNew(), Mantid::DataHandling::LoadISISNexusHelper::findDetectorIDsAndSpectrumNumber(), Mantid::DataHandling::LoadISISNexusHelper::findNumberOfSpectra(), Mantid::Nexus::NXClass::getDouble(), Mantid::Nexus::NXClass::getFloat(), Mantid::Nexus::NXClass::getInt(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::getIntVector(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::getPeriodTotalCounts(), Mantid::DataHandling::LoadHelper::getTimeBinningFromNexusAddress(), Mantid::DataHandling::LoadILLSANS::getVariableTimeBinning(), Mantid::DataHandling::LoadILLReflectometry::initNames(), Mantid::DataHandling::LoadILLPolarizedDiffraction::initStaticWorkspace(), Mantid::DataHandling::LoadILLSANS::initWorkSpaceD11B(), Mantid::DataHandling::LoadILLSANS::initWorkSpaceD22B(), Mantid::DataHandling::LoadILLSANS::initWorkSpaceD33(), Mantid::DataHandling::LoadNexusProcessed::loadBlock(), Mantid::DataHandling::LoadNexusProcessed::loadBlock(), Mantid::DataHandling::LoadNexusProcessed::loadBlock(), Mantid::DataHandling::LoadISISNexus2::loadBlock(), Mantid::DataHandling::LoadILLIndirect2::loadDataDetails(), Mantid::DataHandling::LoadILLReflectometry::loadDataDetails(), Mantid::DataHandling::LoadMLZ::loadDataIntoTheWorkSpace(), Mantid::DataHandling::LoadSINQFocus::loadDataIntoTheWorkSpace(), Mantid::DataHandling::LoadILLDiffraction::loadDataScan(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::loadDeadTimesFromNexus(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::loadDetectorGroupingFromNexus(), Mantid::DataHandling::LoadNexusProcessed::loadEntry(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::loadGoodFramesDataFromNexus(), Mantid::DataHandling::LoadNexusProcessed::loadLeanElasticPeaksEntry(), Mantid::DataHandling::LoadNexusProcessed::loadNonSpectraAxis(), Mantid::DataHandling::LoadNexusProcessed::loadNumericColumn(), Mantid::DataHandling::LoadBBY::loadNXDataSet(), Mantid::DataHandling::ANSTO::Anxs::loadNXDataSet(), Mantid::DataHandling::loadNXDataSet(), Mantid::DataHandling::LoadNexusProcessed::loadPeaksEntry(), Mantid::DataHandling::LoadISISNexus2::loadPeriodData(), Mantid::DataHandling::LoadISISNexusHelper::loadRunDetails(), Mantid::DataHandling::LoadISISNexusHelper::loadSampleGeometry(), Mantid::DataHandling::LoadILLTOF3::loadTimeDetails(), Mantid::DataHandling::LoadMLZ::loadTimeDetails(), Mantid::DataHandling::LoadILLPolarizedDiffraction::loadTwoThetaDetectors(), Mantid::DataHandling::LoadNexusProcessed::loadV3DColumn(), Mantid::DataHandling::LoadNexusProcessed::loadVectorColumn(), Mantid::DataHandling::LoadMLZ::maskDetectors(), Mantid::DataHandling::LoadILLIndirect2::moveSingleDetectors(), Mantid::DataHandling::LoadILLPolarizedDiffraction::moveTwoTheta(), Mantid::DataHandling::LoadILLPolarizedDiffraction::prepareAxes(), Mantid::DataHandling::LoadILLTOF3::prepareAxis(), Mantid::DataHandling::LoadNexusProcessed::readBinMasking(), and Mantid::DataHandling::LoadILLReflectometry::sampleAngle().
|
inline |
Definition at line 307 of file NexusClasses.h.
References Mantid::Nexus::NXDataSetTyped< T >::alloc(), Mantid::Nexus::NXDataSet::dim0(), Mantid::Nexus::NXDataSet::dim1(), Mantid::Nexus::NXDataSet::dim2(), Mantid::Nexus::NXDataSet::dim3(), Mantid::Nexus::NXDataSet::getSlab(), Mantid::Geometry::m, Mantid::Nexus::NXDataSetTyped< T >::m_data, n, Mantid::Nexus::NXDataSetTyped< T >::rangeError(), and Mantid::Nexus::NXDataSet::rank().
|
inline |
Implementation of the virtual NXDataSet::load(...) method.
Internally the data are stored as a 1d array. If the data are loaded in chunks the newly read in data replace the old ones. The actual rank of the loaded data is equal or less than the rank of the dataset (returned by rank() method).
| blocksize | :: The size of the block of data that should be read. Note that this is only used for rank 2 and 3 datasets currently |
| i | :: Calling load with non-negative i reads in a chunk of dimension rank()-1 and i is the index of the chunk. The rank of the data must be >= 1 |
| j | :: Non-negative value makes it read a chunk of dimension rank()-2. i and j are its indeces. The rank of the data must be >= 2 |
Definition at line 357 of file NexusClasses.h.
References Mantid::Nexus::NXDataSetTyped< T >::alloc(), Mantid::Nexus::NXDataSet::dim0(), Mantid::Nexus::NXDataSet::dim1(), Mantid::Nexus::NXDataSet::dim2(), Mantid::Nexus::NXDataSet::dim3(), Mantid::Nexus::NXDataSet::getSlab(), Mantid::Geometry::m, Mantid::Nexus::NXDataSetTyped< T >::m_data, n, Mantid::Nexus::NXDataSetTyped< T >::rangeError(), and Mantid::Nexus::NXDataSet::rank().
|
inline |
Definition at line 218 of file NexusClasses.h.
References Mantid::Nexus::NXObject::address(), and Mantid::Nexus::NXDataSetTyped< T >::m_data.
|
inline |
Returns a pointer to the internal data buffer.
| runtime_error | exception if the data have not been loaded / initialized. |
Definition at line 212 of file NexusClasses.h.
References Mantid::Nexus::NXObject::address(), and Mantid::Nexus::NXDataSetTyped< T >::m_data.
|
inline |
Definition at line 251 of file NexusClasses.h.
|
inline |
Returns a value assuming the data is a two-dimensional array.
| runtime_error | if the data have not been loaded / initialized. |
| range_error | if the indeces point outside the buffer. |
Definition at line 250 of file NexusClasses.h.
References Mantid::Nexus::NXDataSet::dim1(), and Mantid::Nexus::NXDataSetTyped< T >::operator[]().
|
inline |
Definition at line 266 of file NexusClasses.h.
|
inline |
Returns a value assuming the data is a tree-dimensional array.
| runtime_error | if the data have not been loaded / initialized. |
| range_error | if the indeces point outside the buffer. |
Definition at line 263 of file NexusClasses.h.
References Mantid::Nexus::NXDataSet::dim1(), Mantid::Nexus::NXDataSet::dim2(), and Mantid::Nexus::NXDataSetTyped< T >::operator[]().
|
inline |
Definition at line 240 of file NexusClasses.h.
|
inline |
Returns the i-th value in the internal buffer.
| i | :: The linear index of the data element |
| runtime_error | if the data have not been loaded / initialized. |
| range_error | if the index is greater than the buffer size. |
Definition at line 232 of file NexusClasses.h.
References Mantid::Nexus::NXObject::address(), Mantid::Nexus::NXDataSetTyped< T >::m_data, Mantid::Nexus::NXDataSetTyped< T >::m_size, and Mantid::Nexus::NXDataSetTyped< T >::rangeError().
Referenced by Mantid::Nexus::NXDataSetTyped< T >::operator()(), and Mantid::Nexus::NXDataSetTyped< T >::operator()().
|
inlineprivate |
A shortcut to "throw std::range_error("Nexus dataset range error");".
Definition at line 417 of file NexusClasses.h.
Referenced by Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), and Mantid::Nexus::NXDataSetTyped< T >::operator[]().
|
inline |
Returns the size of the data buffer.
Definition at line 273 of file NexusClasses.h.
References Mantid::Nexus::NXDataSetTyped< T >::m_size.
Referenced by Mantid::DataHandling::LoadNexusProcessed::loadEntry(), and Mantid::DataHandling::LoadMLZ::maskDetectors().
|
inline |
Returns a the internal buffer.
Definition at line 271 of file NexusClasses.h.
References Mantid::Nexus::NXDataSetTyped< T >::m_data.
Referenced by Mantid::DataHandling::LoadISISNexus2::exec(), Mantid::DataHandling::LoadNexusProcessed2::extractMappingInfoNew(), Mantid::DataHandling::LoadMuonNexusV2NexusHelper::getPeriodTotalCounts(), Mantid::DataHandling::LoadNexusProcessed::loadEventEntry(), and Mantid::DataHandling::LoadMuonNexusV2NexusHelper::loadTimeZeroListFromNexusFile().
|
private |
The data buffer.
Definition at line 419 of file NexusClasses.h.
Referenced by Mantid::Nexus::NXDataSetTyped< T >::alloc(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::load(), Mantid::Nexus::NXDataSetTyped< T >::operator()(), Mantid::Nexus::NXDataSetTyped< T >::operator()(), Mantid::Nexus::NXDataSetTyped< T >::operator[](), and Mantid::Nexus::NXDataSetTyped< T >::vecBuffer().
|
private |
The buffer size.
Definition at line 420 of file NexusClasses.h.
Referenced by Mantid::Nexus::NXDataSetTyped< T >::alloc(), Mantid::Nexus::NXDataSetTyped< T >::operator[](), and Mantid::Nexus::NXDataSetTyped< T >::size().