90e804acd7
Build Packages / Unit tests (push) Successful in 42m49s
Build Packages / DIALS test (push) Successful in 29m45s
Build Packages / XDS test (durin plugin) (push) Successful in 19m27s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 18m52s
Build Packages / XDS test (neggia plugin) (push) Successful in 13m0s
Build Packages / Generate python client (push) Successful in 28s
Build Packages / Build documentation (push) Successful in 1m25s
Build Packages / Create release (push) Skipped
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 10m53s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 12m49s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 13m7s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 13m9s
Build Packages / build:rpm (rocky8) (push) Successful in 13m24s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 14m11s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 14m15s
Build Packages / build:rpm (rocky9) (push) Successful in 14m30s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m14s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m5s
* jfjoch_broker: When in FPGA workflow (with PSI detectors) azimuthal integration might be forced to CPU - this will require more computational power, but it enables more integration bins and reports standard deviation of each bin. * jfjoch_broker: Raise error if one is in FPGA flow and there are too many azimuthal integration bins. Reviewed-on: #60
55 lines
2.1 KiB
C++
55 lines
2.1 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "bragg_prediction/BraggPrediction.h"
|
|
#include "indexing/IndexerThreadPool.h"
|
|
#include "spot_finding/StrongPixelSet.h"
|
|
#include "azint/AzIntEngineCPU.h"
|
|
#include "IndexAndRefine.h"
|
|
|
|
class MXAnalysisAfterFPGA {
|
|
mutable std::mutex read_from_cpu_mutex;
|
|
const DiffractionExperiment &experiment;
|
|
const AzimuthalIntegrationMapping &integration;
|
|
IndexAndRefine &indexer;
|
|
std::unique_ptr<BraggPrediction> prediction;
|
|
std::unique_ptr<AzIntEngineCPU> cpu_azint;
|
|
|
|
bool find_spots = false;
|
|
std::vector<DiffractionSpot> spots;
|
|
constexpr static const float spot_distance_threshold_pxl = 2.0f;
|
|
|
|
std::vector<float> arr_mean;
|
|
std::vector<float> arr_sttdev;
|
|
std::vector<uint32_t> arr_valid_count;
|
|
std::vector<uint32_t> arr_strong_pixel;
|
|
|
|
enum class State {Idle, Disabled, Enabled} state = State::Idle;
|
|
|
|
std::chrono::duration<double, std::micro> spot_finding_time_total{0.0};
|
|
bool spot_finding_timing_active = false;
|
|
public:
|
|
|
|
MXAnalysisAfterFPGA(const DiffractionExperiment& experiment,
|
|
const AzimuthalIntegrationMapping &integration,
|
|
IndexAndRefine &indexer);
|
|
|
|
void ReadFromFPGA(const DeviceOutput* output,
|
|
const SpotFindingSettings& settings,
|
|
size_t module_number);
|
|
|
|
void ReadFromCPU(DeviceOutput *output,
|
|
const SpotFindingSettings &settings,
|
|
size_t module_number);
|
|
|
|
// Computes the azimuthal integration profile on the CPU from the assembled image.
|
|
// Only active when the settings force the CPU backend; otherwise a no-op (the FPGA
|
|
// fills the profile). image points to the uncompressed image of GetByteDepthImage() pixels.
|
|
void RunAzimuthalIntegration(const void *image, AzimuthalIntegrationProfile &profile);
|
|
|
|
void Process(DataMessage &message, const SpotFindingSettings& settings);
|
|
};
|