From 39487eb4fba30e8c7eeb397e98107f2e27eacc77 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Wed, 29 Oct 2014 09:55:24 +0000 Subject: [PATCH] refs #10384 Sphinx warnings and different background errors formula --- .../Algorithms/src/BackgroundHelper.cpp | 10 +++-- .../docs/source/algorithms/Rebin-v1.rst | 45 ++++++++++--------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Code/Mantid/Framework/Algorithms/src/BackgroundHelper.cpp b/Code/Mantid/Framework/Algorithms/src/BackgroundHelper.cpp index 830dec7fbd3c..39d620c2003d 100644 --- a/Code/Mantid/Framework/Algorithms/src/BackgroundHelper.cpp +++ b/Code/Mantid/Framework/Algorithms/src/BackgroundHelper.cpp @@ -94,17 +94,19 @@ namespace Mantid double L2 = detector->getDistance(*m_Sample); double delta(std::numeric_limits::quiet_NaN()); // clone unit conversion to avoid multithreading issues - auto unitCong = m_WSUnit->clone(); + auto unitConv = m_WSUnit->clone(); unitCong->initialize(m_L1, L2,twoTheta, m_Emode, m_Efix,delta); - double tof1 = unitCong->singleToTOF(XValues[0]); + double tof1 = unitConv->singleToTOF(XValues[0]); for(size_t i=0;isingleToTOF(XValues[i+1]); + double tof2=unitConv->singleToTOF(XValues[i+1]); double Jack = std::fabs((tof2-tof1)/dtBg); double normBkgrnd = IBg*Jack; tof1=tof2; y_data[i] -=normBkgrnd; - e_data[i] =std::sqrt((ErrSq*Jack*Jack+e_data[i]*e_data[i])/2.); // needs further clarification -- Gaussian error summation? + //e_data[i] =std::sqrt((ErrSq*Jack*Jack+e_data[i]*e_data[i])/2.); // needs further clarification -- Gaussian error summation? + //--> assume error for background is sqrt(signal): + e_data[i] =std::sqrt((normBkgrnd+e_data[i]*e_data[i])/2.); // needs further clarification -- Gaussian error summation? } } diff --git a/Code/Mantid/docs/source/algorithms/Rebin-v1.rst b/Code/Mantid/docs/source/algorithms/Rebin-v1.rst index 05c5266c983e..8c89bbbb8f25 100644 --- a/Code/Mantid/docs/source/algorithms/Rebin-v1.rst +++ b/Code/Mantid/docs/source/algorithms/Rebin-v1.rst @@ -345,7 +345,7 @@ Output: What type is the workspace after 1st rebin: What type is the workspace after 2nd rebin: -**Example -- Background removal during rebinning +**Example - Background removal during rebinning** .. testcode:: ExRebinWithBkgRemoval @@ -384,25 +384,26 @@ Output: .. testoutput:: ExRebinWithBkgRemoval | x sampl | x result | S sample | S no bg | Err samp | Err no_bg| - | -20.0| -20.0| 1.0000| -0.959| 1.000| 83.115| - | -18.0| -18.0| 2.0000| -0.101| 1.414| 89.127| - | -16.0| -16.0| 3.0000| 0.740| 1.732| 95.900| - | -14.0| -14.0| 1.0000| -1.441| 1.000| 103.568| - | -12.0| -12.0| 5.0000| 2.353| 2.236| 112.332| - | -10.0| -10.0| 2.0000| -0.885| 1.414| 122.387| - | -8.0| -8.0| 5.0000| 1.841| 2.236| 134.052| - | -6.0| -6.0| 2.0000| -1.481| 1.414| 147.684| - | -4.0| -4.0| 4.0000| 0.139| 2.000| 163.806| - | -2.0| -2.0| 3.0000| -1.315| 1.732| 183.086| - | 0.0| 0.0| 6.0000| 1.133| 2.449| 206.478| - | 2.0| 2.0| 7.0000| 1.454| 2.646| 235.313| - | 4.0| 4.0| 5.0000| -1.400| 2.236| 271.548| - | 6.0| 6.0| 7.0000| -0.499| 2.646| 318.157| - | 8.0| 8.0| 9.0000| 0.047| 3.000| 379.833| - | 10.0| 10.0| 11.0000| 0.054| 3.317| 464.415| - | 12.0| 12.0| 16.0000| 2.190| 4.000| 585.907| - | 14.0| 14.0| 16.0000| -2.188| 4.000| 771.675| - | 16.0| 16.0| 26.0000| 0.490| 5.099| 1082.292| - | 18.0| 18.0| 39.0000| -0.581| 6.245| 1679.267| - + | -20.0| -20.0| 1.0000| -0.959| 1.000| 1.216| + | -18.0| -18.0| 2.0000| -0.101| 1.414| 1.432| + | -16.0| -16.0| 3.0000| 0.740| 1.732| 1.622| + | -14.0| -14.0| 1.0000| -1.441| 1.000| 1.312| + | -12.0| -12.0| 5.0000| 2.353| 2.236| 1.955| + | -10.0| -10.0| 2.0000| -0.885| 1.414| 1.563| + | -8.0| -8.0| 5.0000| 1.841| 2.236| 2.020| + | -6.0| -6.0| 2.0000| -1.481| 1.414| 1.655| + | -4.0| -4.0| 4.0000| 0.139| 2.000| 1.983| + | -2.0| -2.0| 3.0000| -1.315| 1.732| 1.912| + | 0.0| 0.0| 6.0000| 1.133| 2.449| 2.331| + | 2.0| 2.0| 7.0000| 1.454| 2.646| 2.505| + | 4.0| 4.0| 5.0000| -1.400| 2.236| 2.388| + | 6.0| 6.0| 7.0000| -0.499| 2.646| 2.692| + | 8.0| 8.0| 9.0000| 0.047| 3.000| 2.996| + | 10.0| 10.0| 11.0000| 0.054| 3.317| 3.313| + | 12.0| 12.0| 16.0000| 2.190| 4.000| 3.861| + | 14.0| 14.0| 16.0000| -2.188| 4.000| 4.135| + | 16.0| 16.0| 26.0000| 0.490| 5.099| 5.075| + | 18.0| 18.0| 39.0000| -0.581| 6.245| 6.268| + + .. categories::