From d62238ba8c969a3fbde68c49af5a858a3df2ff07 Mon Sep 17 00:00:00 2001 From: Gemma Guest <gemma.guest@stfc.ac.uk> Date: Fri, 31 Mar 2017 18:19:27 +0100 Subject: [PATCH] Re #18829 Temp fix for centre pixel --- .../MantidAlgorithms/ReflectometryReductionOne2.h | 2 -- .../Algorithms/src/ReflectometryReductionOne2.cpp | 15 ++++++++------- .../src/ReflectometryReductionOneAuto2.cpp | 4 ++++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h index 6d19a45cabd..0c5e1feaeb9 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h @@ -140,7 +140,6 @@ private: double theta0() { return m_theta0; } double twoThetaR() { return m_twoThetaR; } size_t twoThetaRDetectorIdx() { return m_twoThetaRDetectorIdx; } - size_t centreDetectorIdx() { return m_centreDetectorIdx; }; API::MatrixWorkspace_sptr m_runWS; const API::SpectrumInfo *m_spectrumInfo; @@ -154,7 +153,6 @@ private: double m_lambdaMin; // min wavelength in area of interest double m_lambdaMax; // max wavelength in area of interest std::vector<size_t> m_detectors; // workspace indices of detectors of interest - size_t m_centreDetectorIdx; // detector index of centre pixel size_t m_twoThetaRDetectorIdx; // detector index at reference angle thetaR }; diff --git a/Framework/Algorithms/src/ReflectometryReductionOne2.cpp b/Framework/Algorithms/src/ReflectometryReductionOne2.cpp index cfd4964c501..bdad962ba8b 100644 --- a/Framework/Algorithms/src/ReflectometryReductionOne2.cpp +++ b/Framework/Algorithms/src/ReflectometryReductionOne2.cpp @@ -38,6 +38,9 @@ void ReflectometryReductionOne2::init() { boost::make_shared<StringListValidator>(reductionTypes), "The type of reduction to perform."); + // Theta0 + declareProperty("Theta0", 0.0, "Horizon angle in degrees", Direction::Input); + // Processing instructions declareProperty(Kernel::make_unique<PropertyWithValue<std::string>>( "ProcessingInstructions", "", @@ -498,10 +501,8 @@ void ReflectometryReductionOne2::findDetectorsOfInterest() { } } - // Also set the centre and the reference detector indices - - /// todo: find correct centre detector - m_centreDetectorIdx = 400; + // Also set the reference detector index as the centre of the + // region of interest m_twoThetaRDetectorIdx = minDetectorIdx + (maxDetectorIdx - minDetectorIdx) / 2; } catch (std::exception &ex) { @@ -541,9 +542,9 @@ void ReflectometryReductionOne2::findTheta0() { m_theta0 = 0.0; if (reductionType == "DivergentBeam") { - // theta0 is at the centre detector pixel - /// todo: check this is true for all instruments - m_theta0 = m_spectrumInfo->twoTheta(centreDetectorIdx()) / 2.0; + // theta0 is at the angle at the centre of the detector. This is the + // angle the detector has been rotated around and should be defined in + m_theta0 = getProperty("Theta0"); } } diff --git a/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp b/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp index 39a824cdd3a..17c7f1e1082 100644 --- a/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp +++ b/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp @@ -140,6 +140,9 @@ void ReflectometryReductionOneAuto2::init() { declareProperty("ThetaIn", Mantid::EMPTY_DBL(), "Angle in degrees", Direction::Input); + // Theta0 + declareProperty("Theta0", 0.0, "Horizon angle in degrees", Direction::Input); + // Detector position correction type const std::vector<std::string> correctionType{"VerticalShift", "RotateAroundSample"}; @@ -238,6 +241,7 @@ void ReflectometryReductionOneAuto2::exec() { // Mandatory properties alg->setProperty("ReductionType", getPropertyValue("ReductionType")); + alg->setProperty("Theta0", getPropertyValue("Theta0")); double wavMin = checkForMandatoryInstrumentDefault<double>( this, "WavelengthMin", instrument, "LambdaMin"); alg->setProperty("WavelengthMin", wavMin); -- GitLab