From f7c46ad666d4e892a31fcdb4145a2267015c5518 Mon Sep 17 00:00:00 2001 From: Pete Peterson <petersonpf@ornl.gov> Date: Wed, 4 Mar 2015 11:16:18 -0500 Subject: [PATCH] Renamed PDEstimateDetectorResolution --- .../Framework/Algorithms/CMakeLists.txt | 6 ++-- ...tion.h => EstimateResolutionDiffraction.h} | 14 ++++---- ....cpp => EstimateResolutionDiffraction.cpp} | 34 +++++++++---------- ....h => EstimateResolutionDiffractionTest.h} | 22 ++++++------ .../CalibrateRectangularDetectors-v1.rst | 2 +- ...t => EstimateResolutionDiffraction-v1.rst} | 2 +- .../algorithms/GetDetOffsetsMultiPeaks-v1.rst | 2 +- 7 files changed, 41 insertions(+), 41 deletions(-) rename Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/{PDEstimateDetectorResolution.h => EstimateResolutionDiffraction.h} (86%) rename Code/Mantid/Framework/Algorithms/src/{PDEstimateDetectorResolution.cpp => EstimateResolutionDiffraction.cpp} (88%) rename Code/Mantid/Framework/Algorithms/test/{PDEstimateDetectorResolutionTest.h => EstimateResolutionDiffractionTest.h} (79%) rename Code/Mantid/docs/source/algorithms/{PDEstimateDetectorResolution-v1.rst => EstimateResolutionDiffraction-v1.rst} (95%) diff --git a/Code/Mantid/Framework/Algorithms/CMakeLists.txt b/Code/Mantid/Framework/Algorithms/CMakeLists.txt index 513c547b723..df294307ff7 100644 --- a/Code/Mantid/Framework/Algorithms/CMakeLists.txt +++ b/Code/Mantid/Framework/Algorithms/CMakeLists.txt @@ -91,6 +91,7 @@ set ( SRC_FILES src/EQSANSTofStructure.cpp src/EditInstrumentGeometry.cpp src/ElasticWindow.cpp + src/EstimateResolutionDiffraction.cpp src/Exponential.cpp src/ExponentialCorrection.cpp src/ExportTimeSeriesLog.cpp @@ -161,7 +162,6 @@ set ( SRC_FILES src/OneMinusExponentialCor.cpp src/PDFFourierTransform.cpp src/Pause.cpp - src/PDEstimateDetectorResolution.cpp src/PerformIndexOperations.cpp src/PhaseQuadMuon.cpp src/PlotAsymmetryByLogValue.cpp @@ -346,6 +346,7 @@ set ( INC_FILES inc/MantidAlgorithms/EQSANSTofStructure.h inc/MantidAlgorithms/EditInstrumentGeometry.h inc/MantidAlgorithms/ElasticWindow.h + inc/MantidAlgorithms/EstimateResolutionDiffraction.h inc/MantidAlgorithms/Exponential.h inc/MantidAlgorithms/ExponentialCorrection.h inc/MantidAlgorithms/ExportTimeSeriesLog.h @@ -417,7 +418,6 @@ set ( INC_FILES inc/MantidAlgorithms/OneMinusExponentialCor.h inc/MantidAlgorithms/PDFFourierTransform.h inc/MantidAlgorithms/Pause.h - inc/MantidAlgorithms/PDEstimateDetectorResolution.h inc/MantidAlgorithms/PerformIndexOperations.h inc/MantidAlgorithms/PhaseQuadMuon.h inc/MantidAlgorithms/PlotAsymmetryByLogValue.h @@ -608,6 +608,7 @@ set ( TEST_FILES DivideTest.h EditInstrumentGeometryTest.h ElasticWindowTest.h + EstimateResolutionDiffractionTest.h ExponentialCorrectionTest.h ExponentialTest.h ExportTimeSeriesLogTest.h @@ -670,7 +671,6 @@ set ( TEST_FILES OneMinusExponentialCorTest.h PDFFourierTransformTest.h PauseTest.h - PDEstimateDetectorResolutionTest.h PerformIndexOperationsTest.h PhaseQuadMuonTest.h PlotAsymmetryByLogValueTest.h diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/PDEstimateDetectorResolution.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/EstimateResolutionDiffraction.h similarity index 86% rename from Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/PDEstimateDetectorResolution.h rename to Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/EstimateResolutionDiffraction.h index bfbdf3ae893..8c24786a6d2 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/PDEstimateDetectorResolution.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/EstimateResolutionDiffraction.h @@ -1,5 +1,5 @@ -#ifndef MANTID_ALGORITHMS_PDESTIMATEDETECTORRESOLUTION_H_ -#define MANTID_ALGORITHMS_PDESTIMATEDETECTORRESOLUTION_H_ +#ifndef MANTID_ALGORITHMS_ESTIMATERESOLUTIONDIFFRACTION_H_ +#define MANTID_ALGORITHMS_ESTIMATERESOLUTIONDIFFRACTION_H_ #include "MantidKernel/System.h" #include "MantidAPI/Algorithm.h" @@ -8,7 +8,7 @@ namespace Mantid { namespace Algorithms { -/** PDEstimateDetectorResolution : TODO: DESCRIPTION +/** EstimateResolutionDiffraction : TODO: DESCRIPTION Copyright © 2014 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source @@ -31,10 +31,10 @@ namespace Algorithms { File change history is stored at: <https://github.com/mantidproject/mantid> Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class DLLExport PDEstimateDetectorResolution : public API::Algorithm { +class DLLExport EstimateResolutionDiffraction : public API::Algorithm { public: - PDEstimateDetectorResolution(); - virtual ~PDEstimateDetectorResolution(); + EstimateResolutionDiffraction(); + virtual ~EstimateResolutionDiffraction(); /// Algorithm's name for identification overriding a virtual method virtual const std::string name() const; @@ -93,4 +93,4 @@ private: } // namespace Algorithms } // namespace Mantid -#endif /* MANTID_ALGORITHMS_PDESTIMATEDETECTORRESOLUTION_H_ */ +#endif /* MANTID_ALGORITHMS_ESTIMATERESOLUTIONDIFFRACTION_H_ */ diff --git a/Code/Mantid/Framework/Algorithms/src/PDEstimateDetectorResolution.cpp b/Code/Mantid/Framework/Algorithms/src/EstimateResolutionDiffraction.cpp similarity index 88% rename from Code/Mantid/Framework/Algorithms/src/PDEstimateDetectorResolution.cpp rename to Code/Mantid/Framework/Algorithms/src/EstimateResolutionDiffraction.cpp index b664cdfba31..6dbdfafe011 100644 --- a/Code/Mantid/Framework/Algorithms/src/PDEstimateDetectorResolution.cpp +++ b/Code/Mantid/Framework/Algorithms/src/EstimateResolutionDiffraction.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------- // Includes //---------------------------------------------------------------------- -#include "MantidAlgorithms/PDEstimateDetectorResolution.h" +#include "MantidAlgorithms/EstimateResolutionDiffraction.h" #include "MantidGeometry/IDetector.h" #include "MantidGeometry/Instrument/Detector.h" #include "MantidAPI/WorkspaceProperty.h" @@ -22,7 +22,7 @@ using namespace std; namespace Mantid { namespace Algorithms { -DECLARE_ALGORITHM(PDEstimateDetectorResolution) +DECLARE_ALGORITHM(EstimateResolutionDiffraction) namespace { // hide these constants /// @@ -37,34 +37,34 @@ namespace { // hide these constants //---------------------------------------------------------------------------------------------- /** Constructor */ -PDEstimateDetectorResolution::PDEstimateDetectorResolution() {} +EstimateResolutionDiffraction::EstimateResolutionDiffraction() {} //---------------------------------------------------------------------------------------------- /** Destructor */ -PDEstimateDetectorResolution::~PDEstimateDetectorResolution() {} +EstimateResolutionDiffraction::~EstimateResolutionDiffraction() {} -const std::string PDEstimateDetectorResolution::name() const { - return "PDEstimateDetectorResolution"; +const std::string EstimateResolutionDiffraction::name() const { + return "EstimateResolutionDiffraction"; } -const std::string PDEstimateDetectorResolution::alias() const { +const std::string EstimateResolutionDiffraction::alias() const { return "EstimatePDDetectorResolution"; } -const std::string PDEstimateDetectorResolution::summary() const { +const std::string EstimateResolutionDiffraction::summary() const { return "Estimate the resolution of each detector for a powder " "diffractometer. "; } -int PDEstimateDetectorResolution::version() const { return 1; } +int EstimateResolutionDiffraction::version() const { return 1; } -const std::string PDEstimateDetectorResolution::category() const { +const std::string EstimateResolutionDiffraction::category() const { return "Diffraction"; } //---------------------------------------------------------------------------------------------- -void PDEstimateDetectorResolution::init() { +void EstimateResolutionDiffraction::init() { declareProperty( new WorkspaceProperty<MatrixWorkspace>("InputWorkspace", "", Direction::Input), @@ -93,7 +93,7 @@ void PDEstimateDetectorResolution::init() { //---------------------------------------------------------------------------------------------- /** */ -void PDEstimateDetectorResolution::exec() { +void EstimateResolutionDiffraction::exec() { processAlgProperties(); retrieveInstrumentParameters(); @@ -108,14 +108,14 @@ void PDEstimateDetectorResolution::exec() { //---------------------------------------------------------------------------------------------- /** */ -void PDEstimateDetectorResolution::processAlgProperties() { +void EstimateResolutionDiffraction::processAlgProperties() { m_inputWS = getProperty("InputWorkspace"); m_deltaT = getProperty("DeltaTOF"); m_deltaT *= MICROSEC_TO_SEC; // convert to meter } -double PDEstimateDetectorResolution::getWavelength() { +double EstimateResolutionDiffraction::getWavelength() { double wavelength = getProperty("Wavelength"); if (!isEmpty(wavelength)) { @@ -145,7 +145,7 @@ double PDEstimateDetectorResolution::getWavelength() { //---------------------------------------------------------------------------------------------- /** */ -void PDEstimateDetectorResolution::retrieveInstrumentParameters() { +void EstimateResolutionDiffraction::retrieveInstrumentParameters() { double centrewavelength = getWavelength(); g_log.notice() << "Centre wavelength = " << centrewavelength << " Angstrom\n"; if (centrewavelength > WAVELENGTH_MAX) @@ -170,7 +170,7 @@ void PDEstimateDetectorResolution::retrieveInstrumentParameters() { //---------------------------------------------------------------------------------------------- /** */ -void PDEstimateDetectorResolution::createOutputWorkspace() { +void EstimateResolutionDiffraction::createOutputWorkspace() { size_t numspec = m_inputWS->getNumberHistograms(); m_outputWS = boost::dynamic_pointer_cast<MatrixWorkspace>( @@ -183,7 +183,7 @@ void PDEstimateDetectorResolution::createOutputWorkspace() { //---------------------------------------------------------------------------------------------- /** */ -void PDEstimateDetectorResolution::estimateDetectorResolution() { +void EstimateResolutionDiffraction::estimateDetectorResolution() { Instrument_const_sptr instrument = m_inputWS->getInstrument(); V3D samplepos = instrument->getSample()->getPos(); diff --git a/Code/Mantid/Framework/Algorithms/test/PDEstimateDetectorResolutionTest.h b/Code/Mantid/Framework/Algorithms/test/EstimateResolutionDiffractionTest.h similarity index 79% rename from Code/Mantid/Framework/Algorithms/test/PDEstimateDetectorResolutionTest.h rename to Code/Mantid/Framework/Algorithms/test/EstimateResolutionDiffractionTest.h index a7644b47fe6..c0e0c9a261a 100644 --- a/Code/Mantid/Framework/Algorithms/test/PDEstimateDetectorResolutionTest.h +++ b/Code/Mantid/Framework/Algorithms/test/EstimateResolutionDiffractionTest.h @@ -1,15 +1,15 @@ -#ifndef MANTID_ALGORITHMS_PDESTIMATEDETECTORRESOLUTIONTEST_H_ -#define MANTID_ALGORITHMS_PDESTIMATEDETECTORRESOLUTIONTEST_H_ +#ifndef MANTID_ALGORITHMS_ESTIMATERESOLUTIONDIFFRACTIONTEST_H_ +#define MANTID_ALGORITHMS_ESTIMATERESOLUTIONDIFFRACTIONTEST_H_ #include <cxxtest/TestSuite.h> #include "MantidAPI/MatrixWorkspace.h" -#include "MantidAlgorithms/PDEstimateDetectorResolution.h" +#include "MantidAlgorithms/EstimateResolutionDiffraction.h" #include "MantidDataHandling/LoadEmptyInstrument.h" #include "MantidKernel/DateAndTime.h" #include "MantidKernel/TimeSeriesProperty.h" -using Mantid::Algorithms::PDEstimateDetectorResolution; +using Mantid::Algorithms::EstimateResolutionDiffraction; using Mantid::DataHandling::LoadEmptyInstrument; using namespace Mantid; @@ -17,21 +17,21 @@ using namespace Mantid::API; using namespace Mantid::Kernel; using namespace Mantid::DataHandling; -class PDEstimateDetectorResolutionTest : public CxxTest::TestSuite { +class EstimateResolutionDiffractionTest : public CxxTest::TestSuite { public: // This pair of boilerplate methods prevent the suite being created statically // This means the constructor isn't called when running other tests - static PDEstimateDetectorResolutionTest *createSuite() { - return new PDEstimateDetectorResolutionTest(); + static EstimateResolutionDiffractionTest *createSuite() { + return new EstimateResolutionDiffractionTest(); } - static void destroySuite(PDEstimateDetectorResolutionTest *suite) { + static void destroySuite(EstimateResolutionDiffractionTest *suite) { delete suite; } /** Test init */ void test_Init() { - PDEstimateDetectorResolution alg; + EstimateResolutionDiffraction alg; TS_ASSERT_THROWS_NOTHING(alg.initialize()); TS_ASSERT(alg.isInitialized()); } @@ -43,7 +43,7 @@ public: MatrixWorkspace_sptr ws = createInstrument(); // Set up and run - PDEstimateDetectorResolution alg; + EstimateResolutionDiffraction alg; alg.initialize(); TS_ASSERT_THROWS_NOTHING( @@ -98,4 +98,4 @@ public: } }; -#endif /* MANTID_ALGORITHMS_PDESTIMATEDETECTORRESOLUTIONTEST_H_ */ +#endif /* MANTID_ALGORITHMS_ESTIMATERESOLUTIONDIFFRACTIONTEST_H_ */ diff --git a/Code/Mantid/docs/source/algorithms/CalibrateRectangularDetectors-v1.rst b/Code/Mantid/docs/source/algorithms/CalibrateRectangularDetectors-v1.rst index c6b2cb67b0f..c95648178cd 100644 --- a/Code/Mantid/docs/source/algorithms/CalibrateRectangularDetectors-v1.rst +++ b/Code/Mantid/docs/source/algorithms/CalibrateRectangularDetectors-v1.rst @@ -54,6 +54,6 @@ and :math:`fwhm` as the peak's fitted width. Then, .. math:: c_l\times\frac{\Delta(d)}{d} < fwhm < c_h\times\frac{\Delta(d)}{d} -.. seealso :: Algorithm :ref:`algm-PDEstimateDetectorResolution` +.. seealso :: Algorithm :ref:`algm-EstimateResolutionDiffraction` .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/PDEstimateDetectorResolution-v1.rst b/Code/Mantid/docs/source/algorithms/EstimateResolutionDiffraction-v1.rst similarity index 95% rename from Code/Mantid/docs/source/algorithms/PDEstimateDetectorResolution-v1.rst rename to Code/Mantid/docs/source/algorithms/EstimateResolutionDiffraction-v1.rst index 0ba1c56545d..701da1d9791 100644 --- a/Code/Mantid/docs/source/algorithms/PDEstimateDetectorResolution-v1.rst +++ b/Code/Mantid/docs/source/algorithms/EstimateResolutionDiffraction-v1.rst @@ -65,7 +65,7 @@ Usage # Load a Nexus file Load(Filename="PG3_2538_2k.nxs", OutputWorkspace="PG3_2538") # Run the algorithm to estimate detector's resolution - PDEstimateDetectorResolution(InputWorkspace="PG3_2538", DeltaTOF=40.0, OutputWorkspace="PG3_Resolution") + EstimateResolutionDiffraction(InputWorkspace="PG3_2538", DeltaTOF=40.0, OutputWorkspace="PG3_Resolution") resws = mtd["PG3_Resolution"] print "Size of workspace 'PG3_Resolution' = ", resws.getNumberHistograms() diff --git a/Code/Mantid/docs/source/algorithms/GetDetOffsetsMultiPeaks-v1.rst b/Code/Mantid/docs/source/algorithms/GetDetOffsetsMultiPeaks-v1.rst index 90071767de5..9c0fde0e191 100644 --- a/Code/Mantid/docs/source/algorithms/GetDetOffsetsMultiPeaks-v1.rst +++ b/Code/Mantid/docs/source/algorithms/GetDetOffsetsMultiPeaks-v1.rst @@ -265,6 +265,6 @@ Output os.remove( calFilePath ) -.. seealso :: Algorithm :ref:`algm-PDEstimateDetectorResolution` +.. seealso :: Algorithm :ref:`algm-EstimateResolutionDiffraction` .. categories:: -- GitLab