-
Notifications
You must be signed in to change notification settings - Fork 122
/
LoadILLPolarizedDiffraction.h
70 lines (56 loc) · 2.6 KB
/
LoadILLPolarizedDiffraction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/IFileLoader.h"
#include "MantidAPI/WorkspaceGroup_fwd.h"
#include "MantidDataHandling/DllConfig.h"
#include "MantidDataHandling/LoadHelper.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/NexusDescriptor.h"
#include "MantidNexus/NexusClasses.h"
#include <utility>
namespace Mantid {
namespace DataHandling {
/** LoadILLPolarizedDiffraction : Loads ILL polarized diffraction nexus files
from instrument D7.
@date 15/05/20
*/
class MANTID_DATAHANDLING_DLL LoadILLPolarizedDiffraction : public API::IFileLoader<Kernel::NexusDescriptor> {
public:
const std::string name() const override;
int version() const override;
const std::vector<std::string> seeAlso() const override { return {"LoadNexus"}; }
const std::string category() const override;
const std::string summary() const override;
int confidence(Kernel::NexusDescriptor &) const override;
LoadILLPolarizedDiffraction();
private:
void init() override;
std::map<std::string, std::string> validateInputs() override;
void exec() override;
API::MatrixWorkspace_sptr initStaticWorkspace(const NeXus::NXEntry &);
void loadData();
void loadMetaData();
void sortPolarisations();
void loadInstrument(API::MatrixWorkspace_sptr, const std::string &);
std::vector<double> loadTwoThetaDetectors(const API::MatrixWorkspace_sptr, const NeXus::NXEntry &, const int);
std::vector<double> loadBankParameters(const API::MatrixWorkspace_sptr, const int);
void moveTwoTheta(const NeXus::NXEntry &, API::MatrixWorkspace_sptr);
std::vector<double> prepareAxes(const NeXus::NXEntry &);
API::MatrixWorkspace_sptr convertSpectrumAxis(API::MatrixWorkspace_sptr);
API::MatrixWorkspace_sptr transposeMonochromatic(API::MatrixWorkspace_sptr);
size_t m_numberOfChannels; // number of channels data
size_t m_acquisitionMode; // acquisition mode of measurement, 0 -
// monochromatic, 1 - TOF
std::string m_instName; ///< instrument name to load the IDF
std::string m_fileName; ///< file name to load
double m_wavelength; // wavelength value is read from the YIG IPF
LoadHelper m_loadHelper; ///< a helper for metadata
API::WorkspaceGroup_sptr m_outputWorkspaceGroup; ///< output workspace
};
} // namespace DataHandling
} // namespace Mantid