Modifications in preparation to MAX IV experiment

This commit is contained in:
2024-01-27 21:23:56 +01:00
parent 2446643489
commit f5f86d9ab6
250 changed files with 9363 additions and 3022 deletions
+21
View File
@@ -0,0 +1,21 @@
// Copyright (2019-2023) Paul Scherrer Institute
#include <catch2/catch.hpp>
#include "../common/DiffractionSpot.h"
TEST_CASE("DiffractionSpot_ConvertToImageCoordinates", "[LinearAlgebra][Coord]") {
DiffractionExperiment experiment(DetectorGeometry(4, 2, 8, 36, true));
DiffractionSpot spot_1(800, 300, 12);
spot_1 += DiffractionSpot(800, 301, 4);
spot_1 += DiffractionSpot(801, 300, 12);
spot_1 += DiffractionSpot(801, 301, 4);
REQUIRE(spot_1.RawCoord().x == 800.5);
REQUIRE(spot_1.RawCoord().y == 300.25);
REQUIRE(spot_1.Count() == 12 * 2 + 4 * 2);
spot_1.ConvertToImageCoordinates(experiment, 1);
REQUIRE(spot_1.RawCoord().x == Approx(CONVERTED_MODULE_COLS + 8 + 800.5 + 6));
REQUIRE(spot_1.RawCoord().y == Approx(CONVERTED_MODULE_LINES * 2 + 36 - 1 - 300.25 - 2));
REQUIRE(spot_1.Count() == 12 * 2 + 4 * 2);
}