12#include "MantidDataHandling/DllConfig.h"
22namespace HistogramData {
26namespace DataHandling {
59 const std::string
name()
const override {
return "SaveGSS"; }
61 const std::string
summary()
const override {
return "Saves a focused data set into a three column GSAS format."; }
64 int version()
const override {
return (1); }
65 const std::vector<std::string>
seeAlso()
const override {
66 return {
"LoadGSS",
"SaveVulcanGSS",
"SaveGSASInstrumentFile",
"SaveAscii"};
69 const std::string
category()
const override {
return "Diffraction\\DataHandling;DataHandling\\Text"; }
78 bool areAllDetectorsValid()
const;
81 void processUserSpecifiedHeaders();
84 void generateBankData(std::stringstream &outBuf,
size_t specIndex,
const std::string &outputFormat,
85 const std::vector<int> &slog_xye_precisions)
const;
88 void generateBankHeader(std::stringstream &out,
const API::SpectrumInfo &spectrumInfo,
size_t specIndex)
const;
91 void generateGSASBuffer(
size_t numOutFiles,
size_t numOutSpectra);
94 void generateInstrumentHeader(std::stringstream &out,
double l1)
const;
97 void generateOutFileNames(
size_t numberOfOutFiles);
100 void getLogValue(std::stringstream &out,
const API::Run &runInfo,
const std::string &name,
101 const std::string &failsafeValue =
"UNKNOWN")
const;
104 bool isInstrumentValid()
const;
107 void openFileStream(
const std::string &outFilePath, std::ofstream &outStream);
110 void setOtherProperties(
IAlgorithm *alg,
const std::string &propertyName,
const std::string &propertyValue,
111 int periodNum)
override;
114 std::map<std::string, std::string> validateInputs()
override;
117 void writeBufferToFile(
size_t numOutFiles,
size_t numSpectra);
120 void writeRALFHeader(std::stringstream &out,
int bank,
const HistogramData::Histogram &histo)
const;
123 void writeRALF_ALTdata(std::stringstream &out,
const int bank,
const HistogramData::Histogram &histo)
const;
126 void writeRALF_XYEdata(
const int bank,
const bool MultiplyByBinWidth, std::stringstream &out,
127 const HistogramData::Histogram &histo)
const;
130 void writeSLOGdata(
const size_t ws_index,
const int bank,
const bool MultiplyByBinWidth, std::stringstream &out,
131 const HistogramData::Histogram &histo,
const std::vector<int> &xye_precision)
const;
137 std::vector<std::unique_ptr<std::stringstream>> m_outputBuffer{};
139 std::vector<std::string> m_outFileNames{};
141 bool m_allDetectorsValid{
false};
143 std::unique_ptr<API::Progress> m_progress{
nullptr};
IAlgorithm is the interface implemented by the Algorithm base class.
This class stores information regarding an experimental run as a series of log entries.
Base class for algorithms that can only run serially (Parallel::ExecutionMode::MasterOnly) in an MPI ...
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Saves a focused data set into a three column GSAS format containing X_i, Y_i*step,...
bool m_overwrite_std_gsas_header
flag to overwrite standard GSAS header
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string name() const override
Algorithm's name.
std::vector< std::string > m_user_specified_gsas_header
User specified header string.
API::MatrixWorkspace_const_sptr m_inputWS
Workspace.
const std::string summary() const override
Summary of algorithms purpose.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version.
std::vector< std::string > m_user_specified_bank_headers
User specified bank header.
bool m_overwrite_std_bank_header
flag to overwrite standard GSAS bank header
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.