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
2e22e651
Commit
2e22e651
authored
7 years ago
by
Lynch, Vickie
Browse files
Options
Downloads
Patches
Plain Diff
Refs #21371 else added
parent
92046d0a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Crystal/src/IndexPeaks.cpp
+23
-22
23 additions, 22 deletions
Framework/Crystal/src/IndexPeaks.cpp
with
23 additions
and
22 deletions
Framework/Crystal/src/IndexPeaks.cpp
+
23
−
22
View file @
2e22e651
...
...
@@ -18,23 +18,23 @@ using namespace Mantid::Geometry;
/** Initialize the algorithm's properties.
*/
void
IndexPeaks
::
init
()
{
this
->
declareProperty
(
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>>
(
this
->
declareProperty
(
make_unique
<
WorkspaceProperty
<
PeaksWorkspace
>
>
(
"PeaksWorkspace"
,
""
,
Direction
::
InOut
),
"Input Peaks Workspace"
);
auto
mustBePositive
=
boost
::
make_shared
<
BoundedValidator
<
double
>>
();
auto
mustBePositive
=
boost
::
make_shared
<
BoundedValidator
<
double
>
>
();
mustBePositive
->
setLower
(
0.0
);
this
->
declareProperty
(
make_unique
<
PropertyWithValue
<
double
>>
(
"Tolerance"
,
0.15
,
mustBePositive
,
Direction
::
Input
),
make_unique
<
PropertyWithValue
<
double
>
>
(
"Tolerance"
,
0.15
,
mustBePositive
,
Direction
::
Input
),
"Indexing Tolerance (0.15)"
);
this
->
declareProperty
(
make_unique
<
PropertyWithValue
<
int
>>
(
"NumIndexed"
,
0
,
Direction
::
Output
),
make_unique
<
PropertyWithValue
<
int
>
>
(
"NumIndexed"
,
0
,
Direction
::
Output
),
"Gets set with the number of indexed peaks."
);
this
->
declareProperty
(
make_unique
<
PropertyWithValue
<
double
>>
(
this
->
declareProperty
(
make_unique
<
PropertyWithValue
<
double
>
>
(
"AverageError"
,
0.0
,
Direction
::
Output
),
"Gets set with the average HKL indexing error."
);
...
...
@@ -85,7 +85,7 @@ void IndexPeaks::exec() {
for
(
size_t
i
=
0
;
i
<
n_peaks
;
i
++
)
{
peaks
[
i
].
setHKL
(
miller_indices
[
i
]);
}
//
} else {
}
else
{
double
total_error
=
0
;
// get list of run numbers in this peaks workspace
std
::
vector
<
int
>
run_numbers
;
...
...
@@ -140,8 +140,9 @@ void IndexPeaks::exec() {
{
// which is usually sufficient
try
{
IndexingUtils
::
Optimize_UB
(
tempUB
,
miller_indices
,
q_vectors
);
}
catch
(...)
// If there is any problem, such as too few
{
// independent peaks, just use the original UB
}
catch
(...)
// If there is any problem, such as too few
{
// independent peaks, just use the original UB
tempUB
=
UB
;
done
=
true
;
}
...
...
@@ -193,20 +194,20 @@ void IndexPeaks::exec() {
average_error
=
total_error
/
total_indexed
;
else
average_error
=
0
;
// }
// tell the user how many were indexed overall and the overall average error
g_log
.
notice
()
<<
"ALL Runs: indexed "
<<
total_indexed
<<
" Peaks out of "
<<
n_peaks
<<
" with tolerance of "
<<
tolerance
<<
'\n'
;
g_log
.
notice
()
<<
"Average error in h,k,l for indexed peaks = "
<<
average_error
<<
'\n'
;
// Save output properties
this
->
setProperty
(
"NumIndexed"
,
total_indexed
);
this
->
setProperty
(
"AverageError"
,
average_error
);
// Show the lattice parameters
g_log
.
notice
()
<<
o_lattice
<<
"
\n
"
;
}
// tell the user how many were indexed overall and the overall average error
g_log
.
notice
()
<<
"ALL Runs: indexed "
<<
total_indexed
<<
" Peaks out of "
<<
n_peaks
<<
" with tolerance of "
<<
tolerance
<<
'\n'
;
g_log
.
notice
()
<<
"Average error in h,k,l for indexed peaks = "
<<
average_error
<<
'\n'
;
// Save output properties
this
->
setProperty
(
"NumIndexed"
,
total_indexed
);
this
->
setProperty
(
"AverageError"
,
average_error
);
// Show the lattice parameters
g_log
.
notice
()
<<
o_lattice
<<
"
\n
"
;
}
}
// namespace Mantid
}
// namespace Crystal
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