Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
a9b9ee82
Commit
a9b9ee82
authored
Aug 31, 2017
by
Lynch, Vickie
Browse files
Refs #20355 clang-format
parent
9a5c68cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/Crystal/src/CentroidPeaks.cpp
View file @
a9b9ee82
...
...
@@ -26,27 +26,27 @@ using namespace Mantid::Crystal;
/** Initialize the algorithm's properties.
*/
void
CentroidPeaks
::
init
()
{
declareProperty
(
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>
>
(
declareProperty
(
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>>
(
"InPeaksWorkspace"
,
""
,
Direction
::
Input
),
"A PeaksWorkspace containing the peaks to centroid."
);
declareProperty
(
make_unique
<
WorkspaceProperty
<>
>
(
"InputWorkspace"
,
""
,
Direction
::
Input
),
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace"
,
""
,
Direction
::
Input
),
"An input 2D Workspace."
);
declareProperty
(
make_unique
<
PropertyWithValue
<
int
>
>
(
"PeakRadius"
,
10
,
Direction
::
Input
),
make_unique
<
PropertyWithValue
<
int
>>
(
"PeakRadius"
,
10
,
Direction
::
Input
),
"Fixed radius around each peak position in which to calculate the "
"centroid."
);
declareProperty
(
make_unique
<
PropertyWithValue
<
int
>
>
(
"EdgePixels"
,
0
,
Direction
::
Input
),
make_unique
<
PropertyWithValue
<
int
>>
(
"EdgePixels"
,
0
,
Direction
::
Input
),
"The number of pixels where peaks are removed at edges. Only "
"for instruments with RectangularDetectors. "
);
declareProperty
(
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>
>
(
"OutPeaksWorkspace"
,
""
,
Direction
::
Output
),
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>>
(
"OutPeaksWorkspace"
,
""
,
Direction
::
Output
),
"The output PeaksWorkspace will be a copy of the input PeaksWorkspace "
"with the peaks' positions modified by the new found centroids."
);
}
...
...
@@ -341,8 +341,8 @@ int CentroidPeaks::findPixelID(std::string bankName, int col, int row) {
}
}
void
CentroidPeaks
::
removeEdgePeaks
(
Mantid
::
DataObjects
::
PeaksWorkspace
&
peakWS
)
{
void
CentroidPeaks
::
removeEdgePeaks
(
Mantid
::
DataObjects
::
PeaksWorkspace
&
peakWS
)
{
int
Edge
=
getProperty
(
"EdgePixels"
);
std
::
vector
<
int
>
badPeaks
;
size_t
numPeaks
=
peakWS
.
getNumberPeaks
();
...
...
Framework/DataObjects/src/PeaksWorkspace.cpp
View file @
a9b9ee82
...
...
@@ -156,18 +156,19 @@ void PeaksWorkspace::removePeak(const int peakNum) {
void
PeaksWorkspace
::
removePeaks
(
std
::
vector
<
int
>
badPeaks
)
{
if
(
badPeaks
.
empty
())
return
;
// if index of peak is in badPeaks remove
int
ip
=
-
1
;
auto
it
=
std
::
remove_if
(
peaks
.
begin
(),
peaks
.
end
(),
[
&
ip
,
badPeaks
]
(
Peak
&
pk
)
{
(
void
)
pk
;
ip
++
;
for
(
auto
ibp
=
badPeaks
.
begin
();
ibp
!=
badPeaks
.
end
();
++
ibp
)
{
if
(
*
ibp
==
ip
)
return
true
;
}
// if index of peak is in badPeaks remove
int
ip
=
-
1
;
auto
it
=
std
::
remove_if
(
peaks
.
begin
(),
peaks
.
end
(),
[
&
ip
,
badPeaks
](
Peak
&
pk
)
{
(
void
)
pk
;
ip
++
;
for
(
auto
ibp
=
badPeaks
.
begin
();
ibp
!=
badPeaks
.
end
();
++
ibp
)
{
if
(
*
ibp
==
ip
)
return
true
;
}
return
false
;
});
peaks
.
erase
(
it
,
peaks
.
end
());
});
peaks
.
erase
(
it
,
peaks
.
end
());
}
//---------------------------------------------------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment