Skip to content

Commit

Permalink
Re #11711 Recover original errors
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed May 7, 2015
1 parent d72bb0e commit 85cae08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Expand Up @@ -86,6 +86,9 @@ namespace CustomInterfaces
/// Disables points which shouldn't be used for fitting
static void disableUnwantedPoints(MatrixWorkspace_sptr ws, const std::vector<Section>& sections);

/// Enable previously disabled points
static void enableDisabledPoints(MatrixWorkspace_sptr destWs, MatrixWorkspace_const_sptr sourceWs);

};

} // namespace CustomInterfaces
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 85cae08

Please sign in to comment.