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
a197ebc3
Commit
a197ebc3
authored
10 years ago
by
Owen Arnold
Browse files
Options
Downloads
Patches
Plain Diff
refs #9549. Protect against bad scale factors.
parent
83a9faed
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
+14
-2
14 additions, 2 deletions
Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
with
14 additions
and
2 deletions
Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
+
14
−
2
View file @
a197ebc3
...
...
@@ -14,14 +14,17 @@
#include
"MantidKernel/PropertyWithValue.h"
#include
"MantidKernel/RebinParamsValidator.h"
#include
"MantidKernel/MultiThreaded.h"
#include
"MantidKernel/BoundedValidator.h"
#include
<boost/make_shared.hpp>
#include
<boost/tuple/tuple.hpp>
#include
<boost/format.hpp>
#include
<boost/algorithm/string.hpp>
#include
<boost/math/special_functions.hpp>
#include
<vector>
#include
<algorithm>
using
namespace
Mantid
::
Kernel
;
using
namespace
Mantid
::
API
;
using
Mantid
::
MantidVec
;
...
...
@@ -85,7 +88,10 @@ namespace Mantid
"Scaling either with respect to workspace 1 or workspace 2"
);
declareProperty
(
new
PropertyWithValue
<
bool
>
(
"UseManualScaleFactor"
,
false
,
Direction
::
Input
),
"True to use a provided value for the scale factor."
);
declareProperty
(
new
PropertyWithValue
<
double
>
(
"ManualScaleFactor"
,
1.0
,
Direction
::
Input
),
auto
manualScaleFactorValidator
=
boost
::
make_shared
<
BoundedValidator
<
double
>
>
();
manualScaleFactorValidator
->
setLower
(
0
);
manualScaleFactorValidator
->
setExclusive
(
true
);
declareProperty
(
new
PropertyWithValue
<
double
>
(
"ManualScaleFactor"
,
1.0
,
manualScaleFactorValidator
,
Direction
::
Input
),
"Provided value for the scale factor. Optional."
);
declareProperty
(
new
PropertyWithValue
<
double
>
(
"OutScaleFactor"
,
Mantid
::
EMPTY_DBL
(),
Direction
::
Output
),
...
...
@@ -457,8 +463,14 @@ namespace Mantid
}
scaleFactor
=
ratio
->
readY
(
0
).
front
();
errorScaleFactor
=
ratio
->
readE
(
0
).
front
();
if
(
scaleFactor
==
0
||
boost
::
math
::
isnan
(
scaleFactor
))
{
std
::
stringstream
messageBuffer
;
messageBuffer
<<
"Stitch1D calculated scale factor is: "
<<
scaleFactor
<<
". Check that in both input workspaces the integrated overlap region is non-zero."
;
g_log
.
warning
(
messageBuffer
.
str
());
}
}
//manualscalefactor end if
int
a1
=
boost
::
tuples
::
get
<
0
>
(
startEnd
);
int
a2
=
boost
::
tuples
::
get
<
1
>
(
startEnd
);
...
...
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