Mantid
Loading...
Searching...
No Matches
SaveNXSPE.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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// Mantid Repository : https://github.com/mantidproject/mantid
8#pragma once
9
10//---------------------------------------------------
11// Includes
12//---------------------------------------------------
13#include "MantidAPI/Algorithm.h"
14#include "MantidDataHandling/DllConfig.h"
15
16namespace Mantid {
17namespace DataHandling {
18
43class MANTID_DATAHANDLING_DLL SaveNXSPE final : public API::Algorithm {
44public:
46 SaveNXSPE();
47 const std::string name() const override { return "SaveNXSPE"; }
49 const std::string summary() const override { return "Writes a MatrixWorkspace to a file in the NXSPE format."; }
50
52 int version() const override { return (1); }
53 const std::vector<std::string> seeAlso() const override { return {"LoadNXSPE", "SaveSPE"}; }
55 const std::string category() const override {
56 return R"(DataHandling\Nexus;DataHandling\SPE;Inelastic\DataHandling)";
57 }
58 // public for testing only
59 std::vector<double> getIndirectEfixed(const Mantid::API::MatrixWorkspace_sptr &inputWS) const;
60
61private:
63 void init() override;
65 void exec() override;
67 std::map<std::string, std::string> validateInputs() override;
68
69 // Some constants to be written for masked values.
71 static const double MASK_FLAG;
73 static const double MASK_ERROR;
75 static const std::string NXSPE_VER;
77 static const size_t MAX_CHUNK_SIZE;
78};
79
80} // namespace DataHandling
81} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Saves a workspace into a NeXus/HDF5 NXSPE file.
Definition SaveNXSPE.h:43
static const size_t MAX_CHUNK_SIZE
The size in bytes of a chunk to accumulate to write to the file at once.
Definition SaveNXSPE.h:77
static const std::string NXSPE_VER
file format version
Definition SaveNXSPE.h:75
const std::string summary() const override
Summary of algorithms purpose.
Definition SaveNXSPE.h:49
const std::string category() const override
Algorithm's category for identification.
Definition SaveNXSPE.h:55
static const double MASK_FLAG
Value for data if pixel is masked.
Definition SaveNXSPE.h:71
const std::string name() const override
function to return a name of the algorithm, must be overridden in all algorithms
Definition SaveNXSPE.h:47
int version() const override
Algorithm's version.
Definition SaveNXSPE.h:52
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 SaveNXSPE.h:53
static const double MASK_ERROR
Value for error if pixel is masked.
Definition SaveNXSPE.h:73
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.