Skip to content

Commit

Permalink
Re #11663 Get table from fit alg and export it
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Apr 30, 2015
1 parent 454e6e6 commit 39288bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Expand Up @@ -74,6 +74,9 @@ namespace CustomInterfaces
/// Result function of the last fit
IFunction_const_sptr m_fittedFunction;

/// Fit table containing parameters and errors
ITableWorkspace_sptr m_parameterTable;

/// Sections used for the last fit
std::vector<Section> m_sections;

Expand Down
Expand Up @@ -40,6 +40,7 @@ namespace CustomInterfaces
fit->execute();

MatrixWorkspace_sptr fitOutput = fit->getProperty("OutputWorkspace");
m_parameterTable = fit->getProperty("OutputParameters");

IAlgorithm_sptr extract = AlgorithmManager::Instance().create("ExtractSingleSpectrum");
extract->setChild(true);
Expand All @@ -51,6 +52,7 @@ namespace CustomInterfaces
setCorrectedData(extract->getProperty("OutputWorkspace"));
setFittedFunction(funcToFit);
m_sections = sections;

}

void ALCBaselineModellingModel::setData(MatrixWorkspace_const_sptr data)
Expand Down Expand Up @@ -170,16 +172,9 @@ namespace CustomInterfaces

ITableWorkspace_sptr ALCBaselineModellingModel::exportModel()
{
if ( m_fittedFunction ) {

ITableWorkspace_sptr table = WorkspaceFactory::Instance().createTable("TableWorkspace");
if ( m_parameterTable ) {

table->addColumn("str", "Function");

TableRow newRow = table->appendRow();
newRow << m_fittedFunction->asString();

return table;
return m_parameterTable;

} else {

Expand Down

0 comments on commit 39288bc

Please sign in to comment.