-
Notifications
You must be signed in to change notification settings - Fork 122
/
ConvertAxesToRealSpace.h
61 lines (50 loc) · 1.76 KB
/
ConvertAxesToRealSpace.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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2014 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/Algorithm.h"
#include "MantidAlgorithms/DllConfig.h"
#include "MantidKernel/cow_ptr.h"
#include <map>
namespace Mantid {
namespace Algorithms {
/** ConvertAxesToRealSpace : Converts the spectrum and TOF axes to real space
values, integrating the data in the process
*/
class MANTID_ALGORITHMS_DLL ConvertAxesToRealSpace final : public API::Algorithm {
public:
const std::string name() const override;
int version() const override;
const std::vector<std::string> seeAlso() const override { return {"ConvertSpectrumAxis", "ConvertUnits"}; }
const std::string category() const override;
const std::string summary() const override;
private:
void init() override;
void exec() override;
/// Local cache data about a spectra
struct SpectraData {
double verticalValue;
double horizontalValue;
double intensity;
double error;
int verticalIndex;
int horizontalIndex;
};
/// summary data about an Axis
struct AxisData {
std::string label;
double min;
double max;
int bins;
};
// map to store unit captions and measures
std::map<std::string, std::string> m_unitMap;
void fillAxisValues(MantidVec &vector, const AxisData &axisData, bool isHistogram);
void fillUnitMap(std::vector<std::string> &orderedVector, std::map<std::string, std::string> &unitMap,
const std::string &caption, const std::string &unit);
};
} // namespace Algorithms
} // namespace Mantid