diff --git a/Framework/DataHandling/src/LoadILLReflectometry.cpp b/Framework/DataHandling/src/LoadILLReflectometry.cpp index 12f2cdf23dc958ed932124924d8f2b86ab684934..692b1f64ee77037555d70c37befaf4855db49d93 100644 --- a/Framework/DataHandling/src/LoadILLReflectometry.cpp +++ b/Framework/DataHandling/src/LoadILLReflectometry.cpp @@ -710,7 +710,6 @@ double LoadILLReflectometry::detectorRotation() { const double peakCentre = reflectometryPeak(); g_log.debug() << "Using detector angle (degrees): " << m_detectorAngle << '\n'; - const double deflection = collimationAngle(); if (!isDefault("OutputBeamPosition")) { PeakInfo p; p.detectorAngle = m_detectorAngle; @@ -730,6 +729,7 @@ double LoadILLReflectometry::detectorRotation() { return 2 * userAngle - offset; } if (!posTable) { + const double deflection = collimationAngle(); if (deflection != 0) { g_log.debug() << "Using incident deflection angle (degrees): " << deflection << '\n'; @@ -841,12 +841,9 @@ void LoadILLReflectometry::placeSource() { /// Return the incident neutron deflection angle. double LoadILLReflectometry::collimationAngle() const { - if (m_instrument != Supported::FIGARO) { - return 0; - } - const auto collimationAngle = doubleFromRun("CollAngle.actual_coll_angle"); - const auto sampleAngle = doubleFromRun("Theta.actual_theta"); - return collimationAngle + sampleAngle; + return m_instrument == Supported::FIGARO + ? doubleFromRun("CollAngle.actual_coll_angle") + : 0.; } /// Return the detector center angle. diff --git a/Framework/DataHandling/test/LoadILLReflectometryTest.h b/Framework/DataHandling/test/LoadILLReflectometryTest.h index 6d9490913140a80ffa69af26be219a21bbacea3e..f847dcf9b1ac7f3e15658093e7e989edc4e1e829 100644 --- a/Framework/DataHandling/test/LoadILLReflectometryTest.h +++ b/Framework/DataHandling/test/LoadILLReflectometryTest.h @@ -345,8 +345,6 @@ public: 180. * M_PI; const auto detDist = std::hypot(beamY - sht1, beamZ) - sampleZOffset / std::cos(collimationAngle); - const auto sampleAngle = - run.getPropertyValueAsType<double>("Theta.actual_theta") / 180. * M_PI; for (size_t i = 0; i < spectrumInfo.size(); ++i) { if (spectrumInfo.isMonitor(i)) { continue; @@ -354,8 +352,8 @@ public: const auto p = spectrumInfo.position(i); TS_ASSERT_EQUALS(p.X(), 0.) const auto pixOffset = (static_cast<double>(i) - 127.5) * pixWidth; - const auto pixAngle = detAngle + collimationAngle + sampleAngle + - std::atan2(pixOffset, detDist); + const auto pixAngle = + detAngle + collimationAngle + std::atan2(pixOffset, detDist); const auto pixDist = std::hypot(pixOffset, detDist); const auto idealY = pixDist * std::sin(pixAngle); const auto idealZ = pixDist * std::cos(pixAngle); diff --git a/docs/source/release/v3.13.0/reflectometry.rst b/docs/source/release/v3.13.0/reflectometry.rst index 2a8b10d5b61252d87ac05fa2f35f38a897bbdc93..e8a571929c27e4e3325981ec24947cabcd1d9633 100644 --- a/docs/source/release/v3.13.0/reflectometry.rst +++ b/docs/source/release/v3.13.0/reflectometry.rst @@ -45,7 +45,7 @@ New - ``CreatePolarizationEfficiencies`` creates efficiencies from polynomial coefficients - ``JoinISISPolarizationEfficiencies`` joins individual efficiencies into one matrix workspace - ``LoadISISPolarizationEfficiencies`` loads efficiencies form files -* The ILL reflectometry loader ``LoadILLReflectometry`` implements the NeXus file changes of January 2018 and can load again all valid Nexus files for D17 and FIGARO which are available since 2013 and 2017, respectively. +* The ILL reflectometry loader :ref:`algm-LoadILLReflectometry` implements the NeXus file changes of January 2018 and can load again all valid Nexus files for D17 and FIGARO which are available since 2013 and 2017, respectively. * Algorithms for reflectometry reduction at ILL have been added. These handle the basic polarized/unpolarized reduction in SumInLambda or SumInQ modes. Included algorithms: - :ref:`algm-ReflectometryILLPreprocess` - :ref:`algm-ReflectometryILLSumForeground` @@ -63,6 +63,7 @@ Bugfixes ######## * Correct the angle to the value of ``ThetaIn`` property if summing in lambda in ``ReflectometryReductionOne-v2``. +* Fixed an incorrectly calculated detector angle when loading FIGARO files using :ref:`algm-LoadILLReflectometry`. Liquids Reflectometer ---------------------