-
Notifications
You must be signed in to change notification settings - Fork 122
/
Transpose.h
66 lines (58 loc) · 2.12 KB
/
Transpose.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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2010 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
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include "MantidAlgorithms/DllConfig.h"
namespace Mantid {
// forward declarations
namespace API {
class Axis;
}
namespace Algorithms {
/**
This algorithm "transposes" the bins of the input workspace into a single
spectra. So, given
an input workspace of N1 Spectra with N2 Bins, the result is a workspace with N2
Spectra, and
N1 Bins. The output workspace is data points, not histograms.
@author Michael Whitty, STFC ISIS
@date 09/09/2010
*/
class MANTID_ALGORITHMS_DLL Transpose : public API::Algorithm {
public:
/// Algorithm's name
const std::string name() const override { return "Transpose"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Transposes a workspace, so that an N1 x N2 workspace becomes N2 x "
"N1.";
}
/// Algorithm's version
int version() const override { return (1); }
const std::vector<std::string> seeAlso() const override {
return {"Transpose3D", "TransposeMD", "ConvertUnits", "ConvertSpectrumAxis",
"ConvertAxesToRealSpace"};
}
/// Algorithm's category for identification
const std::string category() const override { return "Transforms\\Axes"; }
private:
/// Initialisation code
void init() override;
/// Execution code
void exec() override;
/// Create the output workspace
API::MatrixWorkspace_sptr
createOutputWorkspace(const API::MatrixWorkspace_const_sptr &inputWorkspace);
/// Return the vertical axis on the workspace, throwing if it is not valid
API::Axis *
getVerticalAxis(const API::MatrixWorkspace_const_sptr &workspace) const;
};
} // namespace Algorithms
} // namespace Mantid