Skip to content

Commit

Permalink
Refs #9475 Fixing system and unit tests
Browse files Browse the repository at this point in the history
Fixed a problem in the Stitch1DMany unit test where it wasn't converitng a double to a string

Stitch1D now tkaes range tollerences into account
  • Loading branch information
keithnbrown committed Jun 2, 2014
1 parent 080e655 commit 8d8fb4a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Expand Up @@ -57,6 +57,7 @@ namespace Mantid
Mantid::API::MatrixWorkspace_sptr singleValueWS(double val);
Mantid::API::MatrixWorkspace_sptr weightedMean(Mantid::API::MatrixWorkspace_sptr& inOne, Mantid::API::MatrixWorkspace_sptr& inTwo);
boost::tuple<int,int> findStartEndIndexes(double startOverlap, double endOverlap, Mantid::API::MatrixWorkspace_sptr& workspace);
static const double range_tolerance;

};

Expand Down
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
Expand Up @@ -43,6 +43,7 @@ namespace Mantid
namespace Algorithms
{

const double Stitch1D::range_tolerance = 1e-9;
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(Stitch1D)

Expand Down Expand Up @@ -129,6 +130,7 @@ namespace Mantid
{
Property* startOverlapProp = this->getProperty("StartOverlap");
double startOverlapVal = this->getProperty("StartOverlap");
startOverlapVal -= this->range_tolerance;
const bool startOverlapBeyondRange = (startOverlapVal < intesectionMin)
|| (startOverlapVal > intesectionMax);
if (startOverlapProp->isDefault() || startOverlapBeyondRange)
Expand All @@ -153,6 +155,7 @@ namespace Mantid
{
Property* endOverlapProp = this->getProperty("EndOverlap");
double endOverlapVal = this->getProperty("EndOverlap");
endOverlapVal += this->range_tolerance;
const bool endOverlapBeyondRange = (endOverlapVal < intesectionMin)
|| (endOverlapVal > intesectionMax);
if (endOverlapProp->isDefault() || endOverlapBeyondRange)
Expand Down
Expand Up @@ -82,7 +82,7 @@ def __do_stitch_workspace(self, lhs_ws, rhs_ws, start_overlap, end_overlap, para
alg.execute()
out_ws = alg.getProperty("OutputWorkspace").value
scale_factor = alg.getProperty("OutScaleFactor").value
logger.warning(scale_factor)
logger.warning(str(scale_factor))

#out_ws, scale_factor = Stitch1D(LHSWorkspace=lhs_ws, RHSWorkspace=rhs_ws, StartOverlap=start_overlap, EndOverlap=end_overlap,
# Params=params, ScaleRHSWorkspace=scale_rhs_ws, UseManualScaleFactor=use_manual_scale_factor, ManualScaleFactor=manual_scale_factor, OutputWorkspace=out_name)
Expand Down

0 comments on commit 8d8fb4a

Please sign in to comment.