6e0bb971ac
Build Packages / Unit tests (push) Successful in 1h13m11s
Build Packages / Generate python client (push) Successful in 33s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 14m1s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 15m12s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 14m34s
Build Packages / build:rpm (rocky8) (push) Successful in 15m43s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 16m35s
Build Packages / build:rpm (rocky9) (push) Successful in 16m19s
Build Packages / XDS test (durin plugin) (push) Successful in 12m11s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 14m1s
Build Packages / DIALS test (push) Successful in 16m59s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 13m32s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 15m12s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 11m33s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 10m25s
Build Packages / Build documentation (push) Successful in 58s
Build Packages / XDS test (neggia plugin) (push) Successful in 10m33s
This is an UNSTABLE release. The release has significant modifications and bug fixes, if things go wrong, it is better to revert to 1.0.0-rc.132. jfjoch_broker: Avoid copying gain calibration together with DiffractionExperiment Reviewed-on: #53
58 lines
2.0 KiB
C++
58 lines
2.0 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JUNGFRAUJOCH_JFMODULEGAINCALIBRATION_H
|
|
#define JUNGFRAUJOCH_JFMODULEGAINCALIBRATION_H
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <array>
|
|
|
|
#include "../common/Definitions.h"
|
|
|
|
class JFModuleGainCalibration {
|
|
constexpr const static size_t offset_g0 = 0;
|
|
constexpr const static size_t offset_g1 = RAW_MODULE_SIZE;
|
|
constexpr const static size_t offset_g2 = 2 * RAW_MODULE_SIZE;
|
|
constexpr const static size_t offset_hg0 = 3 * RAW_MODULE_SIZE;
|
|
std::vector<double> gain;
|
|
double GetMean(size_t offset) const;
|
|
double GetStdDev(size_t offset) const;
|
|
public:
|
|
constexpr const static float fixed_g1_gain_coeff = 1.0 / 1.65;
|
|
JFModuleGainCalibration();
|
|
explicit JFModuleGainCalibration(const std::string &filename);
|
|
explicit JFModuleGainCalibration(const std::vector<double> &vec);
|
|
[[nodiscard]] const std::vector<double> &GetGainCalibration() const;
|
|
void ExportG0(DeviceOutput *output) const;
|
|
void ExportG1(DeviceOutput *output) const;
|
|
void ExportFixedG1(DeviceOutput *output) const;
|
|
void ExportG2(DeviceOutput *output) const;
|
|
void ExportHG0(DeviceOutput *output) const;
|
|
|
|
double GetG0Mean() const;
|
|
double GetG1Mean() const;
|
|
double GetG2Mean() const;
|
|
double GetHG0Mean() const;
|
|
|
|
double GetG0StdDev() const;
|
|
double GetG1StdDev() const;
|
|
double GetG2StdDev() const;
|
|
double GetHG0StdDev() const;
|
|
};
|
|
|
|
// Only to use in automated tests run from the default directory
|
|
inline JFModuleGainCalibration GainCalibrationFromTestFile() {
|
|
return JFModuleGainCalibration("../../tests/test_data/gainMaps_M049.bin");
|
|
}
|
|
|
|
class JFGainCalibration {
|
|
std::vector<JFModuleGainCalibration> c;
|
|
public:
|
|
void LoadGain(const std::vector<std::string>& filenames);
|
|
const std::vector<JFModuleGainCalibration>& GetCalibration() const;
|
|
};
|
|
|
|
#endif //JUNGFRAUJOCH_JFMODULEGAINCALIBRATION_H
|