-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start to implement CreateLogTimeCorrection. Refs #6737.
- Loading branch information
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
57
Code/Mantid/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
28 changes: 28 additions & 0 deletions
28
Code/Mantid/Framework/Algorithms/test/CreateLogTimeCorrectionTest.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ */ |