43 "An input workspace to be saved.");
45 declareProperty(
"InputType",
"",
"To identify what input function is being used.");
50 "The filename to use for the saved data");
55 std::map<std::string, std::string> result;
60 result[
"InputWorkspace"] =
"Workspace not found";
64 const auto nHist =
static_cast<int>(inputWS->getNumberHistograms());
66 result[
"InputWorkspace"] =
"Workspace must contain only one spectrum";
76 const std::string filename =
getProperty(
"Filename");
80 out.open(filename.c_str(), std::ios_base::out);
93 const auto &
y = inputWS->y(0);
95 const std::string inputType =
getProperty(
"InputType");
96 out <<
y.size() << std::endl;
97 out <<
"rmc " << inputType <<
" # " << title << std::endl;
98 std::cout <<
y.size() << std::endl;
99 std::cout <<
"rmc " << inputType <<
" # " << title << std::endl;
103 const auto &
x = inputWS->points(0);
104 const auto &
y = inputWS->y(0);
105 for (
size_t i = 0; i <
x.size(); ++i) {
106 out <<
" " <<
x[i] <<
" " <<
y[i] <<
"\n";
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
@ Save
to specify a file to write to, the file may or may not exist
A property class for workspaces.
SaveRMCProfile : Saves a workspace containing a spectral density in a format readable by the RMCProfi...
const std::string category() const override
Algorithm's category for identification.
void writeMetaData(std::ofstream &out, const API::MatrixWorkspace_const_sptr &inputWS)
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
std::map< std::string, std::string > validateInputs() override
Perform validation of ALL the input properties of the algorithm.
void exec() override
Execute the algorithm.
void init() override
Initialize the algorithm's properties.
void writeWSData(std::ofstream &out, const API::MatrixWorkspace_const_sptr &inputWS)
int version() const override
Algorithm's version for identification.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
Describes the direction (within an algorithm) of a Property.
@ Input
An input workspace.