29using namespace Kernel;
39 : m_supportedInstruments{
"FOCUS"}, m_numberOfTubes{0}, m_numberOfPixelsPerTube{0}, m_numberOfChannels{0},
40 m_numberOfHistograms{0} {
42 this->useAlgorithm(
"LoadSINQ");
43 this->deprecatedDate(
"2013-10-28");
67 if (descriptor.
isEntry(
"/entry1/FOCUS/SINQ")) {
78 const std::vector<std::string> exts{
".nxs",
".hdf"};
80 "The name of the Nexus file to load");
82 "The name to use for the output workspace");
119 throw std::runtime_error(
"Cannot set the instrument name from the Nexus file!");
152 m_localWorkspace->getAxis(0)->unit() = UnitFactory::Instance().create(
"TOF");
165 x.assign(timeBinning.begin(), timeBinning.end());
176 int *data_p = &data(
static_cast<int>(i),
static_cast<int>(j));
185 g_log.
debug() <<
"Data loading into WS done....\n";
196 std::string start_time = entry.
getString(
"start_time");
200 std::string end_time = entry.
getString(
"end_time");
205 runDetails.
addProperty<
double>(
"wavelength", wavelength);
210 std::string title = entry.
getString(
"title");
225 std::string sampleName = 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 initWorkSpace(const Nexus::NXEntry &)
void runLoadInstrument()
Run the Child Algorithm LoadInstrument.
API::MatrixWorkspace_sptr m_localWorkspace
void setInstrumentName(const Nexus::NXEntry &entry)
int confidence(Nexus::NexusDescriptor &descriptor) const override
Returns a confidence value that this algorithm can load a file.
static double calculateError(double in)
Calculate error for y.
void loadDataIntoTheWorkSpace(Nexus::NXEntry &)
std::string m_instrumentName
void loadRunDetails(const Nexus::NXEntry &)
void loadExperimentDetails(const Nexus::NXEntry &)
size_t m_numberOfHistograms
std::string m_instrumentAddress
size_t m_numberOfPixelsPerTube
void exec() override
Execute the algorithm.
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.
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()
Read all of the datablock in.
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.
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.
bool isEntry(const std::string &entryName, const std::string &groupClass) const noexcept
Checks if a full-address entry exists for a particular groupClass in a Nexus dataset.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::string getStringFromNexusAddress(const Mantid::Nexus::NXEntry &, const std::string &)
std::vector< double > getTimeBinningFromNexusAddress(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 findInstrumentNexusAddress(const Mantid::Nexus::NXEntry &)
Finds the address for the instrument name in the nexus file Usually of the form: entry0/<NXinstrument...
@ Output
An output workspace.