v1.0.0-rc.104 (#9)
All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 9m17s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m9s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 7m29s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 8m52s
Build Packages / Generate python client (push) Successful in 25s
Build Packages / Build documentation (push) Successful in 49s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 8m47s
Build Packages / build:rpm (rocky8) (push) Successful in 8m49s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m4s
Build Packages / build:rpm (rocky9) (push) Successful in 8m52s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m11s
Build Packages / Unit tests (push) Successful in 1h14m42s

This is an UNSTABLE release.

jfjoch_writer: Fix and improve the way grid scan geometry is saved (non-NXmx extension makes it way easier)
jfjoch_viewer: Display grid scan results in 2D (work in progress)
jfjoch_viewer: Improve auto-scaling on start of images (work in progress)
jfjoch_viewer: Add B-factor and resolution estimate to the dataset info plots

Reviewed-on: #9
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #9.
This commit is contained in:
2025-11-19 17:28:10 +01:00
committed by leonarski_f
parent 33aeb64e4c
commit 95acf3aba3
181 changed files with 731 additions and 215 deletions

View File

@@ -420,3 +420,116 @@ TEST_CASE("GridScanSettings::Rearrange functionality tests", "[gridscan][rearran
}
}
}
TEST_CASE("GridScanSettings GetXContainer_m", "[GridScanSettings][container]") {
// Standard horizontal scan, step +2um X, +3um Y, 4 fast, 3 slow (12 total)
GridScanSettings grid_horiz(4, 2.0f, 3.0f, false, false);
grid_horiz.ImageNum(12); // 3 rows of 4
auto x_m = grid_horiz.GetXContainer_m(12);
REQUIRE(x_m.size() == 12);
// 0..3 should be X=0,2,4,6 um, Y=0
REQUIRE(x_m[0] == Catch::Approx(0.0));
REQUIRE(x_m[1] == Catch::Approx(2.0e-6));
REQUIRE(x_m[2] == Catch::Approx(4.0e-6));
REQUIRE(x_m[3] == Catch::Approx(6.0e-6));
// 4..7 should be X=0,2,4,6 um, Y=3 um
REQUIRE(x_m[4] == Catch::Approx(0.0));
REQUIRE(x_m[7] == Catch::Approx(6.0e-6));
// Last row
REQUIRE(x_m[8] == Catch::Approx(0.0));
REQUIRE(x_m[11] == Catch::Approx(6.0e-6));
// Snake raster test (horizontal, 3x2, fast +1um, slow +10um)
GridScanSettings grid_snake(3, 1.0f, 10.0f, true, false);
grid_snake.ImageNum(6); // 2 rows of 3
auto x_snake = grid_snake.GetXContainer_m(6);
// 0,1,2: left-to-right, 3,4,5: right-to-left
REQUIRE(x_snake[0] == Catch::Approx(0.0e-6));
REQUIRE(x_snake[1] == Catch::Approx(1.0e-6));
REQUIRE(x_snake[2] == Catch::Approx(2.0e-6));
REQUIRE(x_snake[3] == Catch::Approx(2.0e-6));
REQUIRE(x_snake[4] == Catch::Approx(1.0e-6));
REQUIRE(x_snake[5] == Catch::Approx(0.0e-6));
// Vertical scan, step X = 20um, fast Y = 5um, 2 fast, 3 slow (6 total)
GridScanSettings grid_vert(3, 20.0f, 5.0f, false, true);
grid_vert.ImageNum(6); // 2 columns, 3 rows (vertical fast)
auto x_vert = grid_vert.GetXContainer_m(6);
// First col: X=0, Y=0,5,10
REQUIRE(x_vert[0] == Catch::Approx(0.0));
REQUIRE(x_vert[1] == Catch::Approx(0.0));
REQUIRE(x_vert[2] == Catch::Approx(0.0));
// Second col: X=20um, Y=0,5,10
REQUIRE(x_vert[3] == Catch::Approx(20.0e-6));
REQUIRE(x_vert[5] == Catch::Approx(20.0e-6));
// Negative steps test
GridScanSettings grid_neg(3, -2.0f, -7.5f, false, false);
grid_neg.ImageNum(6); // 2 rows of 3
auto x_neg = grid_neg.GetXContainer_m(6);
REQUIRE(x_neg[0] == Catch::Approx(4.0e-6)); // 2*(3-1)
REQUIRE(x_neg[1] == Catch::Approx(2.0e-6));
REQUIRE(x_neg[2] == Catch::Approx(0.0));
}
TEST_CASE("GridScanSettings GetYContainer_m", "[GridScanSettings][container]") {
// Standard horizontal scan, step +2um X, +3um Y, 4 fast, 3 slow (12 total)
GridScanSettings grid_horiz(4, 2.0f, 3.0f, false, false);
grid_horiz.ImageNum(12); // 3 rows of 4
auto y_m = grid_horiz.GetYContainer_m(12);
REQUIRE(y_m.size() == 12);
for (int i = 0; i < 4; ++i)
REQUIRE(y_m[i] == Catch::Approx(0.0));
// 4..7 should be X=0,2,4,6 um, Y=3 um
REQUIRE(y_m[4] == Catch::Approx(3.0e-6));
REQUIRE(y_m[7] == Catch::Approx(3.0e-6));
// Last row
REQUIRE(y_m[8] == Catch::Approx(6.0e-6));
REQUIRE(y_m[11] == Catch::Approx(6.0e-6));
// Snake raster test (horizontal, 3x2, fast +1um, slow +10um)
GridScanSettings grid_snake(3, 1.0f, 10.0f, true, false);
grid_snake.ImageNum(6); // 2 rows of
auto y_snake = grid_snake.GetYContainer_m(6);
// 0,1,2: left-to-right, 3,4,5: right-to-left
// Both rows Y
for (int i = 0; i < 3; ++i)
REQUIRE(y_snake[i] == Catch::Approx(0.0));
for (int i = 3; i < 6; ++i)
REQUIRE(y_snake[i] == Catch::Approx(10.0e-6));
// Vertical scan, step X = 20um, fast Y = 5um, 2 fast, 3 slow (6 total)
GridScanSettings grid_vert(3, 20.0f, 5.0f, false, true);
grid_vert.ImageNum(6); // 2 columns, 3 rows (vertical fast)
auto y_vert = grid_vert.GetYContainer_m(6);
// First col: X=0, Y=0,5,10
REQUIRE(y_vert[0] == Catch::Approx(0.0));
REQUIRE(y_vert[1] == Catch::Approx(5.0e-6));
REQUIRE(y_vert[2] == Catch::Approx(10.0e-6));
// Second col: X=20um, Y=0,5,10
REQUIRE(y_vert[3] == Catch::Approx(0.0));
REQUIRE(y_vert[5] == Catch::Approx(10.0e-6));
// Negative steps test
GridScanSettings grid_neg(3, -2.0f, -7.5f, false, false);
grid_neg.ImageNum(6); // 2 rows of 3
auto y_neg = grid_neg.GetYContainer_m(6);
REQUIRE(y_neg[0] == Catch::Approx(7.5e-6));
REQUIRE(y_neg[1] == Catch::Approx(7.5e-6));
REQUIRE(y_neg[2] == Catch::Approx(7.5e-6));
REQUIRE(y_neg[3] == Catch::Approx(0.0));
REQUIRE(y_neg[4] == Catch::Approx(0.0));
REQUIRE(y_neg[5] == Catch::Approx(0.0));
}