25using namespace Kernel;
27using namespace HistogramData;
28using namespace DataObjects;
32 "An input TableWorkspace.");
34 "An output Workspace2D.");
36 "The column name for the X vector.");
38 "The column name for the Y vector.");
39 declareProperty(
"ColumnE",
"",
"The column name for the E vector (optional).");
48 const size_t nrows = inputWorkspace->rowCount();
50 throw std::runtime_error(
"The input table is empty");
53 const auto X = inputWorkspace->getColumn(columnX)->numeric_fill<>();
54 const auto Y = inputWorkspace->getColumn(columnY)->numeric_fill<>();
58 outputWorkspace->mutableX(0).assign(
X.cbegin(),
X.cend());
59 outputWorkspace->mutableY(0).assign(
Y.cbegin(),
Y.cend());
61 if (!columnE.empty()) {
62 outputWorkspace->mutableE(0) = inputWorkspace->getColumn(columnE)->numeric_fill<>();
66 labelX->setLabel(columnX);
67 outputWorkspace->getAxis(0)->unit() = labelX;
69 outputWorkspace->setYUnitLabel(columnY);
#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.
A property class for workspaces.
void exec() override
Execution code.
void init() override
Initialisation code.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
Validator to check that a property is not left empty.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< const ITableWorkspace > ITableWorkspace_const_sptr
shared pointer to Mantid::API::ITableWorkspace (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
@ Input
An input workspace.
@ Output
An output workspace.