From b71da6238e327d59fddbb86a755fcba2461161ea Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Thu, 18 Jun 2026 18:54:31 +0200 Subject: [PATCH] Clean-up unused tools --- docs/TOOLS.md | 6 ---- tools/CMakeLists.txt | 7 ----- tools/jfjoch_azint_test.cpp | 45 ----------------------------- tools/jfjoch_pcie_read_register.cpp | 32 -------------------- 4 files changed, 90 deletions(-) delete mode 100644 tools/jfjoch_azint_test.cpp delete mode 100644 tools/jfjoch_pcie_read_register.cpp diff --git a/docs/TOOLS.md b/docs/TOOLS.md index cddd655e..8e6aecfa 100644 --- a/docs/TOOLS.md +++ b/docs/TOOLS.md @@ -49,9 +49,6 @@ Resets the card's Ethernet, UDP and ICMP packet counters (which otherwise run fr ./jfjoch_pcie_clear_net_counters /dev/jfjoch0 ``` -### jfjoch_pcie_read_register -Reads raw Jungfraujoch FPGA registers. - ## Testing, benchmarking and simulation ### jfjoch_udp_simulator @@ -68,9 +65,6 @@ writing. ### jfjoch_hdf5_test Tests single-threaded HDF5 writer performance. -### jfjoch_azint_test -Tests the azimuthal integration code on synthetic data. - ### jfjoch_simplon_test Minimal test client for a DECTRIS SIMPLON detector API. diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index d24e900c..c31e6f00 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -19,10 +19,6 @@ ADD_EXECUTABLE(jfjoch_pcie_clear_net_counters jfjoch_pcie_clear_net_counters.cpp TARGET_LINK_LIBRARIES(jfjoch_pcie_clear_net_counters JFJochDevice JFJochCommon) INSTALL(TARGETS jfjoch_pcie_clear_net_counters RUNTIME COMPONENT jfjoch ) -ADD_EXECUTABLE(jfjoch_pcie_read_register jfjoch_pcie_read_register.cpp) -TARGET_LINK_LIBRARIES(jfjoch_pcie_read_register JFJochDevice JFJochCommon) -INSTALL(TARGETS jfjoch_pcie_read_register RUNTIME COMPONENT jfjoch ) - ADD_EXECUTABLE(jfjoch_fpga_test jfjoch_fpga_test.cpp) TARGET_LINK_LIBRARIES(jfjoch_fpga_test JFJochReceiver) INSTALL(TARGETS jfjoch_fpga_test RUNTIME COMPONENT jfjoch) @@ -41,9 +37,6 @@ ADD_EXECUTABLE(jfjoch_extract_hkl jfjoch_extract_hkl.cpp TARGET_LINK_LIBRARIES(jfjoch_extract_hkl JFJochReader) INSTALL(TARGETS jfjoch_extract_hkl RUNTIME COMPONENT viewer) -ADD_EXECUTABLE(jfjoch_azint_test jfjoch_azint_test.cpp) -TARGET_LINK_LIBRARIES(jfjoch_azint_test JFJochImageAnalysis JFJochCommon) - ADD_EXECUTABLE(jfjoch_process jfjoch_process.cpp) TARGET_LINK_LIBRARIES(jfjoch_process JFJochReader JFJochImageAnalysis JFJochWriter JFJochReceiver) INSTALL(TARGETS jfjoch_process RUNTIME COMPONENT viewer) diff --git a/tools/jfjoch_azint_test.cpp b/tools/jfjoch_azint_test.cpp deleted file mode 100644 index 5b99e614..00000000 --- a/tools/jfjoch_azint_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include - -#include "../common/DiffractionExperiment.h" -#include "../common/AzimuthalIntegrationMapping.h" -#include "../common/AzimuthalIntegrationProfile.h" -#include "../common/AzimuthalIntegrationProfile.h" -#include "../common/Logger.h" -#include "../image_analysis/azint/AzIntEngineCPU.h" - -int main(int argc, char** argv) { - constexpr const uint32_t nimages = 1000; - - DiffractionExperiment experiment(DetEIGER(18, 3, 36, 8)); - - AzimuthalIntegrationSettings azim_settings; - azim_settings.QSpacing_recipA(0.01).QRange_recipA(0.005, 5.0).AzimuthalBinCount(64); - experiment.ImportAzimuthalIntegrationSettings(azim_settings).DetectorDistance_mm(100).BeamX_pxl(1500).BeamY_pxl(1500); - - PixelMask pixel_mask(experiment); - AzimuthalIntegrationMapping mapping(experiment, pixel_mask); - spdlog::info("Bins {}", mapping.GetBinNumber()); - - std::vector image(experiment.GetPixelsNum()); - - std::mt19937 rng(42); // seed - std::poisson_distribution poisson(20.0); // mean = 20 photons - - for (auto& pixel : image) - pixel = static_cast(poisson(rng)); - - spdlog::info("Generated image"); - - AzIntEngineCPU azint_engine(mapping); - AzimuthalIntegrationProfile profile(mapping); - - auto start_time = std::chrono::steady_clock::now(); - for (int i = 0; i < nimages; i++) - azint_engine.RunAzint(image, profile); - - auto end_time = std::chrono::steady_clock::now(); - auto duration = std::chrono::duration(end_time - start_time).count(); - spdlog::info("Time: {} ms", duration/nimages * 1000.0); -} \ No newline at end of file diff --git a/tools/jfjoch_pcie_read_register.cpp b/tools/jfjoch_pcie_read_register.cpp deleted file mode 100644 index 3c49e566..00000000 --- a/tools/jfjoch_pcie_read_register.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute -// SPDX-License-Identifier: GPL-3.0-only - -// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute -// SPDX-License-Identifier: GPL-3.0-only - -#include "../common/Logger.h" -#include "../common/JFJochException.h" -#include "../fpga/host_library/JungfraujochDevice.h" -#include "../common/NetworkAddressConvert.h" - - -int main(int argc, char **argv) { - Logger logger("jfjoch_pcie_read_register"); - - if (argc != 3) { - std::cout << "Usage: ./jfjoch_pcie_status " << std::endl; - exit(EXIT_FAILURE); - } - - logger.Info("Device {}", argv[1]); - - char *endptr; - uint32_t reg_number = std::strtol(argv[2], &endptr, 16); - if (*endptr != '\0') { - logger.Error("Invalid hexadecimal number: {} ", argv[2]); - exit(EXIT_FAILURE); - } - - JungfraujochDevice dev(argv[1], false); - logger.Info("Reg 0x{:x} = 0x{:x}", reg_number,dev.ReadRegister(reg_number)); -}