Skip to content
Snippets Groups Projects
Commit a4bc6e23 authored by Zhou, Wenduo's avatar Zhou, Wenduo
Browse files

Start to implement CreateLogTimeCorrection. Refs #6737.

parent 4514b7b4
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,7 @@ set ( SRC_FILES ...@@ -52,6 +52,7 @@ set ( SRC_FILES
src/CreateFlatEventWorkspace.cpp src/CreateFlatEventWorkspace.cpp
src/CreateGroupingWorkspace.cpp src/CreateGroupingWorkspace.cpp
src/CreateLogPropertyTable.cpp src/CreateLogPropertyTable.cpp
src/CreateLogTimeCorrection.cpp
src/CreatePSDBleedMask.cpp src/CreatePSDBleedMask.cpp
src/CreatePeaksWorkspace.cpp src/CreatePeaksWorkspace.cpp
src/CreateSingleValuedWorkspace.cpp src/CreateSingleValuedWorkspace.cpp
...@@ -261,6 +262,7 @@ set ( INC_FILES ...@@ -261,6 +262,7 @@ set ( INC_FILES
inc/MantidAlgorithms/CreateFlatEventWorkspace.h inc/MantidAlgorithms/CreateFlatEventWorkspace.h
inc/MantidAlgorithms/CreateGroupingWorkspace.h inc/MantidAlgorithms/CreateGroupingWorkspace.h
inc/MantidAlgorithms/CreateLogPropertyTable.h inc/MantidAlgorithms/CreateLogPropertyTable.h
inc/MantidAlgorithms/CreateLogTimeCorrection.h
inc/MantidAlgorithms/CreatePSDBleedMask.h inc/MantidAlgorithms/CreatePSDBleedMask.h
inc/MantidAlgorithms/CreatePeaksWorkspace.h inc/MantidAlgorithms/CreatePeaksWorkspace.h
inc/MantidAlgorithms/CreateSingleValuedWorkspace.h inc/MantidAlgorithms/CreateSingleValuedWorkspace.h
...@@ -480,6 +482,7 @@ set ( TEST_FILES ...@@ -480,6 +482,7 @@ set ( TEST_FILES
CreateFlatEventWorkspaceTest.h CreateFlatEventWorkspaceTest.h
CreateGroupingWorkspaceTest.h CreateGroupingWorkspaceTest.h
CreateLogPropertyTableTest.h CreateLogPropertyTableTest.h
CreateLogTimeCorrectionTest.h
CreatePSDBleedMaskTest.h CreatePSDBleedMaskTest.h
CreatePeaksWorkspaceTest.h CreatePeaksWorkspaceTest.h
CreateSingleValuedWorkspaceTest.h CreateSingleValuedWorkspaceTest.h
......
#ifndef MANTID_ALGORITHMS_CREATELOGTIMECORRECTION_H_
#define MANTID_ALGORITHMS_CREATELOGTIMECORRECTION_H_
#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidDataObjects/EventWorkspace.h"
namespace Mantid
{
namespace Algorithms
{
/** CreateLogTimeCorrection : Create correction file and workspace to correct event time against
recorded log time for each pixel.
It is assumed that the log time will be the same time as neutron arrives sample,
and the input event workspace contains the neutron with time recorded at the detector.
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 CreateLogTimeCorrection : public API::Algorithm
{
public:
CreateLogTimeCorrection();
virtual ~CreateLogTimeCorrection();
};
} // namespace Algorithms
} // namespace Mantid
#endif /* MANTID_ALGORITHMS_CREATELOGTIMECORRECTION_H_ */
#include "MantidAlgorithms/CreateLogTimeCorrection.h"
#include "MantidAPI/WorkspaceProperty.h"
#include "MantidAPI/FileProperty.h"
using namespace Mantid;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Kernel;
using namespace std;
namespace Mantid
{
namespace Algorithms
{
//----------------------------------------------------------------------------------------------
/** Constructor
*/
CreateLogTimeCorrection::CreateLogTimeCorrection()
{
}
//----------------------------------------------------------------------------------------------
/** Destructor
*/
CreateLogTimeCorrection::~CreateLogTimeCorrection()
{
}
//----------------------------------------------------------------------------------------------
void CreateLogTimeCorrection::init()
{
declareProperty("Instrument", "", "Name of the instrument to create the correction from.");
auto fileprop = new FileProperty("OutputFilename", "", FileProperty::Save);
declareProperty(fileprop, "Name of the output time correction file.");
auto wsprop = new WorkspaceProperty<Workspace2D>("OutpoutWorkspace", "Anonymous", Direction::Output);
declareProperty(wsprop, "Name of the output workspace containing the corrections.");
return;
}
//----------------------------------------------------------------------------------------------
void CreateLogTimeCorrection::exec()
{
}
} // namespace Algorithms
} // namespace Mantid
#ifndef MANTID_ALGORITHMS_CREATELOGTIMECORRECTIONTEST_H_
#define MANTID_ALGORITHMS_CREATELOGTIMECORRECTIONTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidAlgorithms/CreateLogTimeCorrection.h"
using Mantid::Algorithms::CreateLogTimeCorrection;
class CreateLogTimeCorrectionTest : 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 CreateLogTimeCorrectionTest *createSuite() { return new CreateLogTimeCorrectionTest(); }
static void destroySuite( CreateLogTimeCorrectionTest *suite ) { delete suite; }
void test_Something()
{
TSM_ASSERT( "You forgot to write a test!", 0);
}
};
#endif /* MANTID_ALGORITHMS_CREATELOGTIMECORRECTIONTEST_H_ */
\ 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