Skip to content

Commit

Permalink
Start to implement CreateLogTimeCorrection. Refs #6737.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Apr 3, 2013
1 parent 4514b7b commit a4bc6e2
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ set ( SRC_FILES
src/CreateFlatEventWorkspace.cpp
src/CreateGroupingWorkspace.cpp
src/CreateLogPropertyTable.cpp
src/CreateLogTimeCorrection.cpp
src/CreatePSDBleedMask.cpp
src/CreatePeaksWorkspace.cpp
src/CreateSingleValuedWorkspace.cpp
Expand Down Expand Up @@ -261,6 +262,7 @@ set ( INC_FILES
inc/MantidAlgorithms/CreateFlatEventWorkspace.h
inc/MantidAlgorithms/CreateGroupingWorkspace.h
inc/MantidAlgorithms/CreateLogPropertyTable.h
inc/MantidAlgorithms/CreateLogTimeCorrection.h
inc/MantidAlgorithms/CreatePSDBleedMask.h
inc/MantidAlgorithms/CreatePeaksWorkspace.h
inc/MantidAlgorithms/CreateSingleValuedWorkspace.h
Expand Down Expand Up @@ -480,6 +482,7 @@ set ( TEST_FILES
CreateFlatEventWorkspaceTest.h
CreateGroupingWorkspaceTest.h
CreateLogPropertyTableTest.h
CreateLogTimeCorrectionTest.h
CreatePSDBleedMaskTest.h
CreatePeaksWorkspaceTest.h
CreateSingleValuedWorkspaceTest.h
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#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_ */
57 changes: 57 additions & 0 deletions Code/Mantid/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#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
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#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_ */

0 comments on commit a4bc6e2

Please sign in to comment.