/
SmoothData.h
69 lines (60 loc) · 2.32 KB
/
SmoothData.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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2008 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 "MantidGeometry/IDTypes.h"
namespace Mantid {
namespace HistogramData {
class Histogram;
}
namespace Algorithms {
/** Smooths the data of the input workspace by making each point the mean
average of itself and
one or more points lying symmetrically either side of it.
Required Properties:
<UL>
<LI> InputWorkspace - The name of the workspace to take as input. </LI>
<LI> OutputWorkspace - The name under which to store the output workspace.
</LI>
</UL>
Optional Properties:
<UL>
<LI> NPoints - The number of points to average over. Must be at least 3 (the
default). If
an even number is given, it will be incremented by 1 to make it
odd.</LI>
</UL>
@author Russell Taylor, Tessella Support Services plc
@date 23/10/2008
*/
class MANTID_ALGORITHMS_DLL SmoothData final : public API::Algorithm {
public:
/// Algorithm's name
const std::string name() const override { return "SmoothData"; }
/// Summary of algorithms purpose
const std::string summary() const override { return "Smooths out statistical fluctuations in a workspace's data."; }
/// Algorithm's version
int version() const override { return (1); }
const std::vector<std::string> seeAlso() const override { return {"SmoothNeighbours"}; }
/// Algorithm's category for identification
const std::string category() const override { return "Transforms\\Smoothing"; }
private:
/// Initialisation code
void init() override;
/// Execution code
void exec() override;
int validateSpectrumInGroup(size_t wi);
// This map does not need to be ordered, just a lookup for udet
/// type alias for the storage of the UDET-group mapping
using udet2groupmap = std::map<detid_t, int>;
std::vector<int> udet2group;
API::MatrixWorkspace_const_sptr inputWorkspace;
};
HistogramData::Histogram smooth(const HistogramData::Histogram &histogram, int npts);
} // namespace Algorithms
} // namespace Mantid