Improve plotting
This commit is contained in:
@@ -79,13 +79,14 @@ TEST_CASE("AzimuthalIntegrationProfile","[AzimuthalIntegration]") {
|
||||
std::vector<float> sum_wr(mapping.GetBinNumber() - 1);
|
||||
REQUIRE_THROWS(profile.Add(sum_wr, count));
|
||||
|
||||
Plot plot = profile.GetPlot();
|
||||
auto plot = profile.GetPlot();
|
||||
REQUIRE(plot.size() == 1);
|
||||
|
||||
REQUIRE(plot.x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.y.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot[0].x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot[0].y.size() == mapping.GetBinNumber());
|
||||
for (int i = 0; i < mapping.GetBinNumber(); i++) {
|
||||
REQUIRE(plot.x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot.y[i] == Approx(i * 4));
|
||||
REQUIRE(plot[0].x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot[0].y[i] == Approx(i * 4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,11 +111,12 @@ TEST_CASE("AzimuthalIntegrationProfile_operatorAdd","[AzimuthalIntegration]") {
|
||||
|
||||
auto plot = profile1.GetPlot();
|
||||
|
||||
REQUIRE(plot.x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.y.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.size() == 1);
|
||||
REQUIRE(plot[0].x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot[0].y.size() == mapping.GetBinNumber());
|
||||
for (int i = 0; i < mapping.GetBinNumber(); i++) {
|
||||
REQUIRE(plot.x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot.y[i] == Approx(i * 4));
|
||||
REQUIRE(plot[0].x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot[0].y[i] == Approx(i * 4));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user