Fixes after MAX IV experiment

This commit is contained in:
2024-02-05 17:18:16 +01:00
parent 91a0960303
commit babb1a5c8d
151 changed files with 4395 additions and 1477 deletions

View File

@@ -5,28 +5,39 @@
int main() {
Logger logger("SpotFindingPerformanceTest");
DeviceOutput dev_output;
size_t nstrong_pixel = 2048;
dev_output.spot_finding_result.strong_pixel_count = nstrong_pixel;
for (auto &i: dev_output.spot_finding_result.strong_pixel)
i = 0;
std::vector<uint8_t> strong_pixel(RAW_MODULE_SIZE, 0);
std::mt19937 g1(67678);
std::uniform_int_distribution<size_t> distribution(0, RAW_MODULE_SIZE - 1);
// Can think of smarter way to select pixels
int pixels_set = 0;
while (pixels_set < nstrong_pixel) {
size_t pixel = distribution(g1);
size_t location = pixel / 8;
size_t bit = (1 << (pixel % 8));
if ((dev_output.spot_finding_result.strong_pixel[location] & bit) == 0) {
dev_output.spot_finding_result.strong_pixel[location] |= (1LU << bit);
if (strong_pixel[pixel] == 0) {
strong_pixel[pixel] = 1;
pixels_set++;
}
}
DeviceOutput dev_output;
dev_output.spot_finding_result.strong_pixel_count = nstrong_pixel;
dev_output.spot_finding_result.max_memory_index = nstrong_pixel/32;
for (auto &i: dev_output.spot_finding_result.strong_pixel_number)
i = UINT32_MAX;
size_t curr_id = 0;
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
if (strong_pixel[i]) {
dev_output.spot_finding_result.strong_pixel_number[curr_id] = i;
curr_id++;
}
}
DiffractionExperiment experiment(DetectorGeometry(18, 3, 8, 36));
experiment.DetectorDistance_mm(50.0).BeamX_pxl(1200).BeamY_pxl(1200);
@@ -37,18 +48,18 @@ int main() {
.low_resolution_limit = 100.0
};
int iterations = 100;
int iterations = 2000;
{
int tmp = 0;
auto start_time = std::chrono::system_clock::now();
for (int i = 0; i < iterations; i++) {
std::vector<DiffractionSpot> spots, spots_out;
for (int m = 0; m < experiment.GetModulesNum(); m++) {
StrongPixelSet strong_pixel_set(experiment);
StrongPixelSet strong_pixel_set;
strong_pixel_set.ReadFPGAOutput(dev_output);
strong_pixel_set.FindSpots(experiment, settings, spots, m);
}
FilterSpotsByResolution(experiment, spots, spots_out);
FilterSpotsByCount(experiment, spots, spots_out);
tmp += spots_out.size();
}
auto end_time = std::chrono::system_clock::now();