Skip to content
Snippets Groups Projects
Commit 9a14d63e authored by Michael Wedel's avatar Michael Wedel
Browse files

Merge pull request #495 from mantidproject/11429_stitch1dmany_overwrites_output

I tested the changes running this slightly modified usage example, which puts each of the workspaces into a WorkspaceGroup first. Without these changes the two resulting WorkspaceGroups contain the same workspace (the first one is overwritten), after the changes this does not happen, as described in the ticket.

```
trans1 = Load('INTER00013463')
trans2 = Load('INTER00013464')

trans1_wav = CreateTransmissionWorkspaceAuto(trans1)
trans2_wav = CreateTransmissionWorkspaceAuto(trans2)

wsGroup1 = GroupWorkspaces("trans1_wav")
wsGroup2 = GroupWorkspaces("trans2_wav")

stitched_wav1, y = Stitch1DMany("wsGroup1,wsGroup2", params='1, 0.02, 17', UseManualScaleFactor=True, ManualScaleFactor=0.85)
stitched_wav2, y = Stitch1DMany("wsGroup1,wsGroup2", params='1, 0.05, 17', UseManualScaleFactor=True, ManualScaleFactor=3.85)
```
parents 6fda92bb a7e84242
No related branches found
No related tags found
No related merge requests found
......@@ -207,18 +207,20 @@ void Stitch1DMany::exec() {
// List of workspaces to be grouped
std::vector<std::string> toGroup;
const std::string groupName = this->getProperty("OutputWorkspace");
size_t numWSPerGroup = groupWorkspaces[0]->size();
for (size_t i = 0; i < numWSPerGroup; ++i) {
// List of workspaces to stitch
std::vector<std::string> toProcess;
// The name of the resulting workspace
std::string outName;
std::string outName = groupName;
for (size_t j = 0; j < groupWorkspaces.size(); ++j) {
const std::string wsName = groupWorkspaces[j]->getItem(i)->name();
toProcess.push_back(wsName);
outName += wsName;
outName += "_" + wsName;
}
IAlgorithm_sptr stitchAlg = createChildAlgorithm("Stitch1DMany");
......@@ -245,8 +247,6 @@ void Stitch1DMany::exec() {
scaleFactors.end());
}
const std::string groupName = this->getProperty("OutputWorkspace");
IAlgorithm_sptr groupAlg = createChildAlgorithm("GroupWorkspaces");
groupAlg->initialize();
groupAlg->setAlwaysStoreInADS(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment