Skip to content
Snippets Groups Projects
Commit edff35a4 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

Datafield: norm and crop for error sigmas

parent db213774
No related branches found
No related tags found
1 merge request!1001GUI: show error bars for loaded reflectivity data
......@@ -62,7 +62,7 @@ Datafield::~Datafield() {}
Datafield* Datafield::clone() const
{
return new Datafield(m_frame->cloned_axes(), m_values);
return new Datafield(m_frame->cloned_axes(), m_values, m_errSigmas);
}
void Datafield::setAt(size_t i, double val)
......@@ -156,7 +156,13 @@ Datafield* Datafield::normalizedToMaximum() const
std::vector<double> out(frame().size());
for (size_t i = 0; i < frame().size(); ++i)
out[i] = m_values[i] / maxval;
return new Datafield(m_frame->cloned_axes(), out);
// error sigmas
std::vector<double> outErr(m_errSigmas.size());
for (size_t i = 0; i < m_errSigmas.size(); ++i)
outErr[i] = m_errSigmas[i] / maxval;
return new Datafield(m_frame->cloned_axes(), out, outErr);
}
double Datafield::maxVal() const
......
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