Mantid
Loading...
Searching...
No Matches
LoadSassena.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
14#include "MantidDataHandling/DllConfig.h"
17
18#include <hdf5.h>
19
20namespace Mantid {
21
22namespace DataHandling {
23
36/* Base class to Load a sassena dataset into a MatrixWorkspace
37 * Derived implementations will load different scattering functions
38
39class LoadDataSet
40{
41
42};
43*/
44
45class MANTID_DATAHANDLING_DLL LoadSassena : public API::IFileLoader<Kernel::NexusDescriptor> {
46public:
48 const std::string name() const override { return "LoadSassena"; }
50 const std::string summary() const override { return " load a Sassena output file into a group workspace."; }
51
53 int version() const override { return 1; }
55 const std::string category() const override { return "DataHandling\\Sassena"; }
56
58 int confidence(Kernel::NexusDescriptor &descriptor) const override;
59
60protected:
62 void registerWorkspace(const API::WorkspaceGroup_sptr &gws, const std::string &wsName,
63 const DataObjects::Workspace2D_sptr &ws, const std::string &description);
65 herr_t dataSetInfo(const hid_t &h5file, const std::string &setName, hsize_t *dims) const;
67 herr_t dataSetDouble(const hid_t &h5file, const std::string &setName, std::vector<double> &buf);
69 HistogramData::Points loadQvectors(const hid_t &h5file, const API::WorkspaceGroup_sptr &gws,
70 std::vector<int> &sorting_indexes);
72 void loadFQ(const hid_t &h5file, const API::WorkspaceGroup_sptr &gws, const std::string &setName,
73 const HistogramData::Points &qvmod, const std::vector<int> &sorting_indexes);
75 void loadFQT(const hid_t &h5file, const API::WorkspaceGroup_sptr &gws, const std::string &setName,
76 const HistogramData::Points &qvmod, const std::vector<int> &sorting_indexes);
77
78private:
80 void init() override; // Overwrites Algorithm method.
82 void exec() override; // Overwrites Algorithm method
84 void loadSet(const std::string &version, const std::string &setName);
85
87 std::vector<std::string> m_validSets;
89 std::string m_filename;
90
91}; // class LoadSassena
92
93} // namespace DataHandling
94} // namespace Mantid
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
Load Sassena Output files.
Definition: LoadSassena.h:45
const std::string category() const override
Algorithm's category for identification.
Definition: LoadSassena.h:55
std::string m_filename
name and path of input file
Definition: LoadSassena.h:89
std::vector< std::string > m_validSets
valid datasets
Definition: LoadSassena.h:87
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadSassena.h:50
int version() const override
Algorithm's version.
Definition: LoadSassena.h:53
void loadSet(const std::string &version, const std::string &setName)
Loads one dataset.
const std::string name() const override
Algorithm's name.
Definition: LoadSassena.h:48
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
Helper class which provides the Collimation Length for SANS instruments.