Skip to content

Commit

Permalink
Copy errors across to corrected workspace for all cases.
Browse files Browse the repository at this point in the history
Refs #9166
  • Loading branch information
martyngigg committed Mar 13, 2014
1 parent 0b44233 commit 72cf3d0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
Expand Up @@ -159,6 +159,8 @@ namespace Mantid
// Copy X values
m_backgroundWS->setX(outputIndex,m_inputWS->refX(inputIndex));
m_correctedWS->setX(outputIndex,m_inputWS->refX(inputIndex));
// Copy errors to corrected
m_correctedWS->dataE(outputIndex) = m_inputWS->readE(inputIndex);

try
{
Expand Down
Expand Up @@ -45,7 +45,17 @@ class CalculateGammaBackgroundTest : public CxxTest::TestSuite
TS_ASSERT_DELTA(corrX[npts/2], inX[npts/2],1e-08);
TS_ASSERT_DELTA(corrX.back(),inX.back(),1e-08);

// Corrected matches input the detector is not defined as forward scatter range - Currently hardcoded in algorithm
// E values are zero for background & copy for corrected
const auto & backE(backgroundWS->readE(0));
TS_ASSERT_DELTA(backE.front(), 0.0,1e-08);
TS_ASSERT_DELTA(backE[npts/2], 0.0,1e-08);
TS_ASSERT_DELTA(backE.back(), 0.0,1e-08);
const auto & corrE(correctedWS->readE(0));
const auto & inE(inputWS->readE(0));
TS_ASSERT_DELTA(corrE.front(),inE.front(),1e-08);
TS_ASSERT_DELTA(corrE[npts/2], inE[npts/2],1e-08);
TS_ASSERT_DELTA(corrE.back(),inE.back(),1e-08);

const auto & corrY(correctedWS->readY(0));
TS_ASSERT_DELTA(corrY.front(), -0.00253802, 1e-08);
TS_ASSERT_DELTA(corrY[npts/2], 0.15060372, 1e-08);
Expand All @@ -59,7 +69,7 @@ class CalculateGammaBackgroundTest : public CxxTest::TestSuite

}

void xtest_Input_With_Spectrum_Number_Outside_Range_Leaves_Data_Uncorrected_And_Background_Zeroed()
void test_Input_With_Spectrum_Number_Outside_Range_Leaves_Data_Uncorrected_And_Background_Zeroed()
{
using namespace Mantid::API;
auto inputWS = createTestWorkspaceWithFoilChanger(); //specNo=1
Expand Down Expand Up @@ -132,7 +142,18 @@ class CalculateGammaBackgroundTest : public CxxTest::TestSuite
TS_ASSERT_DELTA(corrX[npts/2], inX[npts/2],1e-08);
TS_ASSERT_DELTA(corrX.back(),inX.back(),1e-08);

// Corrected matches input the detector is not defined as forward scatter range - Currently hardcoded in algorithm
// E values are zero for background & copy for corrected
const auto & backE(backgroundWS->readE(0));
TS_ASSERT_DELTA(backE.front(), 0.0,1e-08);
TS_ASSERT_DELTA(backE[npts/2], 0.0,1e-08);
TS_ASSERT_DELTA(backE.back(), 0.0,1e-08);
const auto & corrE(correctedWS->readE(0));
const auto & inE(inputWS->readE(0));
TS_ASSERT_DELTA(corrE.front(), inE.front(),1e-08);
TS_ASSERT_DELTA(corrE[npts/2], inE[npts/2],1e-08);
TS_ASSERT_DELTA(corrE.back(), inE.back(),1e-08);

// Corrected values
const auto & corrY(correctedWS->readY(0));
TS_ASSERT_DELTA(corrY.front(), -0.00253802, 1e-08);
TS_ASSERT_DELTA(corrY[npts/2], 0.15060372, 1e-08);
Expand Down

0 comments on commit 72cf3d0

Please sign in to comment.