Skip to content
Snippets Groups Projects
Commit e2128e72 authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #8589. Template for new algorithm and tests.

parent 585b0419
No related merge requests found
......@@ -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
......
#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_ */
/*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
#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_ */
......@@ -7,6 +7,7 @@ set ( TEST_PY_FILES
ConjoinSpectraTest.py
CreateLeBailFitInputTest.py
CreateWorkspaceTest.py
CreateTransmissionWorkspaceTest.py
DakotaChiSquaredTest.py
FilterLogByTimeTest.py
FindReflectometryLinesTest.py
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment