Skip to content
Snippets Groups Projects
Commit 0c562536 authored by Zhou, Wenduo's avatar Zhou, Wenduo
Browse files

Added one more column in output table workspace. Refs #7789.

parent 6fda5889
No related branches found
No related tags found
No related merge requests found
...@@ -157,6 +157,7 @@ namespace Algorithms ...@@ -157,6 +157,7 @@ namespace Algorithms
m_outPeakTableWS->addColumn("double", "bkg0"); m_outPeakTableWS->addColumn("double", "bkg0");
m_outPeakTableWS->addColumn("double", "bkg1"); m_outPeakTableWS->addColumn("double", "bkg1");
m_outPeakTableWS->addColumn("double", "bkg2"); m_outPeakTableWS->addColumn("double", "bkg2");
m_outPeakTableWS->addColumn("int", "GoodFit");
m_outPeakTableWS->appendRow(); m_outPeakTableWS->appendRow();
...@@ -236,6 +237,7 @@ namespace Algorithms ...@@ -236,6 +237,7 @@ namespace Algorithms
} }
size_t min_peak, max_peak; size_t min_peak, max_peak;
double a0,a1,a2; double a0,a1,a2;
int goodfit;
if(peaks.size()> 0) if(peaks.size()> 0)
{ {
g_log.debug() << "Peaks' size = " << peaks.size() << " -> esitmate background. \n"; g_log.debug() << "Peaks' size = " << peaks.size() << " -> esitmate background. \n";
...@@ -248,6 +250,7 @@ namespace Algorithms ...@@ -248,6 +250,7 @@ namespace Algorithms
max_peak = peaks[0].stop + sizex - sizey; max_peak = peaks[0].stop + sizex - sizey;
estimateBackground(inpX, inpY, l0, n, estimateBackground(inpX, inpY, l0, n,
peaks[0].start, peaks[0].stop, a0, a1, a2); peaks[0].start, peaks[0].stop, a0, a1, a2);
goodfit = 1;
} }
else else
{ {
...@@ -261,11 +264,13 @@ namespace Algorithms ...@@ -261,11 +264,13 @@ namespace Algorithms
a0 = 0.0; a0 = 0.0;
a1 = 0.0; a1 = 0.0;
a2 = 0.0; a2 = 0.0;
goodfit = -1;
} }
// Add a new row // Add a new row
API::TableRow t = m_outPeakTableWS->getRow(0); API::TableRow t = m_outPeakTableWS->getRow(0);
t << static_cast<int>(inpwsindex) << static_cast<int>(min_peak) << static_cast<int>(max_peak) << a0 << a1 <<a2; t << static_cast<int>(inpwsindex) << static_cast<int>(min_peak) << static_cast<int>(max_peak)
<< a0 << a1 << a2 << goodfit;
} }
prog.report(); prog.report();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment