Skip to content

Commit

Permalink
refs #5537 Mainly completed
Browse files Browse the repository at this point in the history
but some small bits and pieces can remain.
  • Loading branch information
abuts committed Jul 3, 2012
1 parent 1389de9 commit 6be344f
Show file tree
Hide file tree
Showing 35 changed files with 162 additions and 1,181 deletions.
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/MDAlgorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ set ( TEST_FILES
test/BooleanBinaryOperationMDTest.h
test/CobaltSWDTest.h
test/CompareMDWorkspacesTest.h
test/ConvertEventsToMDEventsTest.h
test/ConvertEventsToMDTest.h
test/ConvertToDetectorFaceMDTest.h
test/ConvertToMDEventsTest.h
test/ConvertToMDEventsTestPerformance.h
test/ConvertToMDTest.h
test/ConvertToMDTestPerformance.h
test/ConvertToQ3DdETest.h
test/DampedHisenbergFMSWTest.h
test/DivideMDTest.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Mantid
namespace MDAlgorithms
{

/** ConvertToMDEvents :
/** ConvertToMD :
* Transfrom a workspace into MD workspace with components defined by user.
*
* Gateway for number of subalgorithms, some are very important, some are questionable
Expand Down Expand Up @@ -46,14 +46,14 @@ namespace MDAlgorithms


/// Convert to MD Events class itself:
class DLLExport ConvertToMDEvents : public MDEvents::BoxControllerSettingsAlgorithm, public API::DeprecatedAlgorithm
class DLLExport ConvertToMD : public MDEvents::BoxControllerSettingsAlgorithm
{
public:
ConvertToMDEvents();
~ConvertToMDEvents();
ConvertToMD();
~ConvertToMD();

/// Algorithm's name for identification
virtual const std::string name() const { return "ConvertToMDEvents";};
virtual const std::string name() const { return "ConvertToMD";};
/// Algorithm's version for identification
virtual int version() const { return 1;};
/// Algorithm's category for identification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Mantid
namespace MDAlgorithms
{

/** ConvertToMDEvents :
/** ConvertToMD :
* Transfrom a workspace into MD workspace with components defined by user.
*
* Gateway for number of subalgorithms, some are very important, some are questionable
Expand Down
32 changes: 14 additions & 18 deletions Code/Mantid/Framework/MDAlgorithms/src/ConvertToMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Depending on the user input and the data, find in the input workspace, the algor
*WIKI*/

#include "MantidMDAlgorithms/ConvertToMDEvents.h"
#include "MantidMDAlgorithms/ConvertToMD.h"

#include "MantidKernel/PhysicalConstants.h"
#include "MantidKernel/ProgressText.h"
Expand Down Expand Up @@ -37,26 +37,26 @@ using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Geometry;
using namespace Mantid::MDEvents;
using namespace Mantid::MDEvents::ConvertToMD;
using namespace Mantid::MDEvents::CnvrtToMD;
namespace Mantid
{
namespace MDAlgorithms
{

// logger for the algorithm workspaces
Kernel::Logger& ConvertToMDEvents::convert_log =Kernel::Logger::get("MD-Algorithms");
Kernel::Logger& ConvertToMD::convert_log =Kernel::Logger::get("MD-Algorithms");
// the variable describes the locations of the preprocessed detectors, which can be stored and reused if the algorithm runs more then once;
MDEvents::ConvToMDPreprocDet ConvertToMDEvents::det_loc;
MDEvents::ConvToMDPreprocDet ConvertToMD::det_loc;
//
Mantid::Kernel::Logger &
ConvertToMDEvents::getLogger(){return convert_log;}
ConvertToMD::getLogger(){return convert_log;}
//
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(ConvertToMDEvents)
DECLARE_ALGORITHM(ConvertToMD)


// Sets documentation strings for this algorithm
void ConvertToMDEvents::initDocs()
void ConvertToMD::initDocs()
{
this->setWikiSummary("Create a MDEventWorkspace with selected dimensions, e.g. the reciprocal space of momentums (Qx, Qy, Qz) or momentums modules |Q|, energy transfer dE if availible and any other user specified log values which can be treated as dimensions. If the OutputWorkspace exists, it will be replaced");
this->setOptionalMessage("Create a MDEventWorkspace with selected dimensions, e.g. the reciprocal space of momentums (Qx, Qy, Qz) or momentums modules |Q|, energy transfer dE if availible and any other user specified log values which can be treated as dimensions. If the OutputWorkspace exists, it will be replaced");
Expand All @@ -65,7 +65,7 @@ void ConvertToMDEvents::initDocs()
//----------------------------------------------------------------------------------------------
/** Destructor
*/
ConvertToMDEvents::~ConvertToMDEvents()
ConvertToMD::~ConvertToMD()
{
// if the algorithm has gone, then the preprocessed detectors should probably too
det_loc.clearAll();
Expand All @@ -76,7 +76,7 @@ ConvertToMDEvents::~ConvertToMDEvents()
/** Initialize the algorithm's properties.
*/
void
ConvertToMDEvents::init()
ConvertToMD::init()
{
auto ws_valid = boost::make_shared<CompositeValidator>();
//
Expand Down Expand Up @@ -108,7 +108,7 @@ ConvertToMDEvents::init()

MDEvents::MDWSTransform QScl;
std::vector<std::string> QScales = QScl.getQScalings();
declareProperty("QConversionScales",QScales[ConvertToMD::NoScaling], boost::make_shared<StringListValidator>(QScales),
declareProperty("QConversionScales",QScales[CnvrtToMD::NoScaling], boost::make_shared<StringListValidator>(QScales),
"This property to normalize three momentums obtained in Q3D mode. Possible values are:\n"
" No Scaling, -- momentums in Momentum or MomentumTransfer units A^-1\n"
" Q in lattice units -- single scale, where all momentums are divided by the minimal reciprocal lattice vector 2*Pi/Max(a_latt)\n"
Expand All @@ -119,7 +119,7 @@ ConvertToMDEvents::init()
/// temporary
MDEvents::MDTransfDEHelper AlldEModes;
std::vector<std::string> dE_modes = AlldEModes.getEmodes();
declareProperty("dEAnalysisMode",dE_modes[ConvertToMD::Direct],boost::make_shared<StringListValidator>(dE_modes),
declareProperty("dEAnalysisMode",dE_modes[CnvrtToMD::Direct],boost::make_shared<StringListValidator>(dE_modes),
"You can analyse neutron energy transfer in direct, indirect or elastic mode. The analysis mode has to correspond to experimental set up.\n"
" Selecting inelastic mode increases the number of the target workspace dimensions by one. (by DeltaE -- the energy transfer)\n"
"""NoDE"" choice corresponds to ""CopyToMD"" analysis mode and is selected automatically if the QDimensions is set to ""CopyToMD""",Direction::InOut);
Expand Down Expand Up @@ -183,7 +183,7 @@ ConvertToMDEvents::init()

//----------------------------------------------------------------------------------------------
/* Execute the algorithm. */
void ConvertToMDEvents::exec()
void ConvertToMD::exec()
{
// initiate class which would deal with any dimension workspaces, handling
if(!pWSWrapper)
Expand Down Expand Up @@ -348,12 +348,8 @@ void ConvertToMDEvents::exec()
}

/** Constructor */
ConvertToMDEvents::ConvertToMDEvents()
{
this->useAlgorithm("ConvertToMD");
this->deprecatedDate("2012-07-01");

}
ConvertToMD::ConvertToMD()
{}


} // namespace Mantid
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Geometry;
using namespace Mantid::MDEvents;
using namespace Mantid::MDEvents::ConvertToMD;
using namespace Mantid::MDEvents::CnvrtToMD;
namespace Mantid
{
namespace MDAlgorithms
Expand Down Expand Up @@ -108,7 +108,7 @@ ConvertToMDEvents::init()

MDEvents::MDWSTransform QScl;
std::vector<std::string> QScales = QScl.getQScalings();
declareProperty("QConversionScales",QScales[ConvertToMD::NoScaling], boost::make_shared<StringListValidator>(QScales),
declareProperty("QConversionScales",QScales[CnvrtToMD::NoScaling], boost::make_shared<StringListValidator>(QScales),
"This property to normalize three momentums obtained in Q3D mode. Possible values are:\n"
" No Scaling, -- momentums in Momentum or MomentumTransfer units A^-1\n"
" Q in lattice units -- single scale, where all momentums are divided by the minimal reciprocal lattice vector 2*Pi/Max(a_latt)\n"
Expand All @@ -119,7 +119,7 @@ ConvertToMDEvents::init()
/// temporary
MDEvents::MDTransfDEHelper AlldEModes;
std::vector<std::string> dE_modes = AlldEModes.getEmodes();
declareProperty("dEAnalysisMode",dE_modes[ConvertToMD::Direct],boost::make_shared<StringListValidator>(dE_modes),
declareProperty("dEAnalysisMode",dE_modes[CnvrtToMD::Direct],boost::make_shared<StringListValidator>(dE_modes),
"You can analyse neutron energy transfer in direct, indirect or elastic mode. The analysis mode has to correspond to experimental set up.\n"
" Selecting inelastic mode increases the number of the target workspace dimensions by one. (by DeltaE -- the energy transfer)\n"
"""NoDE"" choice corresponds to ""CopyToMD"" analysis mode and is selected automatically if the QDimensions is set to ""CopyToMD""",Direction::InOut);
Expand Down

This file was deleted.

14 changes: 7 additions & 7 deletions Code/Mantid/Framework/MDAlgorithms/test/ConvertToMDTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "MantidKernel/System.h"
#include "MantidKernel/Timer.h"
#include "MantidAPI/TextAxis.h"
#include "MantidMDAlgorithms/ConvertToMDEvents.h"
#include "MantidMDAlgorithms/ConvertToMD.h"
#include "MantidTestHelpers/ComponentCreationHelper.h"
#include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h"
Expand All @@ -21,7 +21,7 @@ using namespace Mantid::DataObjects;
using namespace Mantid::MDAlgorithms;
using namespace Mantid::MDEvents;

class Convert2AnyTestHelper: public ConvertToMDEvents
class Convert2AnyTestHelper: public ConvertToMD
{
public:
Convert2AnyTestHelper(){};
Expand All @@ -39,12 +39,12 @@ std::vector<std::string> dim_availible()
return data_names_in_WS;
}
//
class ConvertToMDEventsTest : public CxxTest::TestSuite
class ConvertToMDTest : public CxxTest::TestSuite
{
std::auto_ptr<Convert2AnyTestHelper> pAlg;
public:
static ConvertToMDEventsTest *createSuite() { return new ConvertToMDEventsTest(); }
static void destroySuite(ConvertToMDEventsTest * suite) { delete suite; }
static ConvertToMDTest *createSuite() { return new ConvertToMDTest(); }
static void destroySuite(ConvertToMDTest * suite) { delete suite; }


void testInit(){
Expand Down Expand Up @@ -157,7 +157,7 @@ void testAlgorithmProperties()
3) Finally this unit test should be updated so that the tests pass.
*/

ConvertToMDEvents alg;
ConvertToMD alg;
alg.initialize();

Mantid::Kernel::Property *QDimProperty;
Expand Down Expand Up @@ -185,7 +185,7 @@ void testAlgorithmProperties()
}


ConvertToMDEventsTest(){
ConvertToMDTest(){
pAlg = std::auto_ptr<Convert2AnyTestHelper>(new Convert2AnyTestHelper());
Mantid::API::MatrixWorkspace_sptr ws2D =WorkspaceCreationHelper::createProcessedWorkspaceWithCylComplexInstrument(4,10,true);
// rotate the crystal by twenty degrees back;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "MantidKernel/CPUTimer.h"

#include "MantidAPI/TextAxis.h"
#include "MantidMDAlgorithms/ConvertToMDEvents.h"
#include "MantidMDAlgorithms/ConvertToMD.h"
#include "MantidTestHelpers/ComponentCreationHelper.h"
#include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h"
Expand All @@ -29,7 +29,7 @@ using namespace Mantid::MDEvents;
using namespace Mantid::MDAlgorithms;


class ConvertToMDEventsTestPerformance : public CxxTest::TestSuite
class ConvertToMDTestPerformance : public CxxTest::TestSuite
{
Kernel::CPUTimer Clock;
time_t start,end;
Expand All @@ -50,8 +50,8 @@ class ConvertToMDEventsTestPerformance : public CxxTest::TestSuite
boost::shared_ptr<MDEvents::MDEventWSWrapper> pTargWS;

public:
static ConvertToMDEventsTestPerformance *createSuite() { return new ConvertToMDEventsTestPerformance(); }
static void destroySuite(ConvertToMDEventsTestPerformance * suite) { delete suite; }
static ConvertToMDTestPerformance *createSuite() { return new ConvertToMDTestPerformance(); }
static void destroySuite(ConvertToMDTestPerformance * suite) { delete suite; }



Expand Down Expand Up @@ -195,7 +195,7 @@ void test_HistoNoUnitsConv()
}


ConvertToMDEventsTestPerformance():
ConvertToMDTestPerformance():
Rot(3,3)
{
numHist=100*100;
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions Code/Mantid/Framework/MDEvents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ set ( TEST_FILES
test/CentroidPeaksMDTest.h
test/CloneMDWorkspaceTest.h
test/ConvertToDiffractionMDWorkspaceTest.h
test/ConvertToMDEventsParamsTest.h
test/ConvertToMDEventsSubalgFactoryTest.h
test/ConvertToMDEventsUnitsConvTest.h
test/ConvertToMDEventsWSTest.h
test/ConvertToMDParamsTest.h
test/ConvertToMDFactoryTest.h
test/ConvertToMDUnitsConvTest.h
test/ConvertToMDWSTest.h
test/ConvertToReflectometryQTest.h
test/CoordTransformAffineParserTest.h
test/CoordTransformAffineTest.h
Expand Down

0 comments on commit 6be344f

Please sign in to comment.