Mantid
Loading...
Searching...
No Matches
InterpolatingRebin.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
14
15namespace Mantid {
16namespace HistogramData {
17class HistogramE;
18class Histogram;
19class BinEdges;
20class Points;
21} // namespace HistogramData
22namespace Algorithms {
57class MANTID_ALGORITHMS_DLL InterpolatingRebin : public Rebin {
58public:
60 const std::string name() const override { return "InterpolatingRebin"; }
62 const std::string summary() const override {
63 return "Creates a workspace with different x-value bin boundaries where "
64 "the new y-values are estimated using cubic splines.";
65 }
66
68 // cppcheck-suppress uselessOverride
69 int version() const override { return 1; }
70 const std::vector<std::string> seeAlso() const override { return {"Rebin"}; }
71 // cppcheck-suppress uselessOverride
72 const std::string category() const override { return "Transforms\\Rebin"; }
74 const std::string alias() const override { return ""; }
75
76protected:
77 const std::string workspaceMethodName() const override { return ""; }
78 // Overridden Algorithm methods
79 void init() override;
80 std::map<std::string, std::string> validateInputs() override;
81 void exec() override;
82
83 void outputYandEValues(const API::MatrixWorkspace_const_sptr &inputW, const HistogramData::BinEdges &XValues_new,
84 const API::MatrixWorkspace_sptr &outputW);
85 HistogramData::Histogram cubicInterpolation(const HistogramData::Histogram &oldHistogram,
86 const HistogramData::BinEdges &xNew) const;
87
88 HistogramData::Histogram noInterpolation(const HistogramData::Histogram &oldHistogram,
89 const HistogramData::BinEdges &xNew) const;
90
91 double estimateError(const HistogramData::Points &xsOld, const HistogramData::HistogramE &esOld,
92 const double xNew) const;
93};
94
95} // namespace Algorithms
96} // namespace Mantid
Uses cubic splines to interpolate the mean rate of change of the integral over the inputed data bins ...
const std::string summary() const override
Summary of algorithms purpose.
const std::string category() const override
function to return a category of the algorithm.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
const std::string workspaceMethodName() const override
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
int version() const override
Algorithm's version for identification overriding a virtual method.
const std::string alias() const override
Alias for the algorithm. Must override so it doesn't get parent class's.
Takes a workspace as input and rebins the data according to the input rebin parameters.
Definition Rebin.h:39
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.