v1.0.0-rc.34

This commit is contained in:
2025-04-14 11:52:06 +02:00
parent 708b5fbc4b
commit b0607ab3ca
238 changed files with 4590 additions and 1329 deletions
+10 -28
View File
@@ -1012,39 +1012,21 @@ TEST_CASE("DiffractionExperiment_AutoSummation", "[DiffractionExperiment]") {
TEST_CASE("DiffractionExperiment_ExportROIMask", "[DiffractionExperiment]") {
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36, true));
x.Mode(DetectorMode::Conversion);
x.Mode(DetectorMode::Raw);
x.ROI().SetROIBox({
x.ROI().SetROI(ROIDefinition{.boxes = {
ROIBox("roi0", 800 , 800, 0, 4),
ROIBox("roi1", 0 , 1, 2162, 2163)
});
}});
CHECK(x.ROI().GetROIMap()[800] == 0);
CHECK(x.ROI().GetROIMap()[801] == UINT16_MAX);
CHECK(x.ROI().GetROIMap()[2162 * x.GetXPixelsNum() + 1] == 1);
int64_t xpixel = 2068;
int64_t ypixel = 2164;
auto map = x.ExportROIMap();
REQUIRE(map.size() == xpixel * ypixel);
std::vector<uint16_t> tmp(RAW_MODULE_SIZE, 899);
x.ExportROIMap(tmp.data(), 0);
CHECK(tmp[0] == 1);
CHECK(tmp[1] == 1);
CHECK(tmp[2] == UINT16_MAX);
CHECK(tmp[RAW_MODULE_SIZE-1] == UINT16_MAX);
x.ExportROIMap(tmp.data(), 6);
CHECK(tmp[0] == UINT16_MAX);
CHECK(tmp[511 * RAW_MODULE_COLS + 800-6] == 0);
CHECK(tmp[509 * RAW_MODULE_COLS + 800-6] == 0);
CHECK(tmp[507 * RAW_MODULE_COLS + 800-6] == 0);
CHECK(tmp[506 * RAW_MODULE_COLS + 800-6] == UINT16_MAX);
x.ExportROIMap(tmp.data(), 3);
size_t diff = 0;
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
if (tmp[i] != UINT16_MAX)
diff++;
}
CHECK(diff == 0);
CHECK(map[800] == 1);
CHECK(map[801] == 0);
CHECK(map[2162 * xpixel + 1] == 2);
}
TEST_CASE("DiffractionExperiment_PedestalRun","[DiffractionExperiment]") {