diff --git a/Code/Mantid/Framework/Algorithms/CMakeLists.txt b/Code/Mantid/Framework/Algorithms/CMakeLists.txt index 369c4dc5f6e40f17299161dec3af67b9d87cf88f..5e90d8ae502d74291d7b903aa5b2c98c246f5304 100644 --- a/Code/Mantid/Framework/Algorithms/CMakeLists.txt +++ b/Code/Mantid/Framework/Algorithms/CMakeLists.txt @@ -60,6 +60,7 @@ set ( SRC_FILES src/CreatePSDBleedMask.cpp src/CreatePeaksWorkspace.cpp src/CreateSingleValuedWorkspace.cpp + src/CreateTransmissionWorkspace.cpp src/CreateWorkspace.cpp src/CropWorkspace.cpp src/CrossCorrelate.cpp @@ -282,6 +283,7 @@ set ( INC_FILES inc/MantidAlgorithms/CreatePSDBleedMask.h inc/MantidAlgorithms/CreatePeaksWorkspace.h inc/MantidAlgorithms/CreateSingleValuedWorkspace.h + inc/MantidAlgorithms/CreateTransmissionWorkspace.h inc/MantidAlgorithms/CreateWorkspace.h inc/MantidAlgorithms/CropWorkspace.h inc/MantidAlgorithms/CrossCorrelate.h @@ -516,6 +518,7 @@ set ( TEST_FILES CreatePSDBleedMaskTest.h CreatePeaksWorkspaceTest.h CreateSingleValuedWorkspaceTest.h + CreateTransmissionWorkspaceTest.h CreateWorkspaceTest.h CropWorkspaceTest.h CuboidGaugeVolumeAbsorptionTest.h diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h new file mode 100644 index 0000000000000000000000000000000000000000..598a9dabf694ff7296a6dd69324b70635d605ea0 --- /dev/null +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h @@ -0,0 +1,56 @@ +#ifndef MANTID_ALGORITHMS_CREATETRANSMISSIONWORKSPACE_H_ +#define MANTID_ALGORITHMS_CREATETRANSMISSIONWORKSPACE_H_ + +#include "MantidKernel/System.h" +#include "MantidAPI/DataProcessorAlgorithm.h" + +namespace Mantid +{ +namespace Algorithms +{ + + /** CreateTransmissionWorkspace : Create a transmission run workspace in Wavelength given one or more TOF workspaces + + Copyright © 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory + + This file is part of Mantid. + + Mantid is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Mantid is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + File change history is stored at: <https://github.com/mantidproject/mantid> + Code Documentation is available at: <http://doxygen.mantidproject.org> + */ + class DLLExport CreateTransmissionWorkspace : public API::DataProcessorAlgorithm + { + public: + CreateTransmissionWorkspace(); + virtual ~CreateTransmissionWorkspace(); + + virtual const std::string name() const; + virtual int version() const; + virtual const std::string category() const; + + private: + virtual void initDocs(); + void init(); + void exec(); + + + }; + + +} // namespace Algorithms +} // namespace Mantid + +#endif /* MANTID_ALGORITHMS_CREATETRANSMISSIONWORKSPACE_H_ */ diff --git a/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aafa8f7d87a1495655f60403c814fd1346c0af98 --- /dev/null +++ b/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp @@ -0,0 +1,74 @@ +/*WIKI* +Creates a transmission run workspace given one or more TOF workspaces and the original run Workspace. If two workspaces are provided, then +the workspaces are stitched together using [[Stitch1D]]. InputWorkspaces must be in TOF. A single output workspace is generated with x-units of Wavlength in angstroms. +*WIKI*/ + +#include "MantidAlgorithms/CreateTransmissionWorkspace.h" + +using namespace Mantid::Kernel; +using namespace Mantid::API; + +namespace Mantid +{ +namespace Algorithms +{ + + // Register the algorithm into the AlgorithmFactory + DECLARE_ALGORITHM(CreateTransmissionWorkspace) + + + + //---------------------------------------------------------------------------------------------- + /** Constructor + */ + CreateTransmissionWorkspace::CreateTransmissionWorkspace() + { + } + + //---------------------------------------------------------------------------------------------- + /** Destructor + */ + CreateTransmissionWorkspace::~CreateTransmissionWorkspace() + { + } + + + //---------------------------------------------------------------------------------------------- + /// Algorithm's name for identification. @see Algorithm::name + const std::string CreateTransmissionWorkspace::name() const { return "CreateTransmissionWorkspace";}; + + /// Algorithm's version for identification. @see Algorithm::version + int CreateTransmissionWorkspace::version() const { return 1;}; + + /// Algorithm's category for identification. @see Algorithm::category + const std::string CreateTransmissionWorkspace::category() const { return "Reflectometry\\ISIS"; } + + //---------------------------------------------------------------------------------------------- + /// Sets documentation strings for this algorithm + void CreateTransmissionWorkspace::initDocs() + { + this->setWikiSummary("Creates a transmission run workspace in Wavelength from input TOF workspaces."); + this->setOptionalMessage(this->getWikiSummary()); + } + + //---------------------------------------------------------------------------------------------- + /** Initialize the algorithm's properties. + */ + void CreateTransmissionWorkspace::init() + { + declareProperty(new WorkspaceProperty<>("InputWorkspace","",Direction::Input), "An input workspace."); + declareProperty(new WorkspaceProperty<>("OutputWorkspace","",Direction::Output), "An output workspace."); + } + + //---------------------------------------------------------------------------------------------- + /** Execute the algorithm. + */ + void CreateTransmissionWorkspace::exec() + { + // TODO Auto-generated execute stub + } + + + +} // namespace Algorithms +} // namespace Mantid diff --git a/Code/Mantid/Framework/Algorithms/test/CreateTransmissionWorkspaceTest.h b/Code/Mantid/Framework/Algorithms/test/CreateTransmissionWorkspaceTest.h new file mode 100644 index 0000000000000000000000000000000000000000..9a7711d0ece83c395583661b999e517ec6d4cd05 --- /dev/null +++ b/Code/Mantid/Framework/Algorithms/test/CreateTransmissionWorkspaceTest.h @@ -0,0 +1,38 @@ +#ifndef MANTID_ALGORITHMS_CREATETRANSMISSIONWORKSPACETEST_H_ +#define MANTID_ALGORITHMS_CREATETRANSMISSIONWORKSPACETEST_H_ + +#include <cxxtest/TestSuite.h> + +#include "MantidAlgorithms/CreateTransmissionWorkspace.h" + +using Mantid::Algorithms::CreateTransmissionWorkspace; + +class CreateTransmissionWorkspaceTest : 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 CreateTransmissionWorkspaceTest *createSuite() { return new CreateTransmissionWorkspaceTest(); } + static void destroySuite( CreateTransmissionWorkspaceTest *suite ) { delete suite; } + + + void test_Init() + { + CreateTransmissionWorkspace alg; + TS_ASSERT_THROWS_NOTHING( alg.initialize() ) + TS_ASSERT( alg.isInitialized() ) + } + + void test_exec() + { + } + + void test_Something() + { + } + + +}; + + +#endif /* MANTID_ALGORITHMS_CREATETRANSMISSIONWORKSPACETEST_H_ */ diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt index c68b6d8ba1f853d05c8a4aa7f8ed7eac835833d7..7bad2236ccb57350a81a654937c665271a99216c 100644 --- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt +++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt @@ -7,6 +7,7 @@ set ( TEST_PY_FILES ConjoinSpectraTest.py CreateLeBailFitInputTest.py CreateWorkspaceTest.py + CreateTransmissionWorkspaceTest.py DakotaChiSquaredTest.py FilterLogByTimeTest.py FindReflectometryLinesTest.py diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CreateTransmissionWorkspaceTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CreateTransmissionWorkspaceTest.py new file mode 100644 index 0000000000000000000000000000000000000000..696279178f6589707087edeb44f7189243a35496 --- /dev/null +++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CreateTransmissionWorkspaceTest.py @@ -0,0 +1,13 @@ +import unittest + +class CreateTransmissionWorkspaceTest(unittest.TestCase): + + def setUp(self): + pass + + def tearDown(self): + pass + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file