Skip to content
Snippets Groups Projects
Commit 20dcf906 authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Re #8436. Corrected ConvFit page.

parent 2bb3ada1
No related merge requests found
......@@ -5,6 +5,8 @@
#include "MantidCurveFitting/Lorentzian.h"
#include "MantidCurveFitting/Jacobian.h"
#include "MantidAPI/FunctionDomain1D.h"
#include "MantidAPI/FunctionValues.h"
#include <boost/make_shared.hpp>
......@@ -50,6 +52,22 @@ public:
TS_ASSERT( categories[0] == "Peak" );
}
void test_FWHM()
{
double hwhm = 0.5;
Mantid::CurveFitting::Lorentzian lor;
lor.initialize();
lor.setParameter("Amplitude",1.0);
lor.setParameter("PeakCentre",0.0);
lor.setParameter("FWHM",hwhm*2);
Mantid::API::FunctionDomain1DVector x(0,hwhm,2);
Mantid::API::FunctionValues y(x);
lor.function(x,y);
TS_ASSERT_DELTA( y[1]/y[0], 0.5, 1e-15 );
}
private:
class TestableLorentzian : public Mantid::CurveFitting::Lorentzian
......
......@@ -844,11 +844,11 @@ namespace IDA
// Always want FWHM to display as positive.
if ( val > peakCentre )
{
m_cfDblMng->setValue(m_cfProp["Lorentzian 1.FWHM"], val-peakCentre);
m_cfDblMng->setValue(m_cfProp["Lorentzian 1.FWHM"], val*2.0-peakCentre);
}
else
{
m_cfDblMng->setValue(m_cfProp["Lorentzian 1.FWHM"], peakCentre-val);
m_cfDblMng->setValue(m_cfProp["Lorentzian 1.FWHM"], peakCentre-val*2.0);
}
}
......@@ -868,8 +868,8 @@ namespace IDA
void ConvFit::hwhmUpdateRS(double val)
{
const double peakCentre = m_cfDblMng->value(m_cfProp["Lorentzian 1.PeakCentre"]);
m_cfHwhmRange->setMinimum(peakCentre-val);
m_cfHwhmRange->setMaximum(peakCentre+val);
m_cfHwhmRange->setMinimum(peakCentre-val/2);
m_cfHwhmRange->setMaximum(peakCentre+val/2);
}
void ConvFit::checkBoxUpdate(QtProperty* prop, bool checked)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment