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
ca17e372
Commit
ca17e372
authored
10 years ago
by
Michael Wedel
Browse files
Options
Downloads
Patches
Plain Diff
Refs #11043. Make unit transformation in PoldiPeakSearch more clear
parent
30785199
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
+4
-0
4 additions, 0 deletions
Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp
+21
-8
21 additions, 8 deletions
Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp
with
25 additions
and
8 deletions
Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
+
4
−
0
View file @
ca17e372
...
...
@@ -94,11 +94,15 @@ protected:
double
minimumPeakHeightFromBackground
(
UncertainValue
backgroundWithSigma
)
const
;
double
getTransformedCenter
(
double
value
,
const
Kernel
::
Unit_sptr
&
unit
)
const
;
std
::
vector
<
PoldiPeak_sptr
>
getPeaks
(
const
MantidVec
::
const_iterator
&
baseListStart
,
const
MantidVec
::
const_iterator
&
baseListEnd
,
std
::
list
<
MantidVec
::
const_iterator
>
peakPositions
,
const
MantidVec
&
xData
,
const
Kernel
::
Unit_sptr
&
unit
)
const
;
double
getFWHMEstimate
(
const
MantidVec
::
const_iterator
&
baseListStart
,
const
MantidVec
::
const_iterator
&
baseListEnd
,
MantidVec
::
const_iterator
peakPosition
,
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp
+
21
−
8
View file @
ca17e372
...
...
@@ -199,6 +199,26 @@ PoldiPeakSearch::mapPeakPositionsToCorrelationData(
return
transformedIndices
;
}
/// Converts the value-parameter to d-spacing. Assumes unit to be Q if empty.
double
PoldiPeakSearch
::
getTransformedCenter
(
double
value
,
const
Unit_sptr
&
unit
)
const
{
if
(
boost
::
dynamic_pointer_cast
<
Units
::
dSpacing
>
(
unit
))
{
return
value
;
}
// This is required to preserve default behavior which assumes Q.
Unit_sptr
transformUnit
=
unit
;
if
(
!
unit
||
boost
::
dynamic_pointer_cast
<
Units
::
Empty
>
(
unit
))
{
transformUnit
=
UnitFactory
::
Instance
().
create
(
"MomentumTransfer"
);
}
// Transform value to d-spacing.
Unit_sptr
dUnit
=
UnitFactory
::
Instance
().
create
(
"dSpacing"
);
return
UnitConversion
::
run
((
*
transformUnit
),
(
*
dUnit
),
value
,
0
,
0
,
0
,
DeltaEMode
::
Elastic
,
0.0
);
}
/** Creates PoldiPeak-objects from peak position iterators
*
* In this method, PoldiPeak objects are created from the raw peak position
...
...
@@ -225,14 +245,7 @@ PoldiPeakSearch::getPeaks(const MantidVec::const_iterator &baseListStart,
peak
!=
peakPositions
.
end
();
++
peak
)
{
size_t
index
=
std
::
distance
(
baseListStart
,
*
peak
);
double
xDataD
=
0.0
;
if
(
boost
::
dynamic_pointer_cast
<
Units
::
dSpacing
>
(
unit
))
{
xDataD
=
xData
[
index
];
}
else
{
Unit_sptr
dUnit
=
UnitFactory
::
Instance
().
create
(
"dSpacing"
);
xDataD
=
UnitConversion
::
run
((
*
unit
),
(
*
dUnit
),
xData
[
index
],
0
,
0
,
0
,
DeltaEMode
::
Elastic
,
0.0
);
}
double
xDataD
=
getTransformedCenter
(
xData
[
index
],
unit
);
double
fwhmEstimate
=
getFWHMEstimate
(
baseListStart
,
baseListEnd
,
*
peak
,
xData
);
...
...
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