-
Notifications
You must be signed in to change notification settings - Fork 121
/
LoadNexusLogs.h
106 lines (89 loc) · 3.68 KB
/
LoadNexusLogs.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2011 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/NexusFileLoader.h"
#include "MantidDataHandling/DllConfig.h"
#include <nexus/NeXusFile.hpp>
#include <vector>
namespace Mantid {
namespace Kernel {
class Property;
}
namespace API {
class MatrixWorkspace;
}
namespace DataHandling {
/**
Loads the run logs from a NeXus file.
Required Properties:
<UL>
<LI> Filename - The name of and path to the input NeXus file </LI>
<LI> Workspace - The name of the workspace in which to store the imported
data.</LI>
</UL>
@author Martyn Gigg, Tessella plc
*/
class MANTID_DATAHANDLING_DLL LoadNexusLogs : public API::NexusFileLoader {
public:
/// Default constructor
LoadNexusLogs();
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "LoadNexusLogs"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Loads run logs (temperature, pulse charges, etc.) from a NeXus "
"file and adds it to the run information in a workspace.";
}
/// Algorithm's version for identification overriding a virtual method
int version() const override { return 1; }
const std::vector<std::string> seeAlso() const override { return {"LoadLog", "MergeLogs"}; }
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override { return "DataHandling\\Logs;DataHandling\\Nexus"; }
int confidence(Kernel::NexusHDF5Descriptor & /*descriptor*/) const override { return 0; }
private:
/// Overwrites Algorithm method.
void init() override;
/// Overwrites Algorithm method
void execLoader() override;
/**
* Load log data from a group
* @param file input Nexus file handler
* @param absolute_entry_name full entry name in Nexus
* @param entry_class type of the entry (NXlog)
* @param workspace input workspace
*/
void loadLogs(::NeXus::File &file, const std::string &absolute_entry_name, const std::string &entry_class,
const std::shared_ptr<API::MatrixWorkspace> &workspace, const std::vector<std::string> &allow_list,
const std::vector<std::string> &block_list) const;
/**
* Load an NXlog entry
* @param file input Nexus file handler
* @param absolute_entry_name full entry name in Nexus
* @param entry_class type of the entry (NXlog)
* @param workspace input workspace
*/
void loadNXLog(::NeXus::File &file, const std::string &absolute_entry_name, const std::string &entry_class,
const std::shared_ptr<API::MatrixWorkspace> &workspace) const;
/**
* Load an IXseblock entry
* @param file input Nexus file handler
* @param absolute_entry_name full entry name in Nexus
* @param workspace input workspace
*/
void loadSELog(::NeXus::File &file, const std::string &absolute_entry_name,
const std::shared_ptr<API::MatrixWorkspace> &workspace) const;
void loadVetoPulses(::NeXus::File &file, const std::shared_ptr<API::MatrixWorkspace> &workspace) const;
void loadNPeriods(::NeXus::File &file, const std::shared_ptr<API::MatrixWorkspace> &workspace) const;
/// Progress reporting object
std::shared_ptr<API::Progress> m_progress;
/// Use frequency start for Monitor19 and Special1_19 logs with "No Time" for
/// SNAP
std::string freqStart;
mutable std::vector<std::string> m_logsWithInvalidValues;
};
} // namespace DataHandling
} // namespace Mantid