Skip to content

Commit

Permalink
Added a check to find out occasional OSX error. Refs #7789.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Apr 9, 2014
1 parent 355f5e0 commit bc56ba0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Code/Mantid/Framework/Algorithms/src/FindPeaks.cpp
Expand Up @@ -47,7 +47,6 @@
#include <numeric>
#include "MantidKernel/BoundedValidator.h"
#include "MantidKernel/ListValidator.h"
#include "MantidAPI/TableRow.h"

#include <fstream>

Expand Down Expand Up @@ -303,8 +302,10 @@ namespace Algorithms
{
m_outPeakTableWS = WorkspaceFactory::Instance().createTable("TableWorkspace");
m_outPeakTableWS->addColumn("int", "spectrum");

if (m_rawPeaksTable)
{
// Output raw peak parameters
size_t numpeakpars = m_peakFunction->nParams();
size_t numbkgdpars = m_backgroundFunction->nParams();
for (size_t i = 0; i < numpeakpars; ++i)
Expand All @@ -315,6 +316,7 @@ namespace Algorithms
}
else
{
// Output centre, weight, height, A0, A1 and A2
m_numTableParams = 6;
m_outPeakTableWS->addColumn("double", "centre");
m_outPeakTableWS->addColumn("double", "width");
Expand All @@ -323,6 +325,7 @@ namespace Algorithms
m_outPeakTableWS->addColumn("double", "backgroundslope");
m_outPeakTableWS->addColumn("double", "A2");
}

m_outPeakTableWS->addColumn("double", "chi2");
}

Expand Down Expand Up @@ -1296,12 +1299,19 @@ namespace Algorithms
}
#endif
size_t nparams = peakfunction->nParams();
size_t nparamsb = bkgdfunction->nParams();

size_t numcols = m_outPeakTableWS->columnCount();
if (nparams + nparamsb + 2 != numcols)
{
throw std::runtime_error("Error 1307 number of columns do not matches");
}

for (size_t i = 0; i < nparams; ++i)
{
t << peakfunction->getParameter(i);
}
nparams = bkgdfunction->nParams();
for (size_t i = 0; i < nparams; ++i)
for (size_t i = 0; i < nparamsb; ++i)
{
t << bkgdfunction->getParameter(i);
}
Expand Down

0 comments on commit bc56ba0

Please sign in to comment.