v1.0.0-rc.31

This commit is contained in:
2025-03-02 13:15:28 +01:00
parent aeabc81a4c
commit ddf4c75645
309 changed files with 8705 additions and 1421 deletions

View File

@@ -26,7 +26,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index", "[JFJochReceiver]
DiffractionExperiment experiment(DetectorGeometry(8,2,8,36));
experiment.ImagesPerTrigger(5).NumTriggers(1).UseInternalPacketGenerator(true).ImagesPerFile(2)
.FilePrefix("lyso_test").JungfrauConvPhotonCnt(false)
.FilePrefix("lyso_test").JungfrauConvPhotonCnt(false).HDF5MasterFormatVersion(2).OverwriteExistingFiles(true)
.DetectorDistance_mm(75).BeamY_pxl(1136).BeamX_pxl(1090).IncidentEnergy_keV(12.4)
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90});
PixelMask pixel_mask(experiment);
@@ -110,10 +110,11 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index_min_pix_2", "[JFJoc
const uint16_t nthreads = 4;
DiffractionExperiment experiment(DetectorGeometry(8,2,8,36));
experiment.ImagesPerTrigger(5).NumTriggers(1).UseInternalPacketGenerator(true)
.FilePrefix("lyso_test_min_pix_2").JungfrauConvPhotonCnt(false)
experiment.ImagesPerTrigger(5).NumTriggers(1).UseInternalPacketGenerator(true).OverwriteExistingFiles(true)
.FilePrefix("lyso_test_min_pix_2").JungfrauConvPhotonCnt(false).HDF5MasterFormatVersion(2)
.DetectorDistance_mm(75).BeamY_pxl(1136).BeamX_pxl(1090).IncidentEnergy_keV(12.4)
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90});
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90})
.PixelSigned(true);
PixelMask pixel_mask(experiment);
// Load example image
@@ -185,7 +186,7 @@ TEST_CASE("GenerateResolutionMap") {
std::vector<float> spot_finder_resolution_map(experiment.GetModulesNum() * RAW_MODULE_SIZE, 1.0);
for (int m = 0; m < experiment.GetModulesNum(); m++)
CalcSpotFinderResolutionMap(spot_finder_resolution_map.data() + m * RAW_MODULE_SIZE, experiment, m);
experiment.CalcSpotFinderResolutionMap(spot_finder_resolution_map.data() + m * RAW_MODULE_SIZE, m);
std::vector<uint32_t> spot_finder_resolution_map_int(spot_finder_resolution_map.size());
for (int i = 0; i < spot_finder_resolution_map.size(); i++)
@@ -209,12 +210,13 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_ROI", "[JFJochReceiver]") {
experiment.ImagesPerTrigger(5).NumTriggers(1).UseInternalPacketGenerator(true)
.FilePrefix("lyso_test_roi").JungfrauConvPhotonCnt(false)
.DetectorDistance_mm(75).BeamY_pxl(1136).BeamX_pxl(1090).IncidentEnergy_keV(12.4)
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90});
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90})
.HDF5MasterFormatVersion(2).PixelSigned(true).OverwriteExistingFiles(true);
PixelMask pixel_mask(experiment);
experiment.ROI().SetROI(ROIDefinition{
.boxes = {ROIBox("roi0", 100, 120, 20, 30)},
.boxes = {ROIBox("beam", 100, 120, 20, 30)},
.circles = {ROICircle("roi1", 500, 800, 10)}
});
// Load example image
@@ -242,10 +244,21 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_ROI", "[JFJochReceiver]") {
}
}
std::vector<int16_t> image_raw_geom(experiment.GetModulesNum() * RAW_MODULE_SIZE);
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
logger.Info("Loaded image");
uint64_t sat_pixels = 0;
uint64_t err_pixels = 0;
for (const auto &i: image_raw_geom) {
if (i == INT16_MAX)
sat_pixels++;
else if (i == INT16_MIN)
err_pixels++;
}
// Setup acquisition device
AcquisitionDeviceGroup aq_devices;
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
@@ -278,12 +291,19 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_ROI", "[JFJochReceiver]") {
auto plot = service.GetDataProcessingPlot(PlotRequest{.type = PlotType::ROISum, .binning = 1});
REQUIRE(plot.size() == 2);
CHECK(plot[0].title == "roi0");
CHECK(plot[0].title == "beam");
REQUIRE(!plot[0].x.empty());
CHECK(plot[0].x[0] == 0);
CHECK(plot[0].y[0] == roi_value);
CHECK(plot[1].title == "roi1");
CHECK(receiver_out.status.roi_beam_sum == roi_value);
CHECK(receiver_out.status.roi_beam_npixel == pixels);
REQUIRE(receiver_out.status.error_pixels.has_value());
REQUIRE(receiver_out.status.saturated_pixels.has_value());
CHECK(receiver_out.status.error_pixels.value() == err_pixels);
CHECK(receiver_out.status.saturated_pixels.value() == sat_pixels);
CHECK(receiver_out.efficiency == 1.0);
CHECK(receiver_out.status.images_sent == experiment.GetImageNum());
CHECK(!receiver_out.status.cancelled);