v.1.0.0-rc.32
This commit is contained in:
@@ -1674,6 +1674,56 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_mask", "[FPGA]
|
||||
CHECK (spot_finder_output_contains(spot_finder_result, 320*1024 + 400));
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_overload", "[FPGA][Full]") {
|
||||
Logger logger(Catch::getResultCapture().getCurrentTestName());
|
||||
|
||||
const uint16_t nmodules = 4;
|
||||
|
||||
DiffractionExperiment x((DetectorGeometry(nmodules)));
|
||||
|
||||
x.Mode(DetectorMode::Raw);
|
||||
x.UseInternalPacketGenerator(true).ImagesPerTrigger(1).PedestalG0Frames(0).PixelSigned(true);
|
||||
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
|
||||
std::vector<int16_t> frame(RAW_MODULE_SIZE, 0);
|
||||
frame [ 132*1024 + 133] = INT16_MAX;
|
||||
frame [ 0*1024 + 500] = INT16_MIN;
|
||||
frame [ 255*1024 + 234] = INT16_MAX;
|
||||
frame [ 300*1024 + 234] = INT16_MAX;
|
||||
|
||||
std::vector<float> d_map(RAW_MODULE_SIZE, 3.0);
|
||||
d_map[ 132*1024 + 133] = 0.0;
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
test.SetInternalGeneratorFrame((uint16_t *) frame.data(), m);
|
||||
test.InitializeSpotFinderResolutionMap(d_map.data(), m);
|
||||
}
|
||||
|
||||
SpotFindingSettings parameters{
|
||||
.signal_to_noise_threshold = 5.0,
|
||||
.photon_count_threshold = 45,
|
||||
.min_pix_per_spot = 1,
|
||||
.high_resolution_limit = 2.0,
|
||||
.low_resolution_limit = 4.0
|
||||
};
|
||||
test.SetSpotFinderParameters(parameters);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
REQUIRE(memcmp(imageBuf, frame.data(), RAW_MODULE_SIZE * sizeof(uint16_t)) == 0);
|
||||
|
||||
auto spot_finder_result = test.GetDeviceOutput(0, 0)->spot_finding_result;
|
||||
REQUIRE (spot_finder_result.strong_pixel_count == 1);
|
||||
REQUIRE (spot_finder_result.snr_threshold == 5.0);
|
||||
REQUIRE (spot_finder_result.count_threshold == 45);
|
||||
|
||||
CHECK (spot_finder_output_contains(spot_finder_result, 300*1024 + 234));
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_min_pix_per_spot", "[FPGA][Full]") {
|
||||
Logger logger(Catch::getResultCapture().getCurrentTestName());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user