RawToConvertedGeometry: Add function to calculate location of a raw pixel in converted geometry

This commit is contained in:
2023-10-20 13:27:21 +02:00
parent ad78fb0149
commit a338a1743b
2 changed files with 25 additions and 1 deletions
+7
View File
@@ -473,3 +473,10 @@ TEST_CASE("RawToConvertedGeometry_Gaps","[RawToConvertedGeometry]") {
free(output);
free(input2);
}
TEST_CASE("RawToConvertedCoordinate","[RawToConvertedGeometry]") {
DiffractionExperiment experiment(DetectorGeometry(4, 2, 8, 36, true));
auto [x,y] = RawToConvertedCoordinate(experiment, 1, 300 * RAW_MODULE_COLS + 800);
REQUIRE(x == CONVERTED_MODULE_COLS + 8 + 806); // col 800 becomes 806 due to 3 chip boundaries
REQUIRE(y == CONVERTED_MODULE_LINES * 2 + 36 - 1 - 302); // line 300 becomes 302 due to 1 chip boundary
}