Mantid
Loading...
Searching...
No Matches
SaveFocusedXYE.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
10#include "MantidDataHandling/DllConfig.h"
11
12namespace Mantid {
13namespace DataHandling {
43class MANTID_DATAHANDLING_DLL SaveFocusedXYE : public API::SerialAlgorithm {
44public:
45 enum HeaderType { XYE, MAUD, TOPAS };
47 const std::string name() const override { return "SaveFocusedXYE"; }
49 const std::string summary() const override {
50 return "Saves a focused data set (usually the output of a diffraction "
51 "focusing routine but not exclusively) into a three column format "
52 "containing X_i, Y_i, and E_i.";
53 }
54
56 int version() const override { return (1); }
57 const std::vector<std::string> seeAlso() const override { return {"SaveFullprofResolution", "SaveAscii"}; }
59 const std::string category() const override { return "Diffraction\\DataHandling;DataHandling\\Text"; }
60
61private:
63 void init() override;
65 void exec() override;
67 void writeHeaders(std::ostream &os, API::MatrixWorkspace_const_sptr &workspace) const;
69 void writeXYEHeaders(std::ostream &os, API::MatrixWorkspace_const_sptr &workspace) const;
71 void writeMAUDHeaders(std::ostream &os, API::MatrixWorkspace_const_sptr &workspace) const;
73 void writeSpectraHeader(std::ostream &os, size_t index1, size_t index2, double flightPath, double tth,
74 const std::string &caption, const std::string &spectraAxisCaption,
75 const std::string &spectraAxisLabel, double observable);
77 void writeXYESpectraHeader(std::ostream &os, size_t index1, const std::string &caption,
78 const std::string &spectrumAxisCaption, const std::string &spectraAxisLabel,
79 double observable);
81 void writeMAUDSpectraHeader(std::ostream &os, size_t index1, size_t index2, double flightPath, double tth,
82 const std::string &caption);
84 void setOtherProperties(IAlgorithm *alg, const std::string &propertyName, const std::string &propertyValue,
85 int perioidNum) override;
86
88 HeaderType m_headerType{XYE};
90 std::string m_comment;
91};
92} // namespace DataHandling
93} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:45
Base class for algorithms that can only run serially (Parallel::ExecutionMode::MasterOnly) in an MPI ...
Saves a focused data set (usually output of a diffraction focusing routine but not exclusively) into ...
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version.
const std::string summary() const override
Summary of algorithms purpose.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
std::string m_comment
Comment character.
const std::string name() const override
Algorithm's name.
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.