23 int const &numberOfBins) {
24 if (
static_cast<std::size_t
>(numberOfSpectra) == labels.size()) {
29 throw std::runtime_error(
"The number of spectra is not equal to the number of labels");
33 int const &numberOfBins) {
34 if (
static_cast<std::size_t
>(numberOfBins) == values.size()) {
39 throw std::runtime_error(
"The number of bins is not equal to the number of labels");
43 int const &numberOfBins) {
44 auto groupWorkspace = std::make_shared<WorkspaceGroup>();
45 for (
auto i = 0u; i < numberOfWorkspaces; ++i)
46 groupWorkspace->addWorkspace(
createWorkspace(numberOfSpectra, numberOfBins));
47 return groupWorkspace;
51 std::vector<std::string>
const &labels,
int const &numberOfSpectra,
52 int const &numberOfBins) {
53 auto groupWorkspace = std::make_shared<WorkspaceGroup>();
54 for (
auto i = 0u; i < numberOfWorkspaces; ++i)
56 return groupWorkspace;
60 auto axis =
new TextAxis(numberOfSpectra);
74 for (
int i = 0; i < xLength; ++i)
80 Mantid::HistogramData::BinEdges
const &binEdges) {
81 for (
int i = 0; i < yLength; ++i)
87 Mantid::HistogramData::BinEdges binEdges(xLength - 1, 0.0);
89 std::generate(begin(binEdges), end(binEdges), [&j] {
return 0.5 + 0.75 * ++j; });
102 workspace->initialize(yLength, xLength, xLength - 1);
107 std::vector<double> L2 = {1.0}, polar = {M_PI_4}, azimuthal = {0.};
IPeaksWorkspace_sptr workspace
std::map< DeltaEMode::Type, std::string > index
Class to represent a numeric axis of a workspace.
Class to represent a text axis of a workspace.
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< T > createWorkspace(InitArgs... args)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Mantid::API::MatrixWorkspace_sptr createWorkspaceWithInstrument(int const &xLength, int const &yLength)
Mantid::API::NumericAxis * getNumericAxis(int const &numberOfLabels, std::vector< double > const &values)
Mantid::API::MatrixWorkspace_sptr setWorkspaceProperties(Mantid::API::MatrixWorkspace_sptr workspace, int const &xLength, int const &yLength)
Mantid::API::MatrixWorkspace_sptr createWorkspaceWithTextAxis(int const &numberOfSpectra, std::vector< std::string > const &labels, int const &numberOfBins=10)
Mantid::API::MatrixWorkspace_sptr setWorkspaceEFixed(Mantid::API::MatrixWorkspace_sptr workspace, int const &xLength)
Mantid::API::MatrixWorkspace_sptr setWorkspaceBinEdges(Mantid::API::MatrixWorkspace_sptr workspace, int const &yLength, Mantid::HistogramData::BinEdges const &binEdges)
Mantid::API::MatrixWorkspace_sptr createInstrumentWorkspace(int const &xLength, int const &yLength)
Mantid::API::WorkspaceGroup_sptr createGroupWorkspaceWithTextAxes(std::size_t const &numberOfWorkspaces, std::vector< std::string > const &labels, int const &numberOfSpectra, int const &numberOfBins=10)
Mantid::API::MatrixWorkspace_sptr createWorkspaceWithBinValues(int const &numberOfSpectra, std::vector< double > const &labels, int const &numberOfBins=10)
Mantid::API::MatrixWorkspace_sptr createWorkspaceWithInelasticInstrument(int const &yLength)
Mantid::API::WorkspaceGroup_sptr createGroupWorkspace(std::size_t const &numberOfWorkspaces, int const &numberOfSpectra, int const &numberOfBins=10)
Mantid::API::TextAxis * getTextAxis(int const &numberOfSpectra, std::vector< std::string > const &labels)
Mantid::API::MatrixWorkspace_sptr createProcessedInelasticWS(const std::vector< double > &L2, const std::vector< double > &polar, const std::vector< double > &azimutal, size_t numBins=4, double Emin=-10, double Emax=10, double Ei=11)
Create a workspace with all components needed for inelastic analysis and 3 detectors in specific plac...
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceWithFullInstrument(int nhist, int nbins, bool includeMonitors=false, bool startYNegative=false, bool isHistogram=true, const std::string &instrumentName=std::string("testInst"), bool hasDx=false)
Create a test workspace with a fully defined instrument.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspace(size_t nhist, size_t numBoundaries)