diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp index a81ec754d9d059e317b19737fa62c8d006777776..14422675bda8c9d02486c972b3bcdbf365517ca4 100644 --- a/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp +++ b/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp @@ -179,6 +179,9 @@ void MuonRemoveExpDecay::exec() PARALLEL_CHECK_INTERUPT_REGION } + // Update Y axis label + outputWS->setYUnitLabel("Asymmetry"); + setProperty("OutputWorkspace", outputWS); } diff --git a/Code/Mantid/Framework/Algorithms/test/RemoveExpDecayTest.h b/Code/Mantid/Framework/Algorithms/test/RemoveExpDecayTest.h index 3890a4f750186862ad73b40669f87033cb7db949..078029a8e1f2b6818d7b1008c18db36196f0e322 100644 --- a/Code/Mantid/Framework/Algorithms/test/RemoveExpDecayTest.h +++ b/Code/Mantid/Framework/Algorithms/test/RemoveExpDecayTest.h @@ -3,12 +3,14 @@ #include <cxxtest/TestSuite.h> +#include "MantidAPI/AnalysisDataService.h" +#include "MantidAPI/Workspace.h" +#include "MantidAlgorithms/RemoveExpDecay.h" #include "MantidDataHandling/LoadInstrument.h" #include "MantidDataHandling/LoadMuonNexus2.h" -#include "MantidAlgorithms/RemoveExpDecay.h" -#include "MantidAPI/Workspace.h" #include "MantidDataObjects/Workspace2D.h" -#include "MantidAPI/AnalysisDataService.h" +#include "MantidTestHelpers/WorkspaceCreationHelper.h" + #include <stdexcept> using namespace Mantid::Algorithms; @@ -90,6 +92,30 @@ public: } } + void test_yUnitLabel() + { + const std::string outputWSName = "RemoveExpDecayTest_yUnitLabel_OutputWS"; + + auto ws = WorkspaceCreationHelper::Create2DWorkspace(1,1); + + MuonRemoveExpDecay alg; + alg.initialize(); + alg.setProperty("InputWorkspace", ws); + alg.setProperty("OutputWorkspace", outputWSName); + alg.execute(); + + auto result = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(outputWSName); + + TS_ASSERT(result); + + if( result ) + { + TS_ASSERT_EQUALS( result->YUnitLabel(), "Asymmetry" ); + } + + AnalysisDataService::Instance().remove(outputWSName); + } + private: MuonRemoveExpDecay alg; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp index 1a8ef03efadb821f42cf724c6cb1d204d1ea6394..cd0d4e574ebaf396c0676dbabbf7cc1d2dca1854 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp @@ -2407,14 +2407,6 @@ void MuonAnalysis::plotGroup(const std::string& plotType) // note after running this method you are just left with the processed cropWS (and curresponding _Raw) handlePeriodChoice(cropWS, periodLabel, wsGroupName); - // set the workspace Y Unit label - Workspace_sptr ws_ptr = AnalysisDataService::Instance().retrieve(cropWS.toStdString()); - MatrixWorkspace_sptr matrix_workspace = boost::dynamic_pointer_cast<MatrixWorkspace>(ws_ptr); - matrix_workspace->setYUnitLabel(plotType); - ws_ptr = AnalysisDataService::Instance().retrieve((cropWS+"_Raw").toStdString()); - matrix_workspace = boost::dynamic_pointer_cast<MatrixWorkspace>(ws_ptr); - matrix_workspace->setYUnitLabel(plotType); - // plot the spectrum plotSpectrum(cropWS, groupNum, plotOnLogScale);