Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
20dcf906
Commit
20dcf906
authored
11 years ago
by
Roman Tolchenov
Browse files
Options
Downloads
Patches
Plain Diff
Re #8436. Corrected ConvFit page.
parent
2bb3ada1
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/CurveFitting/test/LorentzianTest.h
+18
-0
18 additions, 0 deletions
Code/Mantid/Framework/CurveFitting/test/LorentzianTest.h
Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp
+4
-4
4 additions, 4 deletions
Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp
with
22 additions
and
4 deletions
Code/Mantid/Framework/CurveFitting/test/LorentzianTest.h
+
18
−
0
View file @
20dcf906
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp
+
4
−
4
View file @
20dcf906
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment