diff --git a/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp b/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp index 864163aa09fe4d20ea39f607617d2c540c57ef19..5aa995141a2afc32c44c8500bc2175b313592a78 100644 --- a/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp +++ b/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp @@ -141,7 +141,7 @@ void ReflectometryReductionOneAuto2::init() { correctionTypeValidator->add( boost::make_shared<StringListValidator>(correctionType)); declareProperty( - "CorrectionType", correctionType[0], correctionTypeValidator, + "DetectorCorrectionType", correctionType[0], correctionTypeValidator, "Whether detectors should be shifted vertically or rotated around the " "sample position.", Direction::Input); @@ -343,7 +343,7 @@ MatrixWorkspace_sptr ReflectometryReductionOneAuto2::correctDetectorPositions( detectorsOfInterest.end()); const double theta = getProperty("ThetaIn"); - const std::string correctionType = getProperty("CorrectionType"); + const std::string correctionType = getProperty("DetectorCorrectionType"); MatrixWorkspace_sptr corrected = inputWS; @@ -352,7 +352,7 @@ MatrixWorkspace_sptr ReflectometryReductionOneAuto2::correctDetectorPositions( createChildAlgorithm("SpecularReflectionPositionCorrect"); alg->setProperty("InputWorkspace", corrected); alg->setProperty("TwoTheta", theta * 2); - alg->setProperty("CorrectionType", correctionType); + alg->setProperty("DetectorCorrectionType", correctionType); alg->setProperty("DetectorComponentName", detector); alg->execute(); corrected = alg->getProperty("OutputWorkspace"); diff --git a/Framework/Algorithms/src/SpecularReflectionPositionCorrect2.cpp b/Framework/Algorithms/src/SpecularReflectionPositionCorrect2.cpp index 96834f44032f5d3303450acb139c1136bf9d918c..132142934496a7c84f3532f97106bea12c188370 100644 --- a/Framework/Algorithms/src/SpecularReflectionPositionCorrect2.cpp +++ b/Framework/Algorithms/src/SpecularReflectionPositionCorrect2.cpp @@ -64,7 +64,7 @@ void SpecularReflectionPositionCorrect2::init() { correctionTypeValidator->add( boost::make_shared<StringListValidator>(correctionType)); declareProperty( - "CorrectionType", correctionType[0], correctionTypeValidator, + "DetectorCorrectionType", correctionType[0], correctionTypeValidator, "Whether detectors should be shifted vertically or rotated around the " "sample position.", Direction::Input); @@ -118,7 +118,7 @@ void SpecularReflectionPositionCorrect2::exec() { const V3D samplePosition = sample->getPos(); // Type of movement (vertical shift or rotation around the sample) - const std::string correctionType = getProperty("CorrectionType"); + const std::string correctionType = getProperty("DetectorCorrectionType"); // Sample-to-detector const V3D sampleToDetector = detectorPosition - samplePosition; diff --git a/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h b/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h index 282d0bc9a20b4e8dde589f340e1afd7248eb2bf8..663ad33dc651be72cb76b3eaa0ad6d88fb492b9a 100644 --- a/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h +++ b/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h @@ -293,7 +293,7 @@ public: alg.setChild(true); alg.setProperty("InputWorkspace", polref); alg.setProperty("ThetaIn", 1.5); - alg.setProperty("CorrectionType", "RotateAroundSample"); + alg.setProperty("DetectorCorrectionType", "RotateAroundSample"); alg.setProperty("AnalysisMode", "MultiDetectorAnalysis"); alg.setProperty("CorrectionAlgorithm", "None"); alg.setProperty("MomentumTransferStep", 0.01); @@ -340,7 +340,7 @@ public: alg.setChild(true); alg.setProperty("InputWorkspace", polref); alg.setProperty("ThetaIn", 0.25); - alg.setProperty("CorrectionType", "VerticalShift"); + alg.setProperty("DetectorCorrectionType", "VerticalShift"); alg.setProperty("CorrectionAlgorithm", "None"); alg.setProperty("MomentumTransferStep", 0.01); alg.setProperty("OutputWorkspace", "IvsQ"); diff --git a/Framework/Algorithms/test/SpecularReflectionPositionCorrect2Test.h b/Framework/Algorithms/test/SpecularReflectionPositionCorrect2Test.h index c99c0ff09af35c2f4bd08f281a032441e2f2c442..5af6215086b7509f565b0bee80a207ef49aa949f 100644 --- a/Framework/Algorithms/test/SpecularReflectionPositionCorrect2Test.h +++ b/Framework/Algorithms/test/SpecularReflectionPositionCorrect2Test.h @@ -27,7 +27,7 @@ private: alg.setProperty("InputWorkspace", m_interWS); alg.setProperty("TwoTheta", twoTheta); if (!correctionType.empty()) - alg.setProperty("CorrectionType", correctionType); + alg.setProperty("DetectorCorrectionType", correctionType); if (!detectorName.empty()) alg.setProperty("DetectorComponentName", detectorName); alg.setPropertyValue("OutputWorkspace", "test_out"); @@ -103,7 +103,7 @@ public: } void test_correct_point_detector_vertical_shift_default() { - // Omit the CorrectionType property to check that a vertical shift + // Omit the DetectorCorrectionType property to check that a vertical shift // is done by default SpecularReflectionPositionCorrect2 alg; setupAlgorithm(alg, 1.4, "", "point-detector"); diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsView.h index eec7630d7ed6fa1cadb7337c8d8f99e8f25beea4..32b67b7f8417f6e7dcacfcd611452a770c7be9de 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsView.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSettingsView.h @@ -65,7 +65,7 @@ public: virtual std::string getCPp() const = 0; virtual std::string getMomentumTransferStep() const = 0; virtual std::string getScaleFactor() const = 0; - virtual std::string getCorrectionType() const = 0; + virtual std::string getDetectorCorrectionType() const = 0; /// Instrument settings virtual std::string getIntMonCheck() const = 0; virtual std::string getMonitorIntegralMin() const = 0; diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsView.h index 523e93b17fb17236d6af611c289d047d3727540c..28db01910a0453d4755b2ed04934e4d624a27041 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsView.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflSettingsView.h @@ -70,8 +70,8 @@ public: std::string getMomentumTransferStep() const override; /// Return scale factor std::string getScaleFactor() const override; - /// Return selected correction type - std::string getCorrectionType() const override; + /// Return selected detector correction type + std::string getDetectorCorrectionType() const override; /// Return integrated monitors option std::string getIntMonCheck() const override; /// Return monitor integral wavelength min diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsWidget.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsWidget.ui index 6a5a69ba5183ebcf3225b7b01eb563aaa8174fe8..13e71ef21825204297e461a1e476eeb55f455af4 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsWidget.ui +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSettingsWidget.ui @@ -290,14 +290,14 @@ </spacer> </item> <item row="8" column="0"> - <widget class="QLabel" name="correctionTypeLabel"> + <widget class="QLabel" name="detectorCorrectionTypeLabel"> <property name="text"> - <string>CorrectionType</string> + <string>DetectorCorrectionType</string> </property> </widget> </item> <item row="8" column="1"> - <widget class="QComboBox" name="correctionTypeComboBox"> + <widget class="QComboBox" name="detectorCorrectionTypeComboBox"> <item> <property name="text"> <string>VerticalShift</string> diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsView.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsView.cpp index 3cabc6aa0f9fb21748a722c84485fc57d3354b7c..805b69d84509acddf2b37a7aea6f2a214e45c563 100644 --- a/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsView.cpp +++ b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflSettingsView.cpp @@ -79,10 +79,10 @@ void QtReflSettingsView::setExpDefaults( m_ui.CApEdit->setText(QString::fromStdString(defaults[4])); m_ui.CPpEdit->setText(QString::fromStdString(defaults[5])); - int ctIndex = m_ui.correctionTypeComboBox->findText( + int ctIndex = m_ui.detectorCorrectionTypeComboBox->findText( QString::fromStdString(defaults[6])); if (ctIndex != -1) - m_ui.correctionTypeComboBox->setCurrentIndex(ctIndex); + m_ui.detectorCorrectionTypeComboBox->setCurrentIndex(ctIndex); } /* Sets default values for all instrument settings given a list of default @@ -244,9 +244,9 @@ std::string QtReflSettingsView::getScaleFactor() const { /** Return selected correction type * @return :: selected correction type */ -std::string QtReflSettingsView::getCorrectionType() const { +std::string QtReflSettingsView::getDetectorCorrectionType() const { - return m_ui.correctionTypeComboBox->currentText().toStdString(); + return m_ui.detectorCorrectionTypeComboBox->currentText().toStdString(); } /** Return integrated monitors option diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsPresenter.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsPresenter.cpp index 87dc1da80fb95a23f4e18c65181f6a9cad74ce51..61f7258093b8e565295c406580360d697f5b3be0 100644 --- a/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsPresenter.cpp +++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflSettingsPresenter.cpp @@ -221,9 +221,9 @@ std::string ReflSettingsPresenter::getReductionOptions() const { options.push_back("ScaleFactor=" + scaleFactor); // Add correction type - auto correctionType = m_view->getCorrectionType(); + auto correctionType = m_view->getDetectorCorrectionType(); if (!correctionType.empty()) - options.push_back("CorrectionType=" + correctionType); + options.push_back("DetectorCorrectionType=" + correctionType); // Add momentum transfer limits auto qTransStep = m_view->getMomentumTransferStep(); @@ -344,7 +344,7 @@ void ReflSettingsPresenter::getExpDefaults() { if (!cPp.empty()) defaults[5] = cPp[0]; - defaults[6] = alg->getPropertyValue("CorrectionType"); + defaults[6] = alg->getPropertyValue("DetectorCorrectionType"); m_view->setExpDefaults(defaults); } diff --git a/MantidQt/CustomInterfaces/test/ReflSettingsPresenterTest.h b/MantidQt/CustomInterfaces/test/ReflSettingsPresenterTest.h index b5065dd050fb99a5cd3d14f65238f1dbd377aaed..0f9c0f929f49c2b0daea110053c15743e92f3ca1 100644 --- a/MantidQt/CustomInterfaces/test/ReflSettingsPresenterTest.h +++ b/MantidQt/CustomInterfaces/test/ReflSettingsPresenterTest.h @@ -153,7 +153,7 @@ public: EXPECT_CALL(mockView, getScaleFactor()) .Times(Exactly(1)) .WillOnce(Return("2")); - EXPECT_CALL(mockView, getCorrectionType()) + EXPECT_CALL(mockView, getDetectorCorrectionType()) .Times(Exactly(1)) .WillOnce(Return("VerticalShift")); EXPECT_CALL(mockView, getMomentumTransferStep()) @@ -192,7 +192,7 @@ public: TS_ASSERT_EQUALS(optionsVec[13], "WavelengthMax=15"); TS_ASSERT_EQUALS(optionsVec[14], "I0MonitorIndex=2"); TS_ASSERT_EQUALS(optionsVec[15], "ScaleFactor=2"); - TS_ASSERT_EQUALS(optionsVec[16], "CorrectionType=VerticalShift"); + TS_ASSERT_EQUALS(optionsVec[16], "DetectorCorrectionType=VerticalShift"); TS_ASSERT_EQUALS(optionsVec[17], "MomentumTransferStep=-0.02"); TS_ASSERT_EQUALS(optionsVec[18], "ProcessingInstructions=\"3,4\""); TS_ASSERT_EQUALS(optionsVec[19], "StartOverlap=10"); @@ -241,11 +241,13 @@ public: presenter.setInstrumentName("POLREF"); std::vector<std::string> defaults = { - "PointDetectorAnalysis", "None", + "PointDetectorAnalysis", + "None", "1.006831,-0.011467,0.002244,-0.000095", "1.017526,-0.017183,0.003136,-0.000140", "0.917940,0.038265,-0.006645,0.000282", - "0.972762,0.001828,-0.000261,0.0", "VerticalShift"}; + "0.972762,0.001828,-0.000261,0.0", + "VerticalShift"}; EXPECT_CALL(mockView, setExpDefaults(defaults)).Times(1); presenter.notify(IReflSettingsPresenter::ExpDefaultsFlag); diff --git a/docs/source/algorithms/ReflectometryReductionOneAuto-v2.rst b/docs/source/algorithms/ReflectometryReductionOneAuto-v2.rst index 3e2d613a03b2b57badeef5468efe48f420f598ae..cc72b7197c16e49705486313015128d88843dd49 100644 --- a/docs/source/algorithms/ReflectometryReductionOneAuto-v2.rst +++ b/docs/source/algorithms/ReflectometryReductionOneAuto-v2.rst @@ -186,7 +186,7 @@ Output: .. testcode:: ExReflRedOneAutoOverload run = Load(Filename='INTER00013460.nxs') - IvsQ, IvsQ_unbinned, IvsLam = ReflectometryReductionOneAuto(InputWorkspace=run, ThetaIn=0.7, CorrectionType="RotateAroundSample", MonitorBackgroundWavelengthMin=0.0, MonitorBackgroundWavelengthMax=1.0) + IvsQ, IvsQ_unbinned, IvsLam = ReflectometryReductionOneAuto(InputWorkspace=run, ThetaIn=0.7, DetectorCorrectionType="RotateAroundSample", MonitorBackgroundWavelengthMin=0.0, MonitorBackgroundWavelengthMax=1.0) print "%.5f" % (IvsLam.readY(0)[175]) print "%.5f" % (IvsLam.readY(0)[176]) diff --git a/docs/source/algorithms/SpecularReflectionPositionCorrect-v2.rst b/docs/source/algorithms/SpecularReflectionPositionCorrect-v2.rst index 804e07c1438e4cb420f9027e124d5555110b73ec..a6bd8e49c82ba599e6ad0e93e8dde3055a48cbe8 100644 --- a/docs/source/algorithms/SpecularReflectionPositionCorrect-v2.rst +++ b/docs/source/algorithms/SpecularReflectionPositionCorrect-v2.rst @@ -35,11 +35,11 @@ Usage instr = polref.getInstrument() print 'Original position: ' + str(instr.getComponentByName('point-detector').getPos()) - polref_vert = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='point-detector', CorrectionType='VerticalShift') + polref_vert = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='point-detector', DetectorCorrectionType='VerticalShift') instr = polref_vert.getInstrument() print 'Vertical shift: ' + str(instr.getComponentByName('point-detector').getPos()) - polref_rot = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='point-detector', CorrectionType='RotateAroundSample') + polref_rot = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='point-detector', DetectorCorrectionType='RotateAroundSample') instr = polref_rot.getInstrument() print 'Rotated: ' + str(instr.getComponentByName('point-detector').getPos()) @@ -67,7 +67,7 @@ Output: instr = polref_vert.getInstrument() print 'Vertical shift: ' + str(instr.getComponentByName('lineardetector').getPos()) - polref_rot = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='lineardetector', CorrectionType='RotateAroundSample') + polref_rot = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='lineardetector', DetectorCorrectionType='RotateAroundSample') instr = polref_rot.getInstrument() print 'Rotated: ' + str(instr.getComponentByName('lineardetector').getPos()) @@ -95,7 +95,7 @@ Output: instr = polref_vert.getInstrument() print 'Vertical shift: ' + str(instr.getComponentByName('OSMOND').getPos()) - polref_rot = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='OSMOND', CorrectionType='RotateAroundSample') + polref_rot = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='OSMOND', DetectorCorrectionType='RotateAroundSample') instr = polref_rot.getInstrument() print 'Rotated: ' + str(instr.getComponentByName('OSMOND').getPos()) diff --git a/docs/source/release/v3.10.0/reflectometry.rst b/docs/source/release/v3.10.0/reflectometry.rst index 07d53408857678d8315d183fad6d246ad3d14a09..90f3ab9a83f2e79219925f1547b529636a6471ea 100644 --- a/docs/source/release/v3.10.0/reflectometry.rst +++ b/docs/source/release/v3.10.0/reflectometry.rst @@ -7,7 +7,7 @@ Reflectometry Changes Algorithms ---------- -* The :ref:`algm-SpecularReflectionPositionCorrect` algorithm has a new property, ``CorrectionType``, which specifies whether detector positions should be corrected by a vertical shift (default) or by a rotation around the sample position. +* The :ref:`algm-SpecularReflectionPositionCorrect` algorithm has a new property, ``DetectorCorrectionType``, which specifies whether detector positions should be corrected by a vertical shift (default) or by a rotation around the sample position. ConvertToReflectometryQ -----------------------