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

cleanup

parent 394ffc96
No related branches found
No related tags found
1 merge request!2416Add `angularFrame `and `qSpaceFrame` to Frame Python API
......@@ -274,9 +274,6 @@ Datafield* Datafield::crop(double xmin, double ymin, double xmax, double ymax) c
{
ASSERT(rank() == 2);
const Scale* xclipped = xAxis().clipped(xmin, xmax).clone();
const Scale* yclipped = yAxis().clipped(ymin, ymax).clone();
const size_t N = size();
std::vector<double> out;
for (size_t i = 0; i < N; ++i) {
......@@ -285,7 +282,11 @@ Datafield* Datafield::crop(double xmin, double ymin, double xmax, double ymax) c
if (xmin <= x && x <= xmax && ymin <= y && y <= ymax)
out.push_back(m_values[i]);
}
const Scale* xclipped = xAxis().clipped(xmin, xmax).clone();
const Scale* yclipped = yAxis().clipped(ymin, ymax).clone();
Frame* outframe = new Frame(xclipped, yclipped);
ASSERT(outframe->size() == out.size());
return new Datafield(outframe, out);
}
......@@ -294,8 +295,6 @@ Datafield* Datafield::crop(double xmin, double xmax) const
{
ASSERT(rank() == 1);
const Scale* xclipped = xAxis().clipped(xmin, xmax).clone();
const size_t N = size();
std::vector<double> out;
std::vector<double> errout;
......@@ -307,7 +306,9 @@ Datafield* Datafield::crop(double xmin, double xmax) const
errout.push_back(m_err_sigmas[i]);
}
}
const Scale* xclipped = xAxis().clipped(xmin, xmax).clone();
Frame* outframe = new Frame(xclipped);
ASSERT(outframe->xAxis().size() == out.size());
return new Datafield(outframe, out, errout);
}
......
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