72 std::string instrumentID = inst_name;
74 std::transform(instrumentID.begin(), instrumentID.end(), instrumentID.begin(), toupper);
79 loadInst.
setPropertyValue(
"Filename",
"unit_testing/" + instrumentID +
"_Definition.xml");
93 int nxbins,
int nybins) {
96 size_t nXbins, nYbins;
97 std::shared_ptr<const Instrument> instrument =
workspace->getInstrument();
98 std::vector<detid_t> monitors = instrument->getMonitors();
103 std::stringstream
error;
104 error <<
"Geometry error for " << instrument->getName() <<
": Spice data format defines 2 monitors, " <<
nMonitors
105 <<
" were/was found";
106 throw std::runtime_error(
error.str());
109 nXbins = size_t(nxbins);
111 throw std::invalid_argument(
"number of x-bins < 0");
114 nYbins = size_t(nybins);
116 throw std::invalid_argument(
"number of y-bins < 0");
133 for (
size_t ix = 0; ix < nXbins; ix++) {
134 for (
size_t iy = 0; iy < nYbins; iy++) {
136 workspace->getSpectrum(wi).setDetectorID(
detid_t(1000000 + iy * 1000 + ix));
IPeaksWorkspace_sptr workspace
void initialize() override
Initialization method invoked by the framework.
bool execute() override final
The actions to be performed by the algorithm on a dataset.
void setPropertyValue(const std::string &name, const std::string &value) override
Set the value of a property by string N.B.
Loads instrument data from an XML or Nexus instrument description file and adds it to a workspace.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
OptionalBool : Tri-state bool.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
static const int nMonitors
static void runLoadMappingTable(const Mantid::DataObjects::Workspace2D_sptr &workspace, int nxbins, int nybins)
Populate spectra mapping to detector IDs.
static void runLoadInstrument(const std::string &inst_name, const Mantid::DataObjects::Workspace2D_sptr &workspace)
Run the Child Algorithm LoadInstrument (as for LoadRaw)
static Mantid::DataObjects::Workspace2D_sptr createSANSInstrumentWorkspace(const std::string &workspace)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
int32_t detid_t
Typedef for a detector ID.
int32_t specnum_t
Typedef for a spectrum Number.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspace123(int64_t nHist, int64_t nBins, bool isHist=false, const std::set< int64_t > &maskedWorkspaceIndices=std::set< int64_t >(), bool hasDx=false)