Mantid
Loading...
Searching...
No Matches
LoadNXcanSAS.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 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
10#include "MantidAPI/Progress.h"
11#include "MantidAPI/Sample.h"
13#include "MantidDataHandling/DllConfig.h"
16
17namespace H5 {
18class Group;
19class DataSet;
20} // namespace H5
21
26class MANTID_DATAHANDLING_DLL LoadNXcanSAS : public API::IFileLoader<Nexus::NexusDescriptor> {
27public:
31 ~LoadNXcanSAS() override = default;
32 const std::string name() const override { return "LoadNXcanSAS"; }
34 const std::string summary() const override { return "Loads an HDF5 NXcanSAS file into a MatrixWorkspace."; }
35
37 int version() const override { return (1); }
38 const std::vector<std::string> seeAlso() const override { return {"LoadCanSAS1D", "SaveNXcanSAS"}; }
40 const std::string category() const override { return "DataHandling\\Nexus"; }
41
43 int confidence(Nexus::NexusDescriptor &descriptor) const override;
44
45private:
47 void loadTransmission(const H5::Group &entry, const std::string &name, const InstrumentNameInfo &instrumentInfo);
49 void loadData(const H5::Group &dataGroup, const Mantid::API::MatrixWorkspace_sptr &workspace,
50 const std::pair<size_t, size_t> &spinIndexPair) const;
51 void loadMetadata(const H5::Group &group, const Mantid::API::MatrixWorkspace_sptr &workspace,
52 const InstrumentNameInfo &instrumentInfo, const std::optional<API::Sample> &sample,
53 bool hasPolarizedData = false) const;
54
56 Mantid::API::WorkspaceGroup_sptr transferFileDataIntoWorkspace(const H5::Group &group,
57 const DataSpaceInformation &dataInfo,
58 const InstrumentNameInfo &instrumentInfo);
59 std::vector<SpinState> prepareDataDimensions(const H5::Group &group, const DataSpaceInformation &dataInfo);
60
62 void init() override;
64 void exec() override;
65
66 std::unique_ptr<API::Progress> m_progress;
67 std::unique_ptr<NXcanSAS::DataDimensions> m_dataDims;
68};
69} // namespace Mantid::DataHandling::NXcanSAS
std::string name
Definition Run.cpp:60
IPeaksWorkspace_sptr workspace
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition IFileLoader.h:19
LoadNXcanSAS : Tries to load an NXcanSAS file type into a Workspace2D.
std::unique_ptr< NXcanSAS::DataDimensions > m_dataDims
int version() const override
Algorithm's version.
const std::string name() const override
function to return a name of the algorithm, must be overridden in all algorithms
const std::string category() const override
Algorithm's category for identification.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string summary() const override
Summary of algorithms purpose.
std::unique_ptr< API::Progress > m_progress
~LoadNXcanSAS() override=default
Virtual dtor.
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class