Unverified Commit c35a74fe authored by Peterson, Peter's avatar Peterson, Peter Committed by GitHub
Browse files

Merge pull request #30860 from mantidproject/fit_peaks_bugfixes

FitPeaks bugfixes (ornl-next)
parents ab785083 d75921ab
......@@ -19,6 +19,8 @@
#include "MantidDataObjects/TableWorkspace.h"
#include "MantidKernel/cow_ptr.h"
#include <utility>
namespace Mantid {
namespace HistogramData {
class HistogramX;
......@@ -144,14 +146,15 @@ private:
const API::IPeakFunction_sptr &peak_function,
const API::IBackgroundFunction_sptr &bkgd_function,
const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
double xmin, double xmax,
const std::pair<double, double> &peak_range,
const double &expected_peak_center,
bool estimate_peak_width, bool estimate_background);
double fitFunctionMD(API::IFunction_sptr fit_function,
const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
std::vector<double> &vec_xmin,
std::vector<double> &vec_xmax);
const API::MatrixWorkspace_sptr &dataws,
const size_t wsindex,
const std::pair<double, double> &vec_xmin,
const std::pair<double, double> &vec_xmax);
/// fit a single peak with high background
double fitFunctionHighBackground(
......@@ -180,19 +183,9 @@ private:
const std::vector<double> &vec_y,
const std::vector<double> &vec_e);
/// Esitmate background by 'observation'
void estimateBackground(const HistogramData::Histogram &histogram,
const std::pair<double, double> &peak_window,
const API::IBackgroundFunction_sptr &bkgd_function);
/// estimate linear background
void estimateLinearBackground(const HistogramData::Histogram &histogram,
double left_window_boundary,
double right_window_boundary, double &bkgd_a0,
double &bkgd_a1);
/// Estimate peak parameters by 'observation'
int estimatePeakParameters(const HistogramData::Histogram &histogram,
const std::pair<double, double> &peak_window,
const std::pair<size_t, size_t> &peak_window,
const API::IPeakFunction_sptr &peakfunction,
const API::IBackgroundFunction_sptr &bkgdfunction,
bool observe_peak_width);
This diff is collapsed.
......@@ -119,7 +119,7 @@ public:
algo.setProperty("OutputWorkspace", "outputWS");
algo.setProperty("DetectorDistance", 10.0);
algo.setProperty("DetectorAngle", 45.0);
TS_ASSERT_THROWS(algo.execute(), std::runtime_error);
TS_ASSERT_THROWS(algo.execute(), std::runtime_error &);
......@@ -417,8 +417,7 @@ Output:
.. testoutput:: ExFitVanadiumPeaks
Spectrum 1: Expected right most 3 peaks at 2.1401000, 1.5133000, 1.2356000
Spectrum 1: Found right most 3 peaks at 2.1485553, 1.5190663, 1.2403992
Spectrum 1: Found right most 3 peaks at 2.1485553, 1.5190662, 1.2404027
**Example - Fit back-to-back exponential peaks (Vulcan diamond):**
......@@ -29,6 +29,7 @@ Bugfixes
- Fix out-of-range bug in :ref:`FitPeaks <algm-FitPeaks>` for histogram data.
- Fix bug in :ref:`FitPeaks <algm-FitPeaks>` not correctly checking right window for an individual peak
- Fix bug to actually implement intended sequential fit of DIFC, DIFA, TZERO in :ref:`PDCalibration <algm-PDCalibration>`.
- New options, including three "cache directory" and one "clean cache" in the Advanced Setup tab of the SNS Powder Reduction interface
- New caching feature is added to :ref:`SNSPowderReduction <algm-SNSPowderReduction>` to speed up calculation using same sample and container.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment