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 int version() const override { return 1; }
69 const std::vector<std::string> seeAlso() const override { return {"Rebin"}; }
71 const std::string category() const override { return "Transforms\\Rebin"; }
73 const std::string alias() const override { return ""; }
74
75protected:
76 const std::string workspaceMethodName() const override { return ""; }
77 // Overridden Algorithm methods
78 void init() override;
79 void exec() override;
80
81 void outputYandEValues(const API::MatrixWorkspace_const_sptr &inputW, const HistogramData::BinEdges &XValues_new,
82 const API::MatrixWorkspace_sptr &outputW);
83 HistogramData::Histogram cubicInterpolation(const HistogramData::Histogram &oldHistogram,
84 const HistogramData::BinEdges &xNew) const;
85
86 HistogramData::Histogram noInterpolation(const HistogramData::Histogram &oldHistogram,
87 const HistogramData::BinEdges &xNew) const;
88
89 double estimateError(const HistogramData::Points &xsOld, const HistogramData::HistogramE &esOld,
90 const double xNew) const;
91};
92
93} // namespace Algorithms
94} // 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
Algorithm's category for identification overriding a virtual method.
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:38
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.