diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingModel.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingModel.h index d430a7772a69..5391083016a7 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingModel.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingModel.h @@ -86,6 +86,9 @@ namespace CustomInterfaces /// Disables points which shouldn't be used for fitting static void disableUnwantedPoints(MatrixWorkspace_sptr ws, const std::vector
& sections); + /// Enable previously disabled points + static void enableDisabledPoints(MatrixWorkspace_sptr destWs, MatrixWorkspace_const_sptr sourceWs); + }; } // namespace CustomInterfaces diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp index 7fd099cbf5d3..688b5f267c1b 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingModel.cpp @@ -39,9 +39,11 @@ namespace CustomInterfaces fit->setProperty("CreateOutput", true); fit->execute(); - MatrixWorkspace_const_sptr fitOutput = fit->getProperty("OutputWorkspace"); + MatrixWorkspace_sptr fitOutput = fit->getProperty("OutputWorkspace"); m_parameterTable = fit->getProperty("OutputParameters"); + enableDisabledPoints(fitOutput,m_data); + setCorrectedData(fitOutput); setFittedFunction(funcToFit); m_sections = sections; @@ -94,6 +96,18 @@ namespace CustomInterfaces } } + /** + * Enable points that were disabled for fit + * @param destWs :: Workspace to enable points in + * @param sourceWs :: Workspace with original errors + */ + void ALCBaselineModellingModel::enableDisabledPoints (MatrixWorkspace_sptr destWs, MatrixWorkspace_const_sptr sourceWs) + { + // Unwanted points were disabled by setting their errors to very high values. + // We recover here the original errors stored in sourceWs + destWs->dataE(0) = sourceWs->readE(0); + } + MatrixWorkspace_sptr ALCBaselineModellingModel::exportWorkspace() { if ( m_data && m_data->getNumberHistograms() == 3 ) {