Mantid
Loading...
Searching...
No Matches
Functions
Mantid::DataHandling::LegacyLoadHelper Namespace Reference

Functions

void addNexusFieldsToWsRun (LegacyNexus::File &filehandle, API::Run &runDetails)
 Add properties from a nexus file to the workspace run.
 
template<typename NumericType >
void addNumericProperty (LegacyNexus::File &filehandle, const LegacyNexus::Info &nxinfo, const std::string &property_name, API::Run &runDetails)
 
void fillStaticWorkspace (const API::MatrixWorkspace_sptr &ws, const LegacyNexus::NXInt &data, const std::vector< double > &xAxis, int64_t initialSpectrum=0, bool pointData=false, const std::vector< int > &detectorIDs=std::vector< int >(), const std::set< int > &acceptedDetectorIDs=std::set< int >(), const std::tuple< short, short, short > &axisOrder=std::tuple< short, short, short >(0, 1, 2))
 Fills workspace with histogram data from provided data structure.
 
std::string findInstrumentNexusAddress (const LegacyNexus::NXEntry &firstEntry)
 Finds the address for the instrument name in the nexus file Usually of the form: entry0/<NXinstrument class>/name.
 
LegacyNexus::NXDouble getDoubleDataset (const LegacyNexus::NXEntry &entry, const std::string &groupName)
 Fetches NXDouble data from the requested group name in the entry provided.
 
LegacyNexus::NXInt getIntDataset (const LegacyNexus::NXEntry &entry, const std::string &groupName)
 Fetches NXInt data from the requested group name in the entry provided.
 
void recurseAndAddNexusFieldsToWsRun (LegacyNexus::File &filehandle, API::Run &runDetails, const std::string &parent_name, const std::string &parent_class, int level)
 Recursively add properties from a nexus file to the workspace run.
 

Function Documentation

◆ addNexusFieldsToWsRun()

void Mantid::DataHandling::LegacyLoadHelper::addNexusFieldsToWsRun ( LegacyNexus::File &  filehandle,
API::Run runDetails 
)

Add properties from a nexus file to the workspace run.

API entry for recursive routine below

Parameters
filehandle:: Nexus file handle to be parsed, just after an NXopengroup
runDetails:: where to add properties

Definition at line 291 of file LoadILLTOF2.cpp.

Referenced by Mantid::DataHandling::LoadILLTOF2::addAllNexusFieldsAsProperties().

◆ addNumericProperty()

template<typename NumericType >
void Mantid::DataHandling::LegacyLoadHelper::addNumericProperty ( LegacyNexus::File &  filehandle,
const LegacyNexus::Info &  nxinfo,
const std::string &  property_name,
API::Run runDetails 
)

◆ fillStaticWorkspace()

void Mantid::DataHandling::LegacyLoadHelper::fillStaticWorkspace ( const API::MatrixWorkspace_sptr ws,
const LegacyNexus::NXInt &  data,
const std::vector< double > &  xAxis,
int64_t  initialSpectrum = 0,
bool  pointData = false,
const std::vector< int > &  detectorIDs = std::vector<int>(),
const std::set< int > &  acceptedDetectorIDs = std::set<int>(),
const std::tuple< short, short, short > &  axisOrder = std::tuple<short, short, short>(0, 1, 2) 
)

Fills workspace with histogram data from provided data structure.

Parameters
wsA MatrixWorkspace to be filled with data
dataData object to extract counts from
xAxisX axis values to be assigned to each spectrum
initialSpectrumInitial spectrum number, optional and defaults to 0
pointDataSwitch to decide whether the data is going to be a histogram or point data, defaults to false (histogram)
detectorIDsVector of detector IDs to override the default spectrum number, defaults to empty (IDs equal to index)
acceptedDetectorIDsSet of accepted detector IDs, defaults to empty (all accepted)
axisOrderTuple containing information at which position in data one can find tubes, pixels, and channels (scans), defaults to 0,1,2 meaning default order of tube-pixel-channel

Definition at line 94 of file LoadILLTOF2.cpp.

References Mantid::DataHandling::LoadHelper::loadingOrder().

Referenced by Mantid::DataHandling::LoadILLTOF2::fillScanWorkspace(), and Mantid::DataHandling::LoadILLTOF2::fillStaticWorkspace().

◆ findInstrumentNexusAddress()

std::string Mantid::DataHandling::LegacyLoadHelper::findInstrumentNexusAddress ( const LegacyNexus::NXEntry &  firstEntry)

Finds the address for the instrument name in the nexus file Usually of the form: entry0/<NXinstrument class>/name.

Definition at line 48 of file LoadILLTOF2.cpp.

References group.

Referenced by Mantid::DataHandling::LoadILLTOF2::loadInstrumentDetails().

◆ getDoubleDataset()

LegacyNexus::NXDouble Mantid::DataHandling::LegacyLoadHelper::getDoubleDataset ( const LegacyNexus::NXEntry &  entry,
const std::string &  groupName 
)

Fetches NXDouble data from the requested group name in the entry provided.

Parameters
entryNXEntry where desired data can be found
groupNameFull name of the data group
Returns
NXDouble data object

Definition at line 75 of file LoadILLTOF2.cpp.

Referenced by Mantid::DataHandling::LoadILLTOF2::fillScanWorkspace(), and Mantid::DataHandling::LoadILLTOF2::prepareAxis().

◆ getIntDataset()

LegacyNexus::NXInt Mantid::DataHandling::LegacyLoadHelper::getIntDataset ( const LegacyNexus::NXEntry &  entry,
const std::string &  groupName 
)

Fetches NXInt data from the requested group name in the entry provided.

Parameters
entryNXEntry where desired data can be found
groupNameFull name of the data group
Returns
NXInt data object

Definition at line 64 of file LoadILLTOF2.cpp.

Referenced by Mantid::DataHandling::LoadILLTOF2::fillScanWorkspace(), Mantid::DataHandling::LoadILLTOF2::fillStaticWorkspace(), and Mantid::DataHandling::LoadILLTOF2::initWorkspace().

◆ recurseAndAddNexusFieldsToWsRun()

void Mantid::DataHandling::LegacyLoadHelper::recurseAndAddNexusFieldsToWsRun ( LegacyNexus::File &  filehandle,
API::Run runDetails,
const std::string &  parent_name,
const std::string &  parent_class,
int  level 
)

Recursively add properties from a nexus file to the workspace run.

Parameters
filehandle:: Nexus file handle to be parsed, just after an NXopengroup
runDetails:: where to add properties
parent_name:: nexus caller name
parent_class:: nexus caller class
level:: current level in nexus tree

Definition at line 197 of file LoadILLTOF2.cpp.

References Mantid::API::LogManager::addProperty(), Mantid::DataHandling::LoadHelper::dateTimeInIsoFormat(), Mantid::API::LogManager::getProperty(), Mantid::API::LogManager::hasProperty(), and Mantid::Kernel::Property::setValue().