Mantid
Loading...
Searching...
No Matches
SaveRKH.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//---------------------------------------------------
10// Includes
11//---------------------------------------------------
12#include "MantidAPI/Algorithm.h"
13#include "MantidDataHandling/DllConfig.h"
14#include <fstream>
15
16namespace Mantid {
17namespace DataHandling {
31class MANTID_DATAHANDLING_DLL SaveRKH final : public API::Algorithm {
32public:
34 const std::string name() const override { return "SaveRKH"; }
36 const std::string summary() const override {
37 return "Save a MatrixWorkspace to a file in the ISIS RKH format (for 1D or 2D data).";
38 }
39
41 int version() const override { return (1); }
42 const std::vector<std::string> seeAlso() const override { return {"LoadRKH"}; }
44 const std::string category() const override { return "DataHandling\\Text"; }
45
48 Q_CODE = 6,
50 LINE_LENGTH = 8
51 };
52
53private:
55 void init() override;
57 void exec() override;
58
59 void writeHeader();
60 void write1D();
61 void write2D();
62
66 bool m_2d{false};
68 std::ofstream m_outRKH;
69};
70} // namespace DataHandling
71} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Saves a workspace in the RKH file format.
Definition SaveRKH.h:31
FileConstants
Constants used in RKH files.
Definition SaveRKH.h:47
std::ofstream m_outRKH
The output filehandle.
Definition SaveRKH.h:68
const std::string name() const override
Algorithm's name.
Definition SaveRKH.h:34
API::MatrixWorkspace_const_sptr m_workspace
The input workspace.
Definition SaveRKH.h:64
const std::string category() const override
Algorithm's category for identification.
Definition SaveRKH.h:44
int version() const override
Algorithm's version.
Definition SaveRKH.h:41
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition SaveRKH.h:42
const std::string summary() const override
Summary of algorithms purpose.
Definition SaveRKH.h:36
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
Helper class which provides the Collimation Length for SANS instruments.