Skip to content

Commit

Permalink
Rebin the diff workspaces before minus
Browse files Browse the repository at this point in the history
Refs #10802
  • Loading branch information
DanNixon committed Jan 23, 2015
1 parent 85a6176 commit 9a3ff9e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp
Expand Up @@ -452,12 +452,23 @@ void DataComparison::plotDiffWorkspace()
extractWs2Alg->execute();
MatrixWorkspace_sptr ws2SpecWs = extractWs2Alg->getProperty("OutputWorkspace");

// Rebin the second workspace to the first
// (needed for identical binning for Minus algorithm)
IAlgorithm_sptr rebinAlg = AlgorithmManager::Instance().create("RebinToWorkspace");
rebinAlg->setChild(true);
rebinAlg->initialize();
rebinAlg->setProperty("WorkspaceToRebin", ws2SpecWs);
rebinAlg->setProperty("WorkspaceToMatch", ws1SpecWs);
rebinAlg->setProperty("OutputWorkspace", "__ws2_spec_rebin");
rebinAlg->execute();
MatrixWorkspace_sptr rebinnedWs2SpecWs = rebinAlg->getProperty("OutputWorkspace");

// Subtract the two extracted spectra
IAlgorithm_sptr minusAlg = AlgorithmManager::Instance().create("Minus");
minusAlg->setChild(true);
minusAlg->initialize();
minusAlg->setProperty("LHSWorkspace", ws1SpecWs);
minusAlg->setProperty("RHSWorkspace", ws2SpecWs);
minusAlg->setProperty("RHSWorkspace", rebinnedWs2SpecWs);
minusAlg->setProperty("OutputWorkspace", "__diff");
minusAlg->execute();
MatrixWorkspace_sptr diffWorkspace = minusAlg->getProperty("OutputWorkspace");
Expand Down
3 changes: 3 additions & 0 deletions Code/Mantid/docs/source/interfaces/DataComparison.rst
Expand Up @@ -14,6 +14,9 @@ The data comparison interface provides a method of comparing the spectra of
multiple :ref:`MatrixWorkspace <MatrixWorkspace>` (either pre loaded into
Mantid or loaded via the interface its self) using a preview plot.

Note that data in this plot is not normalised to bin width as it is by default
in Mantid plot windows.

Add Data
--------

Expand Down

0 comments on commit 9a3ff9e

Please sign in to comment.