Commit 22efb2f0 authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #21752 add peaknumber

parent ada3d4d1
......@@ -946,6 +946,8 @@ double Peak::getValueByColName(const std::string &name_in) const {
return this->getRow();
else if (name == "col")
return this->getCol();
else if (name == "peaknumber")
return this->getPeakNumber();
else
throw std::runtime_error(
"Peak::getValueByColName() unknown column or column is not a number: " +
......
......@@ -100,10 +100,9 @@ std::vector<double> getZscore(const vector<TYPE> &data) {
std::vector<double> Zscore(data.size(), 0.);
return Zscore;
}
double divisor = stats.standard_deviation / data.size();
for (auto it = data.cbegin(); it != data.cend(); ++it) {
double tmp = static_cast<double>(*it);
Zscore.push_back(fabs(stats.mean - tmp) / divisor;
Zscore.push_back(fabs((stats.mean - tmp) / stats.standard_deviation));
}
return Zscore;
}
......
......@@ -752,7 +752,7 @@ void FindPeaksMD::exec() {
for (auto i = 0; i != peakWS->getNumberPeaks(); ++i) {
auto p = peakWS->getPeak(i);
p.setPeakNumber(i + 1);
p.setPeakNumber(static_cast<int>(i + 1));
}
// Save the output
setProperty("OutputWorkspace", peakWS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment