27using namespace Kernel;
37 : m_supportedInstruments{
"FOCUS"}, m_numberOfTubes{0}, m_numberOfPixelsPerTube{0}, m_numberOfChannels{0},
38 m_numberOfHistograms{0} {
40 this->useAlgorithm(
"LoadSINQ");
41 this->deprecatedDate(
"2013-10-28");
65 if (descriptor.
pathExists(
"/entry1/FOCUS/SINQ")) {
76 const std::vector<std::string> exts{
".nxs",
".hdf"};
78 "The name of the Nexus file to load");
80 "The name to use for the output workspace");
117 throw std::runtime_error(
"Cannot set the instrument name from the Nexus file!");
163 x.assign(timeBinning.begin(), timeBinning.end());
174 int *data_p = &data(
static_cast<int>(i),
static_cast<int>(j));
183 g_log.
debug() <<
"Data loading into WS done....\n";
194 std::string start_time = entry.
getString(
"start_time");
198 std::string end_time = entry.
getString(
"end_time");
203 runDetails.
addProperty<
double>(
"wavelength", wavelength);
208 std::string title = entry.
getString(
"title");
223 std::string
name = boost::lexical_cast<std::string>(entry.
getFloat(
"sample/name"));
#define DECLARE_NEXUS_FILELOADER_ALGORITHM(classname)
DECLARE_NEXUS_FILELOADER_ALGORITHM should be used in place of the standard DECLARE_ALGORITHM macro wh...
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
virtual std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
Create a Child Algorithm.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
@ Load
allowed here which will be passed to the algorithm
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
Helper class for reporting progress from algorithms.
This class stores information regarding an experimental run as a series of log entries.
A property class for workspaces.
Loads an PSI nexus file into a Mantid workspace.
const std::string category() const override
Algorithm's category for identification.
const std::string name() const override
Algorithm's name for identification.
void init() override
Initialize the algorithm's properties.
size_t m_numberOfChannels
int version() const override
Algorithm's version for identification.
void runLoadInstrument()
Run the Child Algorithm LoadInstrument.
API::MatrixWorkspace_sptr m_localWorkspace
void loadExperimentDetails(const NeXus::NXEntry &)
void initWorkSpace(NeXus::NXEntry &)
void loadRunDetails(const NeXus::NXEntry &)
static double calculateError(double in)
Calculate error for y.
std::string m_instrumentName
void loadDataIntoTheWorkSpace(NeXus::NXEntry &)
size_t m_numberOfHistograms
void setInstrumentName(const NeXus::NXEntry &entry)
std::string m_instrumentPath
size_t m_numberOfPixelsPerTube
void exec() override
Execute the algorithm.
int confidence(Kernel::NexusDescriptor &descriptor) const override
Returns a confidence value that this algorithm can load a file.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void debug(const std::string &msg)
Logs at debug level.
void information(const std::string &msg)
Logs at information level.
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
bool pathExists(const std::string &path) const
Query if a path exists.
OptionalBool : Tri-state bool.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
float getFloat(const std::string &name) const
Returns a float.
std::string getString(const std::string &name) const
Returns a string.
Templated class implementation of NXDataSet.
void load(const int blocksize=1, int i=-1, int j=-1, int k=-1, int l=-1) override
Implementation of the virtual NXDataSet::load(...) method.
int dim0() const
Returns the number of elements along the first dimension.
int dim1() const
Returns the number of elements along the second dimension.
Implements NXdata Nexus class.
NXInt openIntData()
Opens data of int type.
Implements NXentry Nexus class.
NXData openNXData(const std::string &name) const
Opens a NXData.
Implements NXroot Nexus class.
NXEntry openFirstEntry()
Open the first NXentry in the file.
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::string getStringFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &)
std::vector< double > getTimeBinningFromNexusPath(const Mantid::NeXus::NXEntry &, const std::string &)
Gets the time binning from a Nexus float array Adds an extra bin at the end.
std::string findInstrumentNexusPath(const Mantid::NeXus::NXEntry &)
Finds the path for the instrument name in the nexus file Usually of the form: entry0/<NXinstrument cl...
@ Output
An output workspace.