Build Packages / Unit tests (push) Successful in 1h31m59s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 8m43s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m5s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m27s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m56s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m24s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 10m27s
Build Packages / build:rpm (rocky8) (push) Successful in 9m20s
Build Packages / build:rpm (rocky9) (push) Successful in 10m50s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m54s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m38s
Build Packages / DIALS test (push) Successful in 12m13s
Build Packages / XDS test (durin plugin) (push) Successful in 7m8s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 7m8s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m50s
Build Packages / Generate python client (push) Successful in 16s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Skipped
This is an UNSTABLE release. It includes many experimental features, as well as many AI generated fixes. We recommend using rc.152 for production use. * jfjoch_broker: Add EXPERIMENTAL pixelrefine mode for image processing * jfjoch_broker: Allow to load user mask from 8-bit and 16-bit TIFF files * jfjoch_broker: Add ROI calculation in non-FPGA workflow * jfjoch_broker: Fixes to TCP image pusher * jfjoch_broker: Remove NUMA bindings * jfjoch_broker: Improvements to indexing * jfjoch_broker: For PSI EIGER, trimming energies are taken from the detector configuration (now compulsory) instead of hardcoded values * jfjoch_writer: Save ROI definitions and the per-pixel ROI bitmap in the master file; azimuthal ROIs support phi (angular) sectors * jfjoch_viewer: Major redesign with dockable panels and saved layouts, plus on-canvas creation/move/resize of box, circle and azimuthal ROIs * jfjoch_viewer: Run jfjoch_process reprocessing jobs from inside the GUI and overlay per-run results Reviewed-on: #63
120 lines
4.3 KiB
C++
120 lines
4.3 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <condition_variable>
|
|
#include <atomic>
|
|
#include <future>
|
|
#include <latch>
|
|
|
|
#include "JFJochReceiver.h"
|
|
|
|
#include "../acquisition_device/AcquisitionDeviceGroup.h"
|
|
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "../common/JFJochException.h"
|
|
#include "FrameTransformation.h"
|
|
#include "../image_pusher/ImagePusher.h"
|
|
#include "../common/Logger.h"
|
|
#include "../common/ThreadSafeFIFO.h"
|
|
#include "../common/ImageBuffer.h"
|
|
#include "../common/PixelMask.h"
|
|
|
|
#include "../image_analysis/spot_finding/StrongPixelSet.h"
|
|
#include "../common/AzimuthalIntegrationMapping.h"
|
|
#include "../common/AzimuthalIntegrationProfile.h"
|
|
|
|
#include "../jungfrau/JFCalibration.h"
|
|
#include "../common/ADUHistogram.h"
|
|
#include "../common/Plot.h"
|
|
#include "../common/JFJochReceiverPlots.h"
|
|
#include "../preview/PreviewImage.h"
|
|
#include "LossyFilter.h"
|
|
#include "JFJochReceiverCurrentStatus.h"
|
|
#include "../jungfrau/JFPedestalCalc.h"
|
|
#include "../preview/ZMQPreviewSocket.h"
|
|
#include "../preview/ZMQMetadataSocket.h"
|
|
#include "ImageMetadata.h"
|
|
#include "../common/ModuleSummation.h"
|
|
#include "../image_analysis/MXAnalysisAfterFPGA.h"
|
|
#include "../common/MovingAverage.h"
|
|
#include "JFJochReceiverOutput.h"
|
|
|
|
class JFJochReceiverFPGA : public JFJochReceiver {
|
|
const JFCalibration *calibration;
|
|
|
|
std::vector<std::unique_ptr<JFPedestalCalc>> pedestal;
|
|
|
|
std::vector<uint16_t> roi_map;
|
|
|
|
std::vector<std::future<void>> frame_transformation_futures;
|
|
std::vector<std::future<void>> data_acquisition_futures;
|
|
|
|
std::future<void> measurement;
|
|
|
|
ThreadSafeFIFO<int64_t> images_to_go;
|
|
|
|
AcquisitionDeviceGroup &acquisition_device;
|
|
uint16_t ndatastreams{0};
|
|
|
|
const int64_t frame_transformation_nthreads;
|
|
const int64_t pedestal_nthreads;
|
|
const int64_t summation_nthreads;
|
|
|
|
int64_t expected_packets_per_image;
|
|
bool only_2nd_sc_pedestal = false; // special mode used for pedestal G1/G2 with storage cells
|
|
|
|
std::latch frame_transformation_ready;
|
|
std::latch data_acquisition_ready;
|
|
|
|
void AcquireThread(uint16_t data_stream);
|
|
void LoadCalibrationToFPGA(uint16_t data_stream);
|
|
|
|
void FrameTransformationThread(uint32_t threadid);
|
|
void MeasurePedestalThread(uint16_t data_stream,
|
|
uint16_t module_number,
|
|
uint16_t storage_cell,
|
|
uint32_t threadid,
|
|
bool ignore);
|
|
|
|
int64_t SummationThread(uint16_t data_stream,
|
|
int64_t image_number,
|
|
uint16_t module_number,
|
|
uint32_t threadid,
|
|
ModuleSummation &summation);
|
|
void Cancel(const JFJochException &e) override;
|
|
void FinalizeMeasurement();
|
|
|
|
void SendCalibration();
|
|
void SendPedestal(const std::string &prefix, const std::vector<uint8_t> &v, int gain, int sc);
|
|
void RetrievePedestal(std::vector<JFModulePedestal> &output) const;
|
|
public:
|
|
JFJochReceiverFPGA(const DiffractionExperiment& experiment,
|
|
const PixelMask &pixel_mask,
|
|
const JFCalibration *calibration,
|
|
AcquisitionDeviceGroup &acquisition_devices,
|
|
ImagePusher &image_pusher,
|
|
Logger &logger, int64_t forward_and_sum_nthreads,
|
|
const SpotFindingSettings &spot_finding_settings,
|
|
JFJochReceiverCurrentStatus ¤t_status,
|
|
JFJochReceiverPlots &plots,
|
|
ImageBuffer &image_buffer,
|
|
ZMQPreviewSocket *zmq_preview_socket,
|
|
ZMQMetadataSocket *zmq_metadata_socket,
|
|
IndexerThreadPool *indexing_thread_pool);
|
|
~JFJochReceiverFPGA();
|
|
JFJochReceiverFPGA(const JFJochReceiverFPGA &other) = delete;
|
|
JFJochReceiverFPGA& operator=(const JFJochReceiverFPGA &other) = delete;
|
|
|
|
void StopReceiver() override;
|
|
|
|
float GetEfficiency() const override;
|
|
void Cancel(bool silent) override;
|
|
float GetProgress() const override;
|
|
|
|
void SetSpotFindingSettings(const SpotFindingSettings &spot_finding_settings) override;
|
|
|
|
JFJochReceiverOutput GetFinalStatistics() const override;
|
|
};
|