From d061710a0215e8cb89ce75b10ca8934e76788643 Mon Sep 17 00:00:00 2001 From: Alice Russell <Alice.Russell@tessella.com> Date: Tue, 3 Mar 2020 16:12:51 +0000 Subject: [PATCH] Re #28153 Change how Bk2BkExpConvPV gets the width --- Framework/CurveFitting/src/Functions/Bk2BkExpConvPV.cpp | 8 +++++--- docs/source/release/v5.0.0/mantidworkbench.rst | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Framework/CurveFitting/src/Functions/Bk2BkExpConvPV.cpp b/Framework/CurveFitting/src/Functions/Bk2BkExpConvPV.cpp index 7196b8f0bf3..cd97ac340d4 100644 --- a/Framework/CurveFitting/src/Functions/Bk2BkExpConvPV.cpp +++ b/Framework/CurveFitting/src/Functions/Bk2BkExpConvPV.cpp @@ -69,11 +69,13 @@ double Bk2BkExpConvPV::fwhm() const { } /** Set FWHM - * It is an illegal operation of this type of peak + * This cannot be set directly so we assume Gamma is 0 and set Sigma by doing + * the reverse of calHandEta */ void Bk2BkExpConvPV::setFwhm(const double w) { - UNUSED_ARG(w); - throw std::invalid_argument("Bk2BkExpConvPV is not allowed to set FWHM."); + this->setParameter("Gamma", 0); + auto sigma2 = std::pow(w, 2) / (8.0 * M_LN2); + this->setParameter("Sigma2", sigma2); } /** Set peak center diff --git a/docs/source/release/v5.0.0/mantidworkbench.rst b/docs/source/release/v5.0.0/mantidworkbench.rst index a4d7290537d..deb7095b4b1 100644 --- a/docs/source/release/v5.0.0/mantidworkbench.rst +++ b/docs/source/release/v5.0.0/mantidworkbench.rst @@ -105,6 +105,7 @@ Bugfixes - The help button in fitting now finds the relevant page. - Fixed an issue with changing normalisation on single spectra plots done from a script - Fixed an issue where fitting a distribution workspace was normalised twice. +- Fixed an issue where adding a Bk2BkExpConvPV function to the fit browser caused a crash - Overplots will be normalized by bin width if they are overplotting a curve from a workspace which is a distribution. - Several bugs in the way Python scripts were parsed and executed, including blank lines after a colon and tabs in strings, have been fixed. - Axes limits of a plot no longer automatically rescale when errorbars are on/off -- GitLab