Skip to content

Commit

Permalink
Added partially finished new algorithm. Refs #9643.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Jul 7, 2014
1 parent 3d7e88d commit 02d725a
Show file tree
Hide file tree
Showing 4 changed files with 478 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/DataHandling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set ( SRC_FILES
src/LoadAscii2.cpp
src/LoadBBY.cpp
src/LoadCalFile.cpp
src/LoadVulcanCalFile.cpp
src/LoadCanSAS1D.cpp
src/LoadCanSAS1D2.cpp
src/LoadDaveGrp.cpp
Expand Down Expand Up @@ -164,6 +165,7 @@ set ( INC_FILES
inc/MantidDataHandling/LoadAscii2.h
inc/MantidDataHandling/LoadBBY.h
inc/MantidDataHandling/LoadCalFile.h
inc/MantidDataHandling/LoadVulcanCalFile.h
inc/MantidDataHandling/LoadCanSAS1D.h
inc/MantidDataHandling/LoadCanSAS1D2.h
inc/MantidDataHandling/LoadDaveGrp.h
Expand Down Expand Up @@ -302,6 +304,7 @@ set ( TEST_FILES
LoadAsciiTest.h
LoadBBYTest.h
LoadCalFileTest.h
LoadVulcanCalFileTest.h
LoadCanSAS1dTest.h
LoadDaveGrpTest.h
LoadDetectorInfoTest.h
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#ifndef MANTID_DATAHANDLING_LOADVULCANCALFILE_H_
#define MANTID_DATAHANDLING_LOADVULCANCALFILE_H_

#include "MantidAPI/Algorithm.h"
#include "MantidAPI/IAlgorithm.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidDataObjects/GroupingWorkspace.h"
#include "MantidDataObjects/MaskWorkspace.h"
#include "MantidDataObjects/OffsetsWorkspace.h"
#include "MantidGeometry/Instrument.h"
#include "MantidKernel/System.h"


namespace Mantid
{
namespace DataHandling
{

/** Algorithm to load a 5-column ascii .cal file into up to 3 workspaces:
* a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.
*/
class DLLExport LoadVulcanCalFile : public API::Algorithm
{
public:
LoadVulcanCalFile();
~LoadVulcanCalFile();

/// Algorithm's name for identification
virtual const std::string name() const { return "LoadVulcanCalFile";}
///Summary of algorithms purpose
virtual const std::string summary() const
{
return "Loads set of VULCAN's offset files into up to 3 workspaces: a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.";
}

/// Algorithm's version for identification
virtual int version() const { return 1;}
/// Algorithm's category for identification
virtual const std::string category() const { return "DataHandling\\Text;Diffraction";}

void getInstrument3WaysInit();

/// Read VULCAN's offset file
void readOffsetFile(DataObjects::OffsetsWorkspace_sptr offsetws, std::string offsetfilename);

Geometry::Instrument_const_sptr getInstrument();

static void readCalFile(const std::string& calFileName,
Mantid::DataObjects::GroupingWorkspace_sptr groupWS, Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS,
Mantid::DataObjects::MaskWorkspace_sptr maskWS);


private:

/// Initialise the properties
void init();
/// Run the algorithm
void exec();
};


} // namespace Mantid
} // namespace DataHandling

#endif /* MANTID_DATAHANDLING_LOADVULCANCALFILE_H_ */

0 comments on commit 02d725a

Please sign in to comment.