diff --git a/Framework/Algorithms/src/CorrectTOFAxis.cpp b/Framework/Algorithms/src/CorrectTOFAxis.cpp index 8c9fc3c53eeedf61aabef2488f7365fe925b45af..101a28d45d5afb959f3dafe9313201545037a3b2 100644 --- a/Framework/Algorithms/src/CorrectTOFAxis.cpp +++ b/Framework/Algorithms/src/CorrectTOFAxis.cpp @@ -54,7 +54,7 @@ const static std::string WORKSPACE_INDEX("Workspace Index"); namespace PropertyNames { const static std::string ELASTIC_BIN_INDEX("ElasticBinIndex"); const static std::string EPP_TABLE("EPPTable"); -const static std::string INCIDENT_ENERGY("IncidentEnergy"); +const static std::string FIXED_ENERGY("EFixed"); const static std::string INDEX_TYPE("IndexType"); const static std::string INPUT_WORKSPACE("InputWorkspace"); const static std::string OUTPUT_WORKSPACE("OutputWorkspace"); @@ -197,9 +197,9 @@ void CorrectTOFAxis::init() { declareProperty( PropertyNames::ELASTIC_BIN_INDEX, EMPTY_INT(), mustBePositiveInt, "Bin index of the nominal elastic TOF channel.", Direction::Input); - declareProperty(PropertyNames::INCIDENT_ENERGY, EMPTY_DBL(), + declareProperty(PropertyNames::FIXED_ENERGY, EMPTY_DBL(), mustBePositiveDouble, - "Incident energy if EI sample log is not present/incorrect.", + "Incident energy if the 'EI' sample log is not present/incorrect.", Direction::Input); } @@ -296,7 +296,7 @@ std::map<std::string, std::string> CorrectTOFAxis::validateInputs() { } } - if (getPointerToProperty(PropertyNames::INCIDENT_ENERGY)->isDefault()) { + if (getPointerToProperty(PropertyNames::FIXED_ENERGY)->isDefault()) { if (!m_inputWs->run().hasProperty(SampleLog::INCIDENT_ENERGY)) { issues[PropertyNames::INPUT_WORKSPACE] = "'Ei' is missing from the sample logs."; @@ -372,7 +372,7 @@ void CorrectTOFAxis::correctManually(API::MatrixWorkspace_sptr outputWs) { epp = m_inputWs->points(0)[m_elasticBinIndex]; l2 = averageL2(spectrumInfo); } - double Ei = getProperty(PropertyNames::INCIDENT_ENERGY); + double Ei = getProperty(PropertyNames::FIXED_ENERGY); if (Ei == EMPTY_DBL()) { Ei = m_inputWs->run().getPropertyAsSingleValue(SampleLog::INCIDENT_ENERGY); } else { diff --git a/Framework/Algorithms/test/CorrectTOFAxisTest.h b/Framework/Algorithms/test/CorrectTOFAxisTest.h index 54830eef35e3fda6a36a16acb3e4f2367ee7a2b6..1988711ac22238d6a4bd030a6405aef70bea124e 100644 --- a/Framework/Algorithms/test/CorrectTOFAxisTest.h +++ b/Framework/Algorithms/test/CorrectTOFAxisTest.h @@ -88,7 +88,7 @@ public: TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("IndexType", "Workspace Index")) TS_ASSERT_THROWS_NOTHING(alg->setPropertyValue("ReferenceSpectra", "1-300")) - TS_ASSERT_THROWS_NOTHING(alg->setProperty("IncidentEnergy", actualEi)) + TS_ASSERT_THROWS_NOTHING(alg->setProperty("EFixed", actualEi)) TS_ASSERT_THROWS_NOTHING(alg->execute()); TS_ASSERT(alg->isExecuted()); @@ -121,7 +121,7 @@ public: TS_ASSERT_THROWS_NOTHING(alg->setPropertyValue("ReferenceSpectra", "1-300")) TS_ASSERT_THROWS_NOTHING( alg->setProperty("ElasticBinIndex", static_cast<int>(eppIndex))) - TS_ASSERT_THROWS_NOTHING(alg->setProperty("IncidentEnergy", actualEi)) + TS_ASSERT_THROWS_NOTHING(alg->setProperty("EFixed", actualEi)) TS_ASSERT_THROWS_NOTHING(alg->execute()); TS_ASSERT(alg->isExecuted()); diff --git a/docs/source/algorithms/CorrectTOFAxis-v1.rst b/docs/source/algorithms/CorrectTOFAxis-v1.rst index afadcb862ed316560747ca566c9515b44bd12cc6..1f67743382dd889950f736459d300b6768633359 100644 --- a/docs/source/algorithms/CorrectTOFAxis-v1.rst +++ b/docs/source/algorithms/CorrectTOFAxis-v1.rst @@ -20,7 +20,7 @@ If *ReferenceWorkspace* is set, this algorithm copies the X axis as well as the Calculating new TOF axis ######################## -If no *ReferenceWorkspace* is given, the algorithm takes the L1 distance :math:`l_1` from the instrument attached to *InputWorkspace* and calculates the average L2 distance :math:`l_2` using the histograms specified by *ReferenceSpectra*. The algorithm also needs to know the TOF :math:`t_{elastic}` corresponding to the zero-energy transfer. This is either taken from the first spectrum in *InputWorkspace* as the bin centre of the bin specified by *ElasticBinIndex*, or calculated from the elastic peak positions given in *EPPTable*. *EPPTable* should be in the format returned by the :ref:`algm-FindEPP` algorithm. In this case the algorithm averages the `PeakCentre` column for histograms listed in *ReferenceSpectra*. Finally, the algorithm needs the incident energy :math:`E_i` which can be either specified by *IncidentEnergy* or is taken from the sample logs of *InputWorkspace*. In case *IncidentEnergy* is specified, the 'Ei' and 'wavelength' sample logs of *OutputWorkspace* are updated accordingly. +If no *ReferenceWorkspace* is given, the algorithm takes the L1 distance :math:`l_1` from the instrument attached to *InputWorkspace* and calculates the average L2 distance :math:`l_2` using the histograms specified by *ReferenceSpectra*. The algorithm also needs to know the TOF :math:`t_{elastic}` corresponding to the zero-energy transfer. This is either taken from the first spectrum in *InputWorkspace* as the bin centre of the bin specified by *ElasticBinIndex*, or calculated from the elastic peak positions given in *EPPTable*. *EPPTable* should be in the format returned by the :ref:`algm-FindEPP` algorithm. In this case the algorithm averages the `PeakCentre` column for histograms listed in *ReferenceSpectra*. Finally, the algorithm needs the incident energy :math:`E_i` which can be either specified by *EFixed* or is taken from the sample logs of *InputWorkspace*. In case *EFixed* is specified, the 'Ei' and 'wavelength' sample logs of *OutputWorkspace* are updated accordingly. The TOF shift :math:`\Delta t` is calculated by @@ -74,7 +74,7 @@ Usage IndexType='Workspace Index', ReferenceSpectra='0', ElasticBinIndex=elasticBinIndex, - IncidentEnergy=Ei) + EFixed=Ei) # Convert TOF to energy transfer. convertedWs = ConvertUnits(correctedWs, @@ -134,7 +134,7 @@ Output: EPPTable=EPPTable, IndexType='Workspace Index', ReferenceSpectra='0', - IncidentEnergy=Ei) + EFixed=Ei) # Check results. print('Original TOF for the elastic peak: {0:0.1f}'.format( @@ -203,7 +203,7 @@ Output: EPPTable=EPPTable, IndexType='Workspace Index', ReferenceSpectra='0', - IncidentEnergy=Ei) + EFixed=Ei) # Correct the second workspace by using the first as a reference. correctedWs2 = CorrectTOFAxis(ws2,