From 2f87b4c1b1dad5a65abaf22920f93611ea50bf3c Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 13 Nov 2023 16:19:08 +0100 Subject: [PATCH] JFCalibration: Remove ProtoBuf bindings --- broker/JFJochServices.cpp | 16 --- broker/JFJochStateMachine.cpp | 29 +++-- broker/JFJochStateMachine.h | 1 - grpc/jfjoch.proto | 39 ++----- jungfrau/JFCalibration.cpp | 97 ++++------------- jungfrau/JFCalibration.h | 29 +++-- jungfrau/JFModulePedestal.cpp | 13 --- jungfrau/JFModulePedestal.h | 4 +- python/jfjoch_pb2.py | 132 +++++++++++----------- tests/JFCalibrationTest.cpp | 199 ++++++++++------------------------ tests/JFJochBrokerTest.cpp | 4 - tests/JFPedestalTest.cpp | 33 ------ 12 files changed, 192 insertions(+), 404 deletions(-) diff --git a/broker/JFJochServices.cpp b/broker/JFJochServices.cpp index 2064c889..3f468bbc 100644 --- a/broker/JFJochServices.cpp +++ b/broker/JFJochServices.cpp @@ -164,22 +164,6 @@ RadialIntegrationProfiles JFJochServices::GetRadialIntegrationProfiles() { } } -inline JFJochProtoBuf::DataProcessingSettings Convert(const DataProcessingSettings &input) { - JFJochProtoBuf::DataProcessingSettings ret; - ret.set_signal_to_noise_threshold(input.signal_to_noise_threshold); - ret.set_photon_count_threshold(input.photon_count_threshold); - ret.set_min_pix_per_spot(input.min_pix_per_spot); - ret.set_max_pix_per_spot(input.max_pix_per_spot); - ret.set_local_bkg_size(input.local_bkg_size); - ret.set_high_resolution_limit(input.high_resolution_limit); - ret.set_low_resolution_limit(input.low_resolution_limit); - ret.set_bkg_estimate_low_q(input.bkg_estimate_low_q); - ret.set_bkg_estimate_high_q(input.bkg_estimate_high_q); - ret.set_preview_indexed_only(input.preview_indexed_only); - return ret; -} - - void JFJochServices::SetDataProcessingSettings(const DataProcessingSettings &settings) { if (receiver) receiver->SetDataProcessingSettings(settings); diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index dfecea5d..6a31f006 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -3,7 +3,6 @@ #include #include "JFJochStateMachine.h" -#include "../common/JFJochException.h" inline DataProcessingSettings Convert(const JFJochProtoBuf::DataProcessingSettings &input) { DataProcessingSettings ret; @@ -81,6 +80,23 @@ inline JFJochProtoBuf::RadialIntegrationProfiles Convert(const RadialIntegration return output; } +inline JFJochProtoBuf::JFCalibrationStatistics Convert(const std::vector& input) { + JFJochProtoBuf::JFCalibrationStatistics output; + for (const auto& i: input) { + auto ret = output.add_module_statistics(); + ret->set_module_number(i.module_number); + ret->set_masked_pixels(i.masked_pixels); + ret->set_storage_cell_number(i.storage_cell_number); + ret->set_gain_g0_mean(i.gain_g0_mean); + ret->set_gain_g1_mean(i.gain_g1_mean); + ret->set_gain_g2_mean(i.gain_g2_mean); + ret->set_pedestal_g0_mean(i.pedestal_g0_mean); + ret->set_pedestal_g1_mean(i.pedestal_g1_mean); + ret->set_pedestal_g2_mean(i.pedestal_g2_mean); + } + return output; +} + JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_logger) : services(in_services), logger(in_logger), data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()) { @@ -96,14 +112,14 @@ void JFJochStateMachine::ImportPedestalG0(const JFJochReceiverOutput &receiver_o calibration->Pedestal(module, 0, s) = receiver_output.pedestal_result[module + s * experiment.GetModulesNum()]; } - SetCalibrationStatistics(calibration->GetModuleStatistics()); + SetCalibrationStatistics(Convert(calibration->GetModuleStatistics())); } void JFJochStateMachine::ImportPedestal(const JFJochReceiverOutput &receiver_output, size_t gain_level, size_t storage_cell) { for (int i = 0; i < receiver_output.pedestal_result.size(); i++) calibration->Pedestal(i, gain_level, storage_cell) = receiver_output.pedestal_result[i]; - SetCalibrationStatistics(calibration->GetModuleStatistics()); + SetCalibrationStatistics(Convert(calibration->GetModuleStatistics())); } void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock &ul) { @@ -417,13 +433,6 @@ std::optional JFJochStateMachine::GetMeas return measurement_statistics; } -JFCalibration JFJochStateMachine::GetCalibration() const { - std::unique_lock ul(m); - if (state == JFJochState::Inactive) - throw JFJochException(JFJochExceptionCategory::WrongDAQState, "Detector not calibrated"); - return *calibration; -} - void JFJochStateMachine::LoadMask(const std::vector &vec, uint32_t bit) { std::unique_lock ul(m); if (state == JFJochState::Inactive) diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index 92052a35..cade25ce 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -72,7 +72,6 @@ public: void LoadMask(const std::vector &vec, uint32_t bit); void SetCalibrationStatistics(const JFJochProtoBuf::JFCalibrationStatistics &input); - JFCalibration GetCalibration() const; JFJochProtoBuf::DetectorSettings GetDetectorSettings() const; void SetDetectorSettings(const JFJochProtoBuf::DetectorSettings& settings); diff --git a/grpc/jfjoch.proto b/grpc/jfjoch.proto index 410773e4..c58c422d 100644 --- a/grpc/jfjoch.proto +++ b/grpc/jfjoch.proto @@ -179,7 +179,6 @@ message InternalSettings { bool debug_pixel_mask = 38; } - message JungfraujochSettings { DatasetSettings dataset = 1; InternalSettings internal = 2; @@ -187,20 +186,19 @@ message JungfraujochSettings { // Calibration -message JFPedestal { - bytes pedestal = 1; -} +message ModuleStatistics { + int64 module_number = 1; + int64 storage_cell_number = 2; -message JFGainCalibration { - bytes gain_calibration = 1; -} + float pedestal_g0_mean = 3; + float pedestal_g1_mean = 4; + float pedestal_g2_mean = 5; -message JFCalibration { - uint64 nmodules = 1; - uint64 nstorage_cells = 2; - repeated JFPedestal pedestal = 3; - bytes mask = 4; - repeated JFGainCalibration gain_calibration = 5; + float gain_g0_mean = 6; + float gain_g1_mean = 7; + float gain_g2_mean = 8; + + uint64 masked_pixels = 9; } message JFCalibrationStatistics { @@ -311,21 +309,6 @@ message DataProcessingSettings { // Broker -message ModuleStatistics { - int64 module_number = 1; - int64 storage_cell_number = 2; - - float pedestal_g0_mean = 3; - float pedestal_g1_mean = 4; - float pedestal_g2_mean = 5; - - float gain_g0_mean = 6; - float gain_g1_mean = 7; - float gain_g2_mean = 8; - - uint64 masked_pixels = 9; -} - message Image { bytes data = 1; int64 width = 2; diff --git a/jungfrau/JFCalibration.cpp b/jungfrau/JFCalibration.cpp index 360ad5b3..ad8cefff 100644 --- a/jungfrau/JFCalibration.cpp +++ b/jungfrau/JFCalibration.cpp @@ -2,9 +2,7 @@ #include "JFCalibration.h" -#include #include "../compression/JFJochCompressor.h" -#include JFCalibration::JFCalibration(size_t in_nmodules, size_t in_nstorage_cells) : nmodules(in_nmodules), @@ -137,59 +135,34 @@ int64_t JFCalibration::CountMaskedPixels(size_t module_number, size_t storage_ce return ret; } -void -JFCalibration::GetModuleStatistics(JFJochProtoBuf::JFCalibrationStatistics &statistics, size_t storage_cell) const { - for (int i = 0; i < nmodules; i++) { - auto tmp = statistics.add_module_statistics(); - tmp->set_module_number(i); - tmp->set_storage_cell_number(storage_cell); - tmp->set_pedestal_g0_mean(std::round(Pedestal(i, 0, storage_cell).Mean())); - tmp->set_pedestal_g1_mean(std::round(Pedestal(i, 1, storage_cell).Mean())); - tmp->set_pedestal_g2_mean(std::round(Pedestal(i, 2, storage_cell).Mean())); - tmp->set_gain_g0_mean(GainCalibration(i).GetG0Mean()); - tmp->set_gain_g1_mean(GainCalibration(i).GetG1Mean()); - tmp->set_gain_g2_mean(GainCalibration(i).GetG2Mean()); - tmp->set_masked_pixels(CountMaskedPixels(i, storage_cell)); - } +JFCalibrationModuleStatistics JFCalibration::GetModuleStatistics(size_t module_number, size_t storage_cell) const { + JFCalibrationModuleStatistics ret{}; + ret.module_number = module_number; + ret.storage_cell_number = storage_cell; + ret.pedestal_g0_mean = std::round(Pedestal(module_number, 0, storage_cell).Mean()); + ret.pedestal_g1_mean = std::round(Pedestal(module_number, 1, storage_cell).Mean()); + ret.pedestal_g2_mean = std::round(Pedestal(module_number, 2, storage_cell).Mean()); + ret.gain_g0_mean = GainCalibration(module_number).GetG0Mean(); + ret.gain_g1_mean = GainCalibration(module_number).GetG1Mean(); + ret.gain_g2_mean = GainCalibration(module_number).GetG2Mean(); + ret.masked_pixels = (CountMaskedPixels(module_number, storage_cell)); + return ret; } -JFJochProtoBuf::JFCalibrationStatistics JFCalibration::GetModuleStatistics(size_t storage_cell) const { - JFJochProtoBuf::JFCalibrationStatistics output; - GetModuleStatistics(output, storage_cell); +std::vector JFCalibration::GetModuleStatistics(size_t storage_cell) const { + std::vector output; + for (int i = 0; i < nmodules; i++) + output.push_back(GetModuleStatistics(i, storage_cell)); return output; } -JFJochProtoBuf::JFCalibrationStatistics JFCalibration::GetModuleStatistics() const { - JFJochProtoBuf::JFCalibrationStatistics output; - for (int s = 0; s < nstorage_cells; s++) - GetModuleStatistics(output, s); - return output; -} - -JFCalibration::JFCalibration(const JFJochProtoBuf::JFCalibration &input) : - JFCalibration(input.nmodules(), input.nstorage_cells()) { - - if (input.pedestal_size() != pedestal.size()) - throw JFJochException(JFJochExceptionCategory::ZSTDCompressionError, - "Mismatch in size of serialized data (pedestal count)"); - - for (int i = 0; i < pedestal.size(); i++) - pedestal[i] = input.pedestal(i); - - if (input.gain_calibration_size() != gain_calibration.size()) - throw JFJochException(JFJochExceptionCategory::ZSTDCompressionError, - "Mismatch in size of serialized data (gain calibration count)"); - - for (int i = 0; i < gain_calibration.size(); i++){ - if (input.gain_calibration(i).gain_calibration().size() != 3 * RAW_MODULE_SIZE * sizeof(double)) - throw JFJochException(JFJochExceptionCategory::ZSTDCompressionError, - "Mismatch in size of serialized data (gain calibration size)"); - std::vector tmp(3 * RAW_MODULE_SIZE); - memcpy(tmp.data(), input.gain_calibration(i).gain_calibration().data(), 3 * RAW_MODULE_SIZE * sizeof(double)); - gain_calibration[i] = JFModuleGainCalibration(tmp); +std::vectorJFCalibration::GetModuleStatistics() const { + std::vector output; + for (int s = 0; s < nstorage_cells; s++) { + for (int i = 0; i < nmodules; i++) + output.push_back(GetModuleStatistics(i, s)); } - - memcpy(mask.data(), input.mask().data(), nmodules * RAW_MODULE_SIZE * sizeof(uint32_t)); + return output; } std::vector JFCalibration::GetPedestal(size_t gain_level, size_t storage_cell) const { @@ -201,32 +174,6 @@ std::vector JFCalibration::GetPedestal(size_t gain_level, size_t stora return ret; } -JFCalibration::operator JFJochProtoBuf::JFCalibration() const { - JFJochProtoBuf::JFCalibration output; - - output.set_nmodules(nmodules); - output.set_nstorage_cells(nstorage_cells); - - for (const auto & i : pedestal) { - auto tmp = output.add_pedestal(); - *tmp = i; - } - - for (const auto &i: gain_calibration) { - auto tmp = output.add_gain_calibration(); - auto &tmp_in = i.GetGainCalibration(); - tmp->set_gain_calibration(tmp_in.data(), tmp_in.size() * sizeof(double)); - } - - output.set_mask(mask.data(), RAW_MODULE_SIZE * nmodules * sizeof(uint32_t)); - - return output; -} - -JFCalibration::operator JFJochProtoBuf::JFCalibrationStatistics() const { - return GetModuleStatistics(); -} - JFModuleGainCalibration &JFCalibration::GainCalibration(size_t module_num) { if (module_num >= nmodules) throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, diff --git a/jungfrau/JFCalibration.h b/jungfrau/JFCalibration.h index 8f5b1c06..1b018e55 100644 --- a/jungfrau/JFCalibration.h +++ b/jungfrau/JFCalibration.h @@ -9,7 +9,20 @@ #include "../common/DiffractionExperiment.h" #include "../common/RawToConvertedGeometry.h" #include "../common/JFJochException.h" -#include + +struct JFCalibrationModuleStatistics { + int64_t module_number; + int64_t storage_cell_number; + uint64_t masked_pixels; + + float pedestal_g0_mean; + float pedestal_g1_mean; + float pedestal_g2_mean; + + float gain_g0_mean; + float gain_g1_mean; + float gain_g2_mean; +}; class JFCalibration { const size_t nmodules; @@ -19,17 +32,9 @@ class JFCalibration { std::vector gain_calibration; std::vector mask; // pedestal independent mask - void GetModuleStatistics(JFJochProtoBuf::JFCalibrationStatistics &statistics, size_t storage_cell) const; public: explicit JFCalibration(size_t nmodules, size_t nstorage_cells = 1); explicit JFCalibration(const DiffractionExperiment& experiment); - JFCalibration(const JFJochProtoBuf::JFCalibration &input); - - JFCalibration(const nlohmann::json &j); - nlohmann::json Serialize() const; - - [[nodiscard]] operator JFJochProtoBuf::JFCalibration() const; - [[nodiscard]] operator JFJochProtoBuf::JFCalibrationStatistics() const; [[nodiscard]] size_t GetModulesNum() const; [[nodiscard]] size_t GetStorageCellNum() const; @@ -47,9 +52,9 @@ public: [[nodiscard]] std::vector CalculateOneByteMask(const DiffractionExperiment& experiment, size_t storage_cell = 0) const; [[nodiscard]] std::vector CalculateNexusMask(const DiffractionExperiment& experiment, size_t storage_cell = 0) const; [[nodiscard]] int64_t CountMaskedPixels(size_t module_number, size_t storage_cell = 0) const; - - [[nodiscard]] JFJochProtoBuf::JFCalibrationStatistics GetModuleStatistics(size_t storage_cell) const; - [[nodiscard]] JFJochProtoBuf::JFCalibrationStatistics GetModuleStatistics() const; + [[nodiscard]] JFCalibrationModuleStatistics GetModuleStatistics(size_t module_number, size_t storage_cell) const; + [[nodiscard]] std::vector GetModuleStatistics(size_t storage_cell) const; + [[nodiscard]] std::vector GetModuleStatistics() const; [[nodiscard]] std::vector GetPedestal(size_t gain_level, size_t storage_cell = 0) const; diff --git a/jungfrau/JFModulePedestal.cpp b/jungfrau/JFModulePedestal.cpp index 9dfa72a1..0138ef5b 100644 --- a/jungfrau/JFModulePedestal.cpp +++ b/jungfrau/JFModulePedestal.cpp @@ -39,19 +39,6 @@ double JFModulePedestal::Mean() const { return static_cast(ret) / static_cast(RAW_MODULE_SIZE); } -JFModulePedestal::operator JFJochProtoBuf::JFPedestal() const { - JFJochProtoBuf::JFPedestal serialized; - serialized.set_pedestal(data.get(), sizeof(JFModulePedestalData)); - return serialized; -} - -JFModulePedestal::JFModulePedestal(const JFJochProtoBuf::JFPedestal &serialized) : JFModulePedestal() { - if (serialized.pedestal().size() != sizeof(JFModulePedestalData)) - throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, - "Mismatch in serialized pedestal size"); - memcpy(data.get(), serialized.pedestal().data(), sizeof(JFModulePedestalData)); -} - size_t JFModulePedestal::CountMaskedPixels() const { size_t ret = 0; for (auto i : data->pedestal_mask) { diff --git a/jungfrau/JFModulePedestal.h b/jungfrau/JFModulePedestal.h index 7c136e9c..38e336f5 100644 --- a/jungfrau/JFModulePedestal.h +++ b/jungfrau/JFModulePedestal.h @@ -31,9 +31,7 @@ public: [[nodiscard]] const JFModulePedestalData* Serialized() const; - JFModulePedestal(const JFJochProtoBuf::JFPedestal& pedestal); // deserialize - [[nodiscard]] operator JFJochProtoBuf::JFPedestal() const; // serialize - [[nodiscard]] double Mean() const; + [[nodiscard]] double Mean() const; template void LoadPedestal(const std::vector &vector) { for (int i = 0; i < RAW_MODULE_SIZE; i++) { diff --git a/python/jfjoch_pb2.py b/python/jfjoch_pb2.py index 79b02fc8..83220d48 100644 --- a/python/jfjoch_pb2.py +++ b/python/jfjoch_pb2.py @@ -13,25 +13,25 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cjfjoch.proto\x12\x0eJFJochProtoBuf\"\x07\n\x05\x45mpty\"W\n\x08UnitCell\x12\t\n\x01\x61\x18\x01 \x01(\x02\x12\t\n\x01\x62\x18\x02 \x01(\x02\x12\t\n\x01\x63\x18\x03 \x01(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x0c\n\x04\x62\x65ta\x18\x05 \x01(\x02\x12\r\n\x05gamma\x18\x06 \x01(\x02\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"|\n\x10RotationSettings\x12\x17\n\x0fstart_angle_deg\x18\x01 \x01(\x02\x12 \n\x18\x61ngle_incr_per_image_deg\x18\x02 \x01(\x02\x12-\n\rrotation_axis\x18\x03 \x01(\x0b\x32\x16.JFJochProtoBuf.Vector\"\x1c\n\x04Plot\x12\t\n\x01x\x18\x01 \x03(\x02\x12\t\n\x01y\x18\x02 \x03(\x02\"\xb1\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12:\n\x11\x66pga_pixel_output\x18\x03 \x01(\x0e\x32\x1f.JFJochProtoBuf.FPGAPixelOutput\x12\x11\n\tsummation\x18\x04 \x01(\x03\x12\x12\n\nbeam_x_pxl\x18\x05 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x07 \x01(\x02\x12\x19\n\x11photon_energy_keV\x18\x08 \x01(\x02\x12\x13\n\x0b\x66ile_prefix\x18\t \x01(\t\x12\x17\n\x0f\x64\x61ta_file_count\x18\n \x01(\x03\x12\x30\n\x0b\x63ompression\x18\x0b \x01(\x0e\x32\x1b.JFJochProtoBuf.Compression\x12\x13\n\x0bsample_name\x18\x0c \x01(\t\x12+\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCell\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12 \n\x18rad_int_solid_angle_corr\x18\x12 \x01(\x08\x12!\n\x19rad_int_polarization_corr\x18\x13 \x01(\x08\x12#\n\x1brad_int_polarization_factor\x18\x14 \x01(\x02\x12\x18\n\x10save_calibration\x18\x15 \x01(\x08\"\x90\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x15\n\rcount_time_us\x18\x02 \x01(\x03\x12\x1a\n\x12storage_cell_count\x18\x03 \x01(\x03\x12%\n\x1duse_internal_packet_generator\x18\x04 \x01(\x08\x12\x18\n\x10\x63ollect_raw_data\x18\x05 \x01(\x08\x12\x1a\n\x12pedestal_g0_frames\x18\x06 \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\x07 \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x08 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\n \x01(\x03\"b\n\x16\x44\x65tectorModuleGeometry\x12\x0e\n\x06pixel0\x18\x01 \x01(\x03\x12\x1b\n\x13\x66\x61st_direction_step\x18\x02 \x01(\x03\x12\x1b\n\x13slow_direction_step\x18\x03 \x01(\x03\"z\n\x10\x44\x65tectorGeometry\x12\x11\n\twidth_pxl\x18\x01 \x01(\x03\x12\x12\n\nheight_pxl\x18\x02 \x01(\x03\x12?\n\x0fmodule_geometry\x18\x03 \x03(\x0b\x32&.JFJochProtoBuf.DetectorModuleGeometry\"\xb2\x01\n\x08\x44\x65tector\x12\x10\n\x08nmodules\x18\x01 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rpixel_size_mm\x18\x03 \x01(\x02\x12\x17\n\x0fmodule_hostname\x18\x04 \x03(\t\x12\x32\n\x08geometry\x18\x05 \x01(\x0b\x32 .JFJochProtoBuf.DetectorGeometry\x12\x1b\n\x13udp_interface_count\x18\x07 \x01(\x03\"\xdf\x05\n\x10InternalSettings\x12\"\n\x1a\x66rame_time_pedestalG1G2_us\x18\x01 \x01(\x03\x12\x15\n\rframe_time_us\x18\x03 \x01(\x03\x12\x15\n\rcount_time_us\x18\x04 \x01(\x03\x12*\n\x08\x64\x65tector\x18\x05 \x01(\x0b\x32\x18.JFJochProtoBuf.Detector\x12\x14\n\x0cndatastreams\x18\x06 \x01(\x03\x12&\n\x1einternal_fpga_packet_generator\x18\t \x01(\x08\x12\x15\n\rstorage_cells\x18\n \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x0b \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\' \x01(\x03\x12\x1a\n\x12pedestal_g0_frames\x18\x0c \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\r \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x0e \x01(\x03\x12\x19\n\x11preview_period_us\x18\x0f \x01(\x03\x12*\n\x04mode\x18\x13 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x19\n\x11mask_module_edges\x18\x14 \x01(\x08\x12\x17\n\x0fmask_chip_edges\x18\x15 \x01(\x08\x12\x16\n\x0eipv4_base_addr\x18\x16 \x01(\x03\x12\r\n\x05low_q\x18\x1a \x01(\x02\x12\x0e\n\x06high_q\x18\x1b \x01(\x02\x12\x11\n\tq_spacing\x18\x1c \x01(\x02\x12\x10\n\x08git_sha1\x18\x1d \x01(\t\x12\x10\n\x08git_date\x18\x1e \x01(\t\x12\x13\n\x0bsource_name\x18 \x01(\t\x12\x19\n\x11source_name_short\x18! \x01(\t\x12\x17\n\x0finstrument_name\x18\" \x01(\t\x12\x1d\n\x15instrument_name_short\x18# \x01(\t\x12\x18\n\x10\x64\x65\x62ug_pixel_mask\x18& \x01(\x08\"|\n\x14JungfraujochSettings\x12\x30\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32\x1f.JFJochProtoBuf.DatasetSettings\x12\x32\n\x08internal\x18\x02 \x01(\x0b\x32 .JFJochProtoBuf.InternalSettings\"\x1e\n\nJFPedestal\x12\x10\n\x08pedestal\x18\x01 \x01(\x0c\"-\n\x11JFGainCalibration\x12\x18\n\x10gain_calibration\x18\x01 \x01(\x0c\"\xb2\x01\n\rJFCalibration\x12\x10\n\x08nmodules\x18\x01 \x01(\x04\x12\x16\n\x0enstorage_cells\x18\x02 \x01(\x04\x12,\n\x08pedestal\x18\x03 \x03(\x0b\x32\x1a.JFJochProtoBuf.JFPedestal\x12\x0c\n\x04mask\x18\x04 \x01(\x0c\x12;\n\x10gain_calibration\x18\x05 \x03(\x0b\x32!.JFJochProtoBuf.JFGainCalibration\"V\n\x17JFCalibrationStatistics\x12;\n\x11module_statistics\x18\x01 \x03(\x0b\x32 .JFJochProtoBuf.ModuleStatistics\"F\n\x0bPlotRequest\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.JFJochProtoBuf.PlotType\x12\x0f\n\x07\x62inning\x18\x02 \x01(\x04\"M\n\x18RadialIntegrationProfile\x12\r\n\x05title\x18\x01 \x01(\t\x12\"\n\x04plot\x18\x02 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\"W\n\x19RadialIntegrationProfiles\x12:\n\x08profiles\x18\x01 \x03(\x0b\x32(.JFJochProtoBuf.RadialIntegrationProfile\">\n\x0bWriterInput\x12\x1c\n\x14zmq_receiver_address\x18\x01 \x01(\t\x12\x11\n\tseries_id\x18\x02 \x01(\x03\"3\n\x12\x44\x61taFileStatistics\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07nimages\x18\x02 \x01(\x03\"\x8d\x01\n\x0cWriterOutput\x12\x0f\n\x07nimages\x18\x01 \x01(\x03\x12\x17\n\x0fperformance_MBs\x18\x02 \x01(\x02\x12\x16\n\x0eperformance_Hz\x18\x03 \x01(\x02\x12;\n\x0f\x66ile_statistics\x18\x04 \x03(\x0b\x32\".JFJochProtoBuf.DataFileStatistics\"\x82\x02\n\x14\x44\x65tectorModuleConfig\x12\x17\n\x0fudp_dest_port_1\x18\x01 \x01(\x04\x12\x17\n\x0fudp_dest_port_2\x18\x02 \x01(\x04\x12\x17\n\x0fipv4_src_addr_1\x18\x03 \x01(\t\x12\x17\n\x0fipv4_src_addr_2\x18\x04 \x01(\t\x12\x18\n\x10ipv4_dest_addr_1\x18\x05 \x01(\t\x12\x18\n\x10ipv4_dest_addr_2\x18\x06 \x01(\t\x12\x17\n\x0fmac_addr_dest_1\x18\x07 \x01(\t\x12\x17\n\x0fmac_addr_dest_2\x18\x08 \x01(\t\x12 \n\x18module_id_in_data_stream\x18\t \x01(\x04\"}\n\x0e\x44\x65tectorConfig\x12\x35\n\x07modules\x18\x01 \x03(\x0b\x32$.JFJochProtoBuf.DetectorModuleConfig\x12\x17\n\x0fmodule_hostname\x18\x02 \x03(\t\x12\x1b\n\x13udp_interface_count\x18\x03 \x01(\x03\"\xfc\x01\n\rDetectorInput\x12\x13\n\x0bmodules_num\x18\x01 \x01(\x03\x12*\n\x04mode\x18\x02 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x12\n\nnum_frames\x18\x03 \x01(\x03\x12\x14\n\x0cnum_triggers\x18\x04 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x05 \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x06 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\x07 \x01(\x03\x12\x11\n\tperiod_us\x18\t \x01(\x03\x12\x15\n\rcount_time_us\x18\n \x01(\x03\"\x10\n\x0e\x44\x65tectorOutput\"b\n\x0e\x44\x65tectorStatus\x12$\n\x05state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x12\n\nfw_version\x18\x02 \x01(\x03\x12\x16\n\x0eserver_version\x18\x03 \x01(\t\"Q\n\x0e\x46PGAFIFOStatus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0e\x32\".JFJochProtoBuf.FPGAFIFOStatusEnum\"\xbb\x02\n\x16\x44\x61taProcessingSettings\x12!\n\x19signal_to_noise_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16photon_count_threshold\x18\x02 \x01(\x03\x12\x18\n\x10min_pix_per_spot\x18\x03 \x01(\x03\x12\x18\n\x10max_pix_per_spot\x18\x04 \x01(\x03\x12\x16\n\x0elocal_bkg_size\x18\x05 \x01(\x03\x12\x1d\n\x15high_resolution_limit\x18\x06 \x01(\x02\x12\x1c\n\x14low_resolution_limit\x18\x07 \x01(\x02\x12\x1a\n\x12\x62kg_estimate_low_q\x18\x08 \x01(\x02\x12\x1b\n\x13\x62kg_estimate_high_q\x18\t \x01(\x02\x12\x1c\n\x14preview_indexed_only\x18\n \x01(\x08\"\xed\x01\n\x10ModuleStatistics\x12\x15\n\rmodule_number\x18\x01 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x02 \x01(\x03\x12\x18\n\x10pedestal_g0_mean\x18\x03 \x01(\x02\x12\x18\n\x10pedestal_g1_mean\x18\x04 \x01(\x02\x12\x18\n\x10pedestal_g2_mean\x18\x05 \x01(\x02\x12\x14\n\x0cgain_g0_mean\x18\x06 \x01(\x02\x12\x14\n\x0cgain_g1_mean\x18\x07 \x01(\x02\x12\x14\n\x0cgain_g2_mean\x18\x08 \x01(\x02\x12\x15\n\rmasked_pixels\x18\t \x01(\x04\"I\n\x05Image\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05width\x18\x02 \x01(\x03\x12\x0e\n\x06height\x18\x03 \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x04 \x01(\x03\".\n\nMaskToLoad\x12\x0c\n\x04mask\x18\x01 \x03(\r\x12\x12\n\nbit_to_set\x18\x02 \x01(\x05\"\xc9\x02\n\x15MeasurementStatistics\x12\x13\n\x0b\x66ile_prefix\x18\x01 \x01(\t\x12\x18\n\x10images_collected\x18\x02 \x01(\x03\x12\x1d\n\x15max_image_number_sent\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ollection_efficiency\x18\x04 \x01(\x02\x12\x19\n\x11\x63ompression_ratio\x18\x05 \x01(\x02\x12\x11\n\tcancelled\x18\x06 \x01(\x08\x12\x19\n\x11max_receive_delay\x18\x07 \x01(\x03\x12\x15\n\rindexing_rate\x18\n \x01(\x02\x12\x16\n\x0e\x64\x65tector_width\x18\x0c \x01(\x03\x12\x17\n\x0f\x64\x65tector_height\x18\r \x01(\x03\x12\x1c\n\x14\x64\x65tector_pixel_depth\x18\x0e \x01(\x03\x12\x14\n\x0c\x62kg_estimate\x18\x10 \x01(\x02\"\x89\x01\n\x0c\x42rokerStatus\x12+\n\x0c\x62roker_state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x10\n\x08progress\x18\x02 \x01(\x02\x12\x15\n\rindexing_rate\x18\x03 \x01(\x02\x12#\n\x1breceiver_send_buffers_avail\x18\x04 \x01(\x02\"H\n\x13\x44\x65tectorListElement\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x10\n\x08nmodules\x18\x02 \x01(\x03\x12\n\n\x02id\x18\x03 \x01(\x03\"v\n\x0c\x44\x65tectorList\x12\x35\n\x08\x64\x65tector\x18\x01 \x03(\x0b\x32#.JFJochProtoBuf.DetectorListElement\x12\x12\n\ncurrent_id\x18\x02 \x01(\x03\x12\x1b\n\x13\x63urrent_description\x18\x03 \x01(\t\"\x1f\n\x11\x44\x65tectorSelection\x12\n\n\x02id\x18\x01 \x01(\x03*T\n\x0b\x43ompression\x12\r\n\tBSHUF_LZ4\x10\x00\x12\x0e\n\nBSHUF_ZSTD\x10\x01\x12\x12\n\x0e\x42SHUF_ZSTD_RLE\x10\x02\x12\x12\n\x0eNO_COMPRESSION\x10\x03*Z\n\x0c\x44\x65tectorMode\x12\x0e\n\nCONVERSION\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x0f\n\x0bPEDESTAL_G0\x10\x02\x12\x0f\n\x0bPEDESTAL_G1\x10\x03\x12\x0f\n\x0bPEDESTAL_G2\x10\x04*6\n\x12\x46PGAFIFOStatusEnum\x12\t\n\x05\x45MPTY\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02*^\n\x05State\x12\x13\n\x0fNOT_INITIALIZED\x10\x00\x12\x08\n\x04IDLE\x10\x01\x12\x08\n\x04\x42USY\x10\x02\x12\x0c\n\x08PEDESTAL\x10\x03\x12\x13\n\x0f\x44\x41TA_COLLECTION\x10\x04\x12\t\n\x05\x45RROR\x10\x05*I\n\x0f\x46PGAPixelOutput\x12\x08\n\x04\x41UTO\x10\x00\x12\t\n\x05INT16\x10\x01\x12\n\n\x06UINT16\x10\x02\x12\t\n\x05INT32\x10\x03\x12\n\n\x06UINT32\x10\x04*{\n\x08PlotType\x12\x10\n\x0c\x42KG_ESTIMATE\x10\x00\x12\x0b\n\x07RAD_INT\x10\x01\x12\x0e\n\nSPOT_COUNT\x10\x02\x12\x11\n\rINDEXING_RATE\x10\x03\x12\x1a\n\x16INDEXING_RATE_PER_FILE\x10\x04\x12\x11\n\rADU_HISTOGRAM\x10\x05\x32\xca\x01\n\x11gRPC_JFJochWriter\x12=\n\x05Start\x12\x1b.JFJochProtoBuf.WriterInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12=\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.WriterOutput\"\x00\x32\x82\x03\n\x13gRPC_JFJochDetector\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.DetectorInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x41\n\x06Status\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.DetectorStatus\"\x00\x12=\n\x02On\x12\x1e.JFJochProtoBuf.DetectorConfig\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x35\n\x03Off\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x32\xd4\x0c\n\x11gRPC_JFJochBroker\x12\x41\n\x05Start\x12\x1f.JFJochProtoBuf.DatasetSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12:\n\x08Pedestal\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nInitialize\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nDeactivate\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x42\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.BrokerStatus\"\x00\x12\\\n\x18GetCalibrationStatistics\x12\x15.JFJochProtoBuf.Empty\x1a\'.JFJochProtoBuf.JFCalibrationStatistics\"\x00\x12P\n\x13GetDetectorSettings\x12\x15.JFJochProtoBuf.Empty\x1a .JFJochProtoBuf.DetectorSettings\"\x00\x12P\n\x13PutDetectorSettings\x12 .JFJochProtoBuf.DetectorSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12Z\n\x18GetMeasurementStatistics\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.MeasurementStatistics\"\x00\x12\\\n\x19GetDataProcessingSettings\x12\x15.JFJochProtoBuf.Empty\x1a&.JFJochProtoBuf.DataProcessingSettings\"\x00\x12\\\n\x19PutDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12?\n\x08GetPlots\x12\x1b.JFJochProtoBuf.PlotRequest\x1a\x14.JFJochProtoBuf.Plot\"\x00\x12\x62\n\x1cGetRadialIntegrationProfiles\x12\x15.JFJochProtoBuf.Empty\x1a).JFJochProtoBuf.RadialIntegrationProfiles\"\x00\x12?\n\rGetPedestalG0\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG1\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG2\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12\x39\n\x07GetMask\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12H\n\x0fGetDetectorList\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.DetectorList\"\x00\x12L\n\x0eSelectDetector\x12!.JFJochProtoBuf.DetectorSelection\x1a\x15.JFJochProtoBuf.Empty\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cjfjoch.proto\x12\x0eJFJochProtoBuf\"\x07\n\x05\x45mpty\"W\n\x08UnitCell\x12\t\n\x01\x61\x18\x01 \x01(\x02\x12\t\n\x01\x62\x18\x02 \x01(\x02\x12\t\n\x01\x63\x18\x03 \x01(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x0c\n\x04\x62\x65ta\x18\x05 \x01(\x02\x12\r\n\x05gamma\x18\x06 \x01(\x02\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"|\n\x10RotationSettings\x12\x17\n\x0fstart_angle_deg\x18\x01 \x01(\x02\x12 \n\x18\x61ngle_incr_per_image_deg\x18\x02 \x01(\x02\x12-\n\rrotation_axis\x18\x03 \x01(\x0b\x32\x16.JFJochProtoBuf.Vector\"\x1c\n\x04Plot\x12\t\n\x01x\x18\x01 \x03(\x02\x12\t\n\x01y\x18\x02 \x03(\x02\"\xb1\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12:\n\x11\x66pga_pixel_output\x18\x03 \x01(\x0e\x32\x1f.JFJochProtoBuf.FPGAPixelOutput\x12\x11\n\tsummation\x18\x04 \x01(\x03\x12\x12\n\nbeam_x_pxl\x18\x05 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x07 \x01(\x02\x12\x19\n\x11photon_energy_keV\x18\x08 \x01(\x02\x12\x13\n\x0b\x66ile_prefix\x18\t \x01(\t\x12\x17\n\x0f\x64\x61ta_file_count\x18\n \x01(\x03\x12\x30\n\x0b\x63ompression\x18\x0b \x01(\x0e\x32\x1b.JFJochProtoBuf.Compression\x12\x13\n\x0bsample_name\x18\x0c \x01(\t\x12+\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCell\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12 \n\x18rad_int_solid_angle_corr\x18\x12 \x01(\x08\x12!\n\x19rad_int_polarization_corr\x18\x13 \x01(\x08\x12#\n\x1brad_int_polarization_factor\x18\x14 \x01(\x02\x12\x18\n\x10save_calibration\x18\x15 \x01(\x08\"\x90\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x15\n\rcount_time_us\x18\x02 \x01(\x03\x12\x1a\n\x12storage_cell_count\x18\x03 \x01(\x03\x12%\n\x1duse_internal_packet_generator\x18\x04 \x01(\x08\x12\x18\n\x10\x63ollect_raw_data\x18\x05 \x01(\x08\x12\x1a\n\x12pedestal_g0_frames\x18\x06 \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\x07 \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x08 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\n \x01(\x03\"b\n\x16\x44\x65tectorModuleGeometry\x12\x0e\n\x06pixel0\x18\x01 \x01(\x03\x12\x1b\n\x13\x66\x61st_direction_step\x18\x02 \x01(\x03\x12\x1b\n\x13slow_direction_step\x18\x03 \x01(\x03\"z\n\x10\x44\x65tectorGeometry\x12\x11\n\twidth_pxl\x18\x01 \x01(\x03\x12\x12\n\nheight_pxl\x18\x02 \x01(\x03\x12?\n\x0fmodule_geometry\x18\x03 \x03(\x0b\x32&.JFJochProtoBuf.DetectorModuleGeometry\"\xb2\x01\n\x08\x44\x65tector\x12\x10\n\x08nmodules\x18\x01 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rpixel_size_mm\x18\x03 \x01(\x02\x12\x17\n\x0fmodule_hostname\x18\x04 \x03(\t\x12\x32\n\x08geometry\x18\x05 \x01(\x0b\x32 .JFJochProtoBuf.DetectorGeometry\x12\x1b\n\x13udp_interface_count\x18\x07 \x01(\x03\"\xdf\x05\n\x10InternalSettings\x12\"\n\x1a\x66rame_time_pedestalG1G2_us\x18\x01 \x01(\x03\x12\x15\n\rframe_time_us\x18\x03 \x01(\x03\x12\x15\n\rcount_time_us\x18\x04 \x01(\x03\x12*\n\x08\x64\x65tector\x18\x05 \x01(\x0b\x32\x18.JFJochProtoBuf.Detector\x12\x14\n\x0cndatastreams\x18\x06 \x01(\x03\x12&\n\x1einternal_fpga_packet_generator\x18\t \x01(\x08\x12\x15\n\rstorage_cells\x18\n \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x0b \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\' \x01(\x03\x12\x1a\n\x12pedestal_g0_frames\x18\x0c \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\r \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x0e \x01(\x03\x12\x19\n\x11preview_period_us\x18\x0f \x01(\x03\x12*\n\x04mode\x18\x13 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x19\n\x11mask_module_edges\x18\x14 \x01(\x08\x12\x17\n\x0fmask_chip_edges\x18\x15 \x01(\x08\x12\x16\n\x0eipv4_base_addr\x18\x16 \x01(\x03\x12\r\n\x05low_q\x18\x1a \x01(\x02\x12\x0e\n\x06high_q\x18\x1b \x01(\x02\x12\x11\n\tq_spacing\x18\x1c \x01(\x02\x12\x10\n\x08git_sha1\x18\x1d \x01(\t\x12\x10\n\x08git_date\x18\x1e \x01(\t\x12\x13\n\x0bsource_name\x18 \x01(\t\x12\x19\n\x11source_name_short\x18! \x01(\t\x12\x17\n\x0finstrument_name\x18\" \x01(\t\x12\x1d\n\x15instrument_name_short\x18# \x01(\t\x12\x18\n\x10\x64\x65\x62ug_pixel_mask\x18& \x01(\x08\"|\n\x14JungfraujochSettings\x12\x30\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32\x1f.JFJochProtoBuf.DatasetSettings\x12\x32\n\x08internal\x18\x02 \x01(\x0b\x32 .JFJochProtoBuf.InternalSettings\"\xed\x01\n\x10ModuleStatistics\x12\x15\n\rmodule_number\x18\x01 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x02 \x01(\x03\x12\x18\n\x10pedestal_g0_mean\x18\x03 \x01(\x02\x12\x18\n\x10pedestal_g1_mean\x18\x04 \x01(\x02\x12\x18\n\x10pedestal_g2_mean\x18\x05 \x01(\x02\x12\x14\n\x0cgain_g0_mean\x18\x06 \x01(\x02\x12\x14\n\x0cgain_g1_mean\x18\x07 \x01(\x02\x12\x14\n\x0cgain_g2_mean\x18\x08 \x01(\x02\x12\x15\n\rmasked_pixels\x18\t \x01(\x04\"V\n\x17JFCalibrationStatistics\x12;\n\x11module_statistics\x18\x01 \x03(\x0b\x32 .JFJochProtoBuf.ModuleStatistics\"F\n\x0bPlotRequest\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.JFJochProtoBuf.PlotType\x12\x0f\n\x07\x62inning\x18\x02 \x01(\x04\"M\n\x18RadialIntegrationProfile\x12\r\n\x05title\x18\x01 \x01(\t\x12\"\n\x04plot\x18\x02 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\"W\n\x19RadialIntegrationProfiles\x12:\n\x08profiles\x18\x01 \x03(\x0b\x32(.JFJochProtoBuf.RadialIntegrationProfile\">\n\x0bWriterInput\x12\x1c\n\x14zmq_receiver_address\x18\x01 \x01(\t\x12\x11\n\tseries_id\x18\x02 \x01(\x03\"3\n\x12\x44\x61taFileStatistics\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07nimages\x18\x02 \x01(\x03\"\x8d\x01\n\x0cWriterOutput\x12\x0f\n\x07nimages\x18\x01 \x01(\x03\x12\x17\n\x0fperformance_MBs\x18\x02 \x01(\x02\x12\x16\n\x0eperformance_Hz\x18\x03 \x01(\x02\x12;\n\x0f\x66ile_statistics\x18\x04 \x03(\x0b\x32\".JFJochProtoBuf.DataFileStatistics\"\x82\x02\n\x14\x44\x65tectorModuleConfig\x12\x17\n\x0fudp_dest_port_1\x18\x01 \x01(\x04\x12\x17\n\x0fudp_dest_port_2\x18\x02 \x01(\x04\x12\x17\n\x0fipv4_src_addr_1\x18\x03 \x01(\t\x12\x17\n\x0fipv4_src_addr_2\x18\x04 \x01(\t\x12\x18\n\x10ipv4_dest_addr_1\x18\x05 \x01(\t\x12\x18\n\x10ipv4_dest_addr_2\x18\x06 \x01(\t\x12\x17\n\x0fmac_addr_dest_1\x18\x07 \x01(\t\x12\x17\n\x0fmac_addr_dest_2\x18\x08 \x01(\t\x12 \n\x18module_id_in_data_stream\x18\t \x01(\x04\"}\n\x0e\x44\x65tectorConfig\x12\x35\n\x07modules\x18\x01 \x03(\x0b\x32$.JFJochProtoBuf.DetectorModuleConfig\x12\x17\n\x0fmodule_hostname\x18\x02 \x03(\t\x12\x1b\n\x13udp_interface_count\x18\x03 \x01(\x03\"\xfc\x01\n\rDetectorInput\x12\x13\n\x0bmodules_num\x18\x01 \x01(\x03\x12*\n\x04mode\x18\x02 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x12\n\nnum_frames\x18\x03 \x01(\x03\x12\x14\n\x0cnum_triggers\x18\x04 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x05 \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x06 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\x07 \x01(\x03\x12\x11\n\tperiod_us\x18\t \x01(\x03\x12\x15\n\rcount_time_us\x18\n \x01(\x03\"\x10\n\x0e\x44\x65tectorOutput\"b\n\x0e\x44\x65tectorStatus\x12$\n\x05state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x12\n\nfw_version\x18\x02 \x01(\x03\x12\x16\n\x0eserver_version\x18\x03 \x01(\t\"Q\n\x0e\x46PGAFIFOStatus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0e\x32\".JFJochProtoBuf.FPGAFIFOStatusEnum\"\xbb\x02\n\x16\x44\x61taProcessingSettings\x12!\n\x19signal_to_noise_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16photon_count_threshold\x18\x02 \x01(\x03\x12\x18\n\x10min_pix_per_spot\x18\x03 \x01(\x03\x12\x18\n\x10max_pix_per_spot\x18\x04 \x01(\x03\x12\x16\n\x0elocal_bkg_size\x18\x05 \x01(\x03\x12\x1d\n\x15high_resolution_limit\x18\x06 \x01(\x02\x12\x1c\n\x14low_resolution_limit\x18\x07 \x01(\x02\x12\x1a\n\x12\x62kg_estimate_low_q\x18\x08 \x01(\x02\x12\x1b\n\x13\x62kg_estimate_high_q\x18\t \x01(\x02\x12\x1c\n\x14preview_indexed_only\x18\n \x01(\x08\"I\n\x05Image\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05width\x18\x02 \x01(\x03\x12\x0e\n\x06height\x18\x03 \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x04 \x01(\x03\".\n\nMaskToLoad\x12\x0c\n\x04mask\x18\x01 \x03(\r\x12\x12\n\nbit_to_set\x18\x02 \x01(\x05\"\xc9\x02\n\x15MeasurementStatistics\x12\x13\n\x0b\x66ile_prefix\x18\x01 \x01(\t\x12\x18\n\x10images_collected\x18\x02 \x01(\x03\x12\x1d\n\x15max_image_number_sent\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ollection_efficiency\x18\x04 \x01(\x02\x12\x19\n\x11\x63ompression_ratio\x18\x05 \x01(\x02\x12\x11\n\tcancelled\x18\x06 \x01(\x08\x12\x19\n\x11max_receive_delay\x18\x07 \x01(\x03\x12\x15\n\rindexing_rate\x18\n \x01(\x02\x12\x16\n\x0e\x64\x65tector_width\x18\x0c \x01(\x03\x12\x17\n\x0f\x64\x65tector_height\x18\r \x01(\x03\x12\x1c\n\x14\x64\x65tector_pixel_depth\x18\x0e \x01(\x03\x12\x14\n\x0c\x62kg_estimate\x18\x10 \x01(\x02\"\x89\x01\n\x0c\x42rokerStatus\x12+\n\x0c\x62roker_state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x10\n\x08progress\x18\x02 \x01(\x02\x12\x15\n\rindexing_rate\x18\x03 \x01(\x02\x12#\n\x1breceiver_send_buffers_avail\x18\x04 \x01(\x02\"H\n\x13\x44\x65tectorListElement\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x10\n\x08nmodules\x18\x02 \x01(\x03\x12\n\n\x02id\x18\x03 \x01(\x03\"v\n\x0c\x44\x65tectorList\x12\x35\n\x08\x64\x65tector\x18\x01 \x03(\x0b\x32#.JFJochProtoBuf.DetectorListElement\x12\x12\n\ncurrent_id\x18\x02 \x01(\x03\x12\x1b\n\x13\x63urrent_description\x18\x03 \x01(\t\"\x1f\n\x11\x44\x65tectorSelection\x12\n\n\x02id\x18\x01 \x01(\x03*T\n\x0b\x43ompression\x12\r\n\tBSHUF_LZ4\x10\x00\x12\x0e\n\nBSHUF_ZSTD\x10\x01\x12\x12\n\x0e\x42SHUF_ZSTD_RLE\x10\x02\x12\x12\n\x0eNO_COMPRESSION\x10\x03*Z\n\x0c\x44\x65tectorMode\x12\x0e\n\nCONVERSION\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x0f\n\x0bPEDESTAL_G0\x10\x02\x12\x0f\n\x0bPEDESTAL_G1\x10\x03\x12\x0f\n\x0bPEDESTAL_G2\x10\x04*6\n\x12\x46PGAFIFOStatusEnum\x12\t\n\x05\x45MPTY\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02*^\n\x05State\x12\x13\n\x0fNOT_INITIALIZED\x10\x00\x12\x08\n\x04IDLE\x10\x01\x12\x08\n\x04\x42USY\x10\x02\x12\x0c\n\x08PEDESTAL\x10\x03\x12\x13\n\x0f\x44\x41TA_COLLECTION\x10\x04\x12\t\n\x05\x45RROR\x10\x05*I\n\x0f\x46PGAPixelOutput\x12\x08\n\x04\x41UTO\x10\x00\x12\t\n\x05INT16\x10\x01\x12\n\n\x06UINT16\x10\x02\x12\t\n\x05INT32\x10\x03\x12\n\n\x06UINT32\x10\x04*{\n\x08PlotType\x12\x10\n\x0c\x42KG_ESTIMATE\x10\x00\x12\x0b\n\x07RAD_INT\x10\x01\x12\x0e\n\nSPOT_COUNT\x10\x02\x12\x11\n\rINDEXING_RATE\x10\x03\x12\x1a\n\x16INDEXING_RATE_PER_FILE\x10\x04\x12\x11\n\rADU_HISTOGRAM\x10\x05\x32\xca\x01\n\x11gRPC_JFJochWriter\x12=\n\x05Start\x12\x1b.JFJochProtoBuf.WriterInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12=\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.WriterOutput\"\x00\x32\x82\x03\n\x13gRPC_JFJochDetector\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.DetectorInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x41\n\x06Status\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.DetectorStatus\"\x00\x12=\n\x02On\x12\x1e.JFJochProtoBuf.DetectorConfig\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x35\n\x03Off\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x32\xd4\x0c\n\x11gRPC_JFJochBroker\x12\x41\n\x05Start\x12\x1f.JFJochProtoBuf.DatasetSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12:\n\x08Pedestal\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nInitialize\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nDeactivate\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x42\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.BrokerStatus\"\x00\x12\\\n\x18GetCalibrationStatistics\x12\x15.JFJochProtoBuf.Empty\x1a\'.JFJochProtoBuf.JFCalibrationStatistics\"\x00\x12P\n\x13GetDetectorSettings\x12\x15.JFJochProtoBuf.Empty\x1a .JFJochProtoBuf.DetectorSettings\"\x00\x12P\n\x13PutDetectorSettings\x12 .JFJochProtoBuf.DetectorSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12Z\n\x18GetMeasurementStatistics\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.MeasurementStatistics\"\x00\x12\\\n\x19GetDataProcessingSettings\x12\x15.JFJochProtoBuf.Empty\x1a&.JFJochProtoBuf.DataProcessingSettings\"\x00\x12\\\n\x19PutDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12?\n\x08GetPlots\x12\x1b.JFJochProtoBuf.PlotRequest\x1a\x14.JFJochProtoBuf.Plot\"\x00\x12\x62\n\x1cGetRadialIntegrationProfiles\x12\x15.JFJochProtoBuf.Empty\x1a).JFJochProtoBuf.RadialIntegrationProfiles\"\x00\x12?\n\rGetPedestalG0\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG1\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG2\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12\x39\n\x07GetMask\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12H\n\x0fGetDetectorList\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.DetectorList\"\x00\x12L\n\x0eSelectDetector\x12!.JFJochProtoBuf.DetectorSelection\x1a\x15.JFJochProtoBuf.Empty\"\x00\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'jfjoch_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _COMPRESSION._serialized_start=5510 - _COMPRESSION._serialized_end=5594 - _DETECTORMODE._serialized_start=5596 - _DETECTORMODE._serialized_end=5686 - _FPGAFIFOSTATUSENUM._serialized_start=5688 - _FPGAFIFOSTATUSENUM._serialized_end=5742 - _STATE._serialized_start=5744 - _STATE._serialized_end=5838 - _FPGAPIXELOUTPUT._serialized_start=5840 - _FPGAPIXELOUTPUT._serialized_end=5913 - _PLOTTYPE._serialized_start=5915 - _PLOTTYPE._serialized_end=6038 + _COMPRESSION._serialized_start=5250 + _COMPRESSION._serialized_end=5334 + _DETECTORMODE._serialized_start=5336 + _DETECTORMODE._serialized_end=5426 + _FPGAFIFOSTATUSENUM._serialized_start=5428 + _FPGAFIFOSTATUSENUM._serialized_end=5482 + _STATE._serialized_start=5484 + _STATE._serialized_end=5578 + _FPGAPIXELOUTPUT._serialized_start=5580 + _FPGAPIXELOUTPUT._serialized_end=5653 + _PLOTTYPE._serialized_start=5655 + _PLOTTYPE._serialized_end=5778 _EMPTY._serialized_start=32 _EMPTY._serialized_end=39 _UNITCELL._serialized_start=41 @@ -56,60 +56,54 @@ if _descriptor._USE_C_DESCRIPTORS == False: _INTERNALSETTINGS._serialized_end=2309 _JUNGFRAUJOCHSETTINGS._serialized_start=2311 _JUNGFRAUJOCHSETTINGS._serialized_end=2435 - _JFPEDESTAL._serialized_start=2437 - _JFPEDESTAL._serialized_end=2467 - _JFGAINCALIBRATION._serialized_start=2469 - _JFGAINCALIBRATION._serialized_end=2514 - _JFCALIBRATION._serialized_start=2517 - _JFCALIBRATION._serialized_end=2695 - _JFCALIBRATIONSTATISTICS._serialized_start=2697 - _JFCALIBRATIONSTATISTICS._serialized_end=2783 - _PLOTREQUEST._serialized_start=2785 - _PLOTREQUEST._serialized_end=2855 - _RADIALINTEGRATIONPROFILE._serialized_start=2857 - _RADIALINTEGRATIONPROFILE._serialized_end=2934 - _RADIALINTEGRATIONPROFILES._serialized_start=2936 - _RADIALINTEGRATIONPROFILES._serialized_end=3023 - _WRITERINPUT._serialized_start=3025 - _WRITERINPUT._serialized_end=3087 - _DATAFILESTATISTICS._serialized_start=3089 - _DATAFILESTATISTICS._serialized_end=3140 - _WRITEROUTPUT._serialized_start=3143 - _WRITEROUTPUT._serialized_end=3284 - _DETECTORMODULECONFIG._serialized_start=3287 - _DETECTORMODULECONFIG._serialized_end=3545 - _DETECTORCONFIG._serialized_start=3547 - _DETECTORCONFIG._serialized_end=3672 - _DETECTORINPUT._serialized_start=3675 - _DETECTORINPUT._serialized_end=3927 - _DETECTOROUTPUT._serialized_start=3929 - _DETECTOROUTPUT._serialized_end=3945 - _DETECTORSTATUS._serialized_start=3947 - _DETECTORSTATUS._serialized_end=4045 - _FPGAFIFOSTATUS._serialized_start=4047 - _FPGAFIFOSTATUS._serialized_end=4128 - _DATAPROCESSINGSETTINGS._serialized_start=4131 - _DATAPROCESSINGSETTINGS._serialized_end=4446 - _MODULESTATISTICS._serialized_start=4449 - _MODULESTATISTICS._serialized_end=4686 - _IMAGE._serialized_start=4688 - _IMAGE._serialized_end=4761 - _MASKTOLOAD._serialized_start=4763 - _MASKTOLOAD._serialized_end=4809 - _MEASUREMENTSTATISTICS._serialized_start=4812 - _MEASUREMENTSTATISTICS._serialized_end=5141 - _BROKERSTATUS._serialized_start=5144 - _BROKERSTATUS._serialized_end=5281 - _DETECTORLISTELEMENT._serialized_start=5283 - _DETECTORLISTELEMENT._serialized_end=5355 - _DETECTORLIST._serialized_start=5357 - _DETECTORLIST._serialized_end=5475 - _DETECTORSELECTION._serialized_start=5477 - _DETECTORSELECTION._serialized_end=5508 - _GRPC_JFJOCHWRITER._serialized_start=6041 - _GRPC_JFJOCHWRITER._serialized_end=6243 - _GRPC_JFJOCHDETECTOR._serialized_start=6246 - _GRPC_JFJOCHDETECTOR._serialized_end=6632 - _GRPC_JFJOCHBROKER._serialized_start=6635 - _GRPC_JFJOCHBROKER._serialized_end=8255 + _MODULESTATISTICS._serialized_start=2438 + _MODULESTATISTICS._serialized_end=2675 + _JFCALIBRATIONSTATISTICS._serialized_start=2677 + _JFCALIBRATIONSTATISTICS._serialized_end=2763 + _PLOTREQUEST._serialized_start=2765 + _PLOTREQUEST._serialized_end=2835 + _RADIALINTEGRATIONPROFILE._serialized_start=2837 + _RADIALINTEGRATIONPROFILE._serialized_end=2914 + _RADIALINTEGRATIONPROFILES._serialized_start=2916 + _RADIALINTEGRATIONPROFILES._serialized_end=3003 + _WRITERINPUT._serialized_start=3005 + _WRITERINPUT._serialized_end=3067 + _DATAFILESTATISTICS._serialized_start=3069 + _DATAFILESTATISTICS._serialized_end=3120 + _WRITEROUTPUT._serialized_start=3123 + _WRITEROUTPUT._serialized_end=3264 + _DETECTORMODULECONFIG._serialized_start=3267 + _DETECTORMODULECONFIG._serialized_end=3525 + _DETECTORCONFIG._serialized_start=3527 + _DETECTORCONFIG._serialized_end=3652 + _DETECTORINPUT._serialized_start=3655 + _DETECTORINPUT._serialized_end=3907 + _DETECTOROUTPUT._serialized_start=3909 + _DETECTOROUTPUT._serialized_end=3925 + _DETECTORSTATUS._serialized_start=3927 + _DETECTORSTATUS._serialized_end=4025 + _FPGAFIFOSTATUS._serialized_start=4027 + _FPGAFIFOSTATUS._serialized_end=4108 + _DATAPROCESSINGSETTINGS._serialized_start=4111 + _DATAPROCESSINGSETTINGS._serialized_end=4426 + _IMAGE._serialized_start=4428 + _IMAGE._serialized_end=4501 + _MASKTOLOAD._serialized_start=4503 + _MASKTOLOAD._serialized_end=4549 + _MEASUREMENTSTATISTICS._serialized_start=4552 + _MEASUREMENTSTATISTICS._serialized_end=4881 + _BROKERSTATUS._serialized_start=4884 + _BROKERSTATUS._serialized_end=5021 + _DETECTORLISTELEMENT._serialized_start=5023 + _DETECTORLISTELEMENT._serialized_end=5095 + _DETECTORLIST._serialized_start=5097 + _DETECTORLIST._serialized_end=5215 + _DETECTORSELECTION._serialized_start=5217 + _DETECTORSELECTION._serialized_end=5248 + _GRPC_JFJOCHWRITER._serialized_start=5781 + _GRPC_JFJOCHWRITER._serialized_end=5983 + _GRPC_JFJOCHDETECTOR._serialized_start=5986 + _GRPC_JFJOCHDETECTOR._serialized_end=6372 + _GRPC_JFJOCHBROKER._serialized_start=6375 + _GRPC_JFJOCHBROKER._serialized_end=7995 # @@protoc_insertion_point(module_scope) diff --git a/tests/JFCalibrationTest.cpp b/tests/JFCalibrationTest.cpp index 5fcc7699..57b618b0 100644 --- a/tests/JFCalibrationTest.cpp +++ b/tests/JFCalibrationTest.cpp @@ -28,22 +28,22 @@ TEST_CASE("JFCalibration_GainStatistics","[JFCalibration]") { auto s = calibration.GetModuleStatistics(); - REQUIRE(s.module_statistics_size() == 4); + REQUIRE(s.size() == 4); - REQUIRE(s.module_statistics(0).gain_g0_mean() == Approx(35.0)); - REQUIRE(s.module_statistics(1).gain_g0_mean() == Approx(36.0)); - REQUIRE(s.module_statistics(2).gain_g0_mean() == Approx(37.0)); - REQUIRE(s.module_statistics(3).gain_g0_mean() == Approx(38.0)); + REQUIRE(s[0].gain_g0_mean == Approx(35.0)); + REQUIRE(s[1].gain_g0_mean == Approx(36.0)); + REQUIRE(s[2].gain_g0_mean == Approx(37.0)); + REQUIRE(s[3].gain_g0_mean == Approx(38.0)); - REQUIRE(s.module_statistics(0).gain_g1_mean() == Approx(-56)); - REQUIRE(s.module_statistics(1).gain_g1_mean() == Approx(-55)); - REQUIRE(s.module_statistics(2).gain_g1_mean() == Approx(-54)); - REQUIRE(s.module_statistics(3).gain_g1_mean() == Approx(-53)); + REQUIRE(s[0].gain_g1_mean == Approx(-56)); + REQUIRE(s[1].gain_g1_mean == Approx(-55)); + REQUIRE(s[2].gain_g1_mean == Approx(-54)); + REQUIRE(s[3].gain_g1_mean == Approx(-53)); - REQUIRE(s.module_statistics(0).gain_g2_mean() == Approx(0/32.)); - REQUIRE(s.module_statistics(1).gain_g2_mean() == Approx(1/32.)); - REQUIRE(s.module_statistics(2).gain_g2_mean() == Approx(2/32.)); - REQUIRE(s.module_statistics(3).gain_g2_mean() == Approx(3/32.)); + REQUIRE(s[0].gain_g2_mean == Approx(0/32.)); + REQUIRE(s[1].gain_g2_mean == Approx(1/32.)); + REQUIRE(s[2].gain_g2_mean == Approx(2/32.)); + REQUIRE(s[3].gain_g2_mean == Approx(3/32.)); } TEST_CASE("JFCalibration_PedestalAndMaskStatistics","[JFCalibration]") { @@ -72,33 +72,33 @@ TEST_CASE("JFCalibration_PedestalAndMaskStatistics","[JFCalibration]") { auto s1 = calibration.GetModuleStatistics(1); - REQUIRE(s1.module_statistics(0).pedestal_g0_mean() == Approx(1000)); - REQUIRE(s1.module_statistics(0).pedestal_g1_mean() == Approx(2000)); - REQUIRE(s1.module_statistics(0).pedestal_g2_mean() == Approx(3000)); + REQUIRE(s1[0].pedestal_g0_mean == Approx(1000)); + REQUIRE(s1[0].pedestal_g1_mean == Approx(2000)); + REQUIRE(s1[0].pedestal_g2_mean == Approx(3000)); - REQUIRE(s1.module_statistics(1).pedestal_g0_mean() == Approx(2000)); - REQUIRE(s1.module_statistics(1).pedestal_g1_mean() == Approx(4000)); - REQUIRE(s1.module_statistics(1).pedestal_g2_mean() == Approx(6000)); + REQUIRE(s1[1].pedestal_g0_mean == Approx(2000)); + REQUIRE(s1[1].pedestal_g1_mean == Approx(4000)); + REQUIRE(s1[1].pedestal_g2_mean == Approx(6000)); - REQUIRE(s1.module_statistics(2).pedestal_g0_mean() == Approx(3000)); - REQUIRE(s1.module_statistics(2).pedestal_g1_mean() == Approx(6000)); - REQUIRE(s1.module_statistics(2).pedestal_g2_mean() == Approx(9000)); + REQUIRE(s1[2].pedestal_g0_mean == Approx(3000)); + REQUIRE(s1[2].pedestal_g1_mean == Approx(6000)); + REQUIRE(s1[2].pedestal_g2_mean == Approx(9000)); - REQUIRE(s1.module_statistics(0).masked_pixels() == 1); - REQUIRE(s1.module_statistics(1).masked_pixels() == 3); - REQUIRE(s1.module_statistics(2).masked_pixels() == 0); - REQUIRE(s1.module_statistics(3).masked_pixels() == 5); + REQUIRE(s1[0].masked_pixels == 1); + REQUIRE(s1[1].masked_pixels == 3); + REQUIRE(s1[2].masked_pixels == 0); + REQUIRE(s1[3].masked_pixels == 5); auto s0 = calibration.GetModuleStatistics(0); - REQUIRE(s0.module_statistics(0).pedestal_g0_mean() == 0); - REQUIRE(s0.module_statistics(0).pedestal_g1_mean() == 0); - REQUIRE(s0.module_statistics(0).pedestal_g2_mean() == 0); + REQUIRE(s0[0].pedestal_g0_mean == 0); + REQUIRE(s0[0].pedestal_g1_mean == 0); + REQUIRE(s0[0].pedestal_g2_mean == 0); - REQUIRE(s0.module_statistics(0).masked_pixels() == 1); - REQUIRE(s0.module_statistics(1).masked_pixels() == 3); - REQUIRE(s0.module_statistics(2).masked_pixels() == 0); - REQUIRE(s0.module_statistics(3).masked_pixels() == 2); + REQUIRE(s0[0].masked_pixels == 1); + REQUIRE(s0[1].masked_pixels == 3); + REQUIRE(s0[2].masked_pixels == 0); + REQUIRE(s0[3].masked_pixels == 2); } TEST_CASE("JFCalibration_Statistics_All","[JFCalibration]") { @@ -127,38 +127,38 @@ TEST_CASE("JFCalibration_Statistics_All","[JFCalibration]") { auto s0 = calibration.GetModuleStatistics(); - REQUIRE(s0.module_statistics(0).module_number() == 0); - REQUIRE(s0.module_statistics(0).storage_cell_number() == 0); - REQUIRE(s0.module_statistics(5).module_number() == 1); - REQUIRE(s0.module_statistics(5).storage_cell_number() == 1); - REQUIRE(s0.module_statistics(7).module_number() == 3); - REQUIRE(s0.module_statistics(7).storage_cell_number() == 1); + REQUIRE(s0[0].module_number == 0); + REQUIRE(s0[0].storage_cell_number == 0); + REQUIRE(s0[5].module_number == 1); + REQUIRE(s0[5].storage_cell_number == 1); + REQUIRE(s0[7].module_number == 3); + REQUIRE(s0[7].storage_cell_number == 1); - REQUIRE(s0.module_statistics(0).pedestal_g0_mean() == 0); - REQUIRE(s0.module_statistics(0).pedestal_g1_mean() == 0); - REQUIRE(s0.module_statistics(0).pedestal_g2_mean() == 0); + REQUIRE(s0[0].pedestal_g0_mean == 0); + REQUIRE(s0[0].pedestal_g1_mean == 0); + REQUIRE(s0[0].pedestal_g2_mean == 0); - REQUIRE(s0.module_statistics(0).masked_pixels() == 1); - REQUIRE(s0.module_statistics(1).masked_pixels() == 3); - REQUIRE(s0.module_statistics(2).masked_pixels() == 0); - REQUIRE(s0.module_statistics(3).masked_pixels() == 2); + REQUIRE(s0[0].masked_pixels == 1); + REQUIRE(s0[1].masked_pixels == 3); + REQUIRE(s0[2].masked_pixels == 0); + REQUIRE(s0[3].masked_pixels == 2); - REQUIRE(s0.module_statistics(4).pedestal_g0_mean() == Approx(1000)); - REQUIRE(s0.module_statistics(4).pedestal_g1_mean() == Approx(2000)); - REQUIRE(s0.module_statistics(4).pedestal_g2_mean() == Approx(3000)); + REQUIRE(s0[4].pedestal_g0_mean == Approx(1000)); + REQUIRE(s0[4].pedestal_g1_mean == Approx(2000)); + REQUIRE(s0[4].pedestal_g2_mean == Approx(3000)); - REQUIRE(s0.module_statistics(5).pedestal_g0_mean() == Approx(2000)); - REQUIRE(s0.module_statistics(5).pedestal_g1_mean() == Approx(4000)); - REQUIRE(s0.module_statistics(5).pedestal_g2_mean() == Approx(6000)); + REQUIRE(s0[5].pedestal_g0_mean == Approx(2000)); + REQUIRE(s0[5].pedestal_g1_mean == Approx(4000)); + REQUIRE(s0[5].pedestal_g2_mean == Approx(6000)); - REQUIRE(s0.module_statistics(6).pedestal_g0_mean() == Approx(3000)); - REQUIRE(s0.module_statistics(6).pedestal_g1_mean() == Approx(6000)); - REQUIRE(s0.module_statistics(6).pedestal_g2_mean() == Approx(9000)); + REQUIRE(s0[6].pedestal_g0_mean == Approx(3000)); + REQUIRE(s0[6].pedestal_g1_mean == Approx(6000)); + REQUIRE(s0[6].pedestal_g2_mean == Approx(9000)); - REQUIRE(s0.module_statistics(4).masked_pixels() == 1); - REQUIRE(s0.module_statistics(5).masked_pixels() == 3); - REQUIRE(s0.module_statistics(6).masked_pixels() == 0); - REQUIRE(s0.module_statistics(7).masked_pixels() == 5); + REQUIRE(s0[4].masked_pixels == 1); + REQUIRE(s0[5].masked_pixels == 3); + REQUIRE(s0[6].masked_pixels == 0); + REQUIRE(s0[7].masked_pixels == 5); } TEST_CASE("JFCalibration_MaskModuleEdges","[JFCalibration]") { @@ -331,87 +331,6 @@ TEST_CASE("JFCalibration_MaskDetectorGaps","[JFCalibration]") { REQUIRE(mask_export[(1030*2+8)*(514*3+36*2+12) + 566] == 1); } -TEST_CASE("JFCalibration_Serialize","[ProtoBuf][JFCalibration]") { - uint16_t nmodules = 2; - uint16_t nstorage_cells = 2; - - DiffractionExperiment experiment(DetectorGeometry(1)); - - experiment.PhotonEnergy_keV(WVL_1A_IN_KEV); - - JFCalibration calibration(nmodules, nstorage_cells); - - // Predictable random number generator - std::mt19937 g1(1576223); - std::normal_distribution distribution(12000, 100); - std::uniform_int_distribution mask_distribution; - - for (int m = 0; m < nmodules; m++) { - std::vector tmp(3 * RAW_MODULE_SIZE); - for (auto &i: tmp) - i = distribution(g1); - calibration.GainCalibration(m) = JFModuleGainCalibration(tmp); - - for (int s = 0; s < nstorage_cells; s++) { - for (int g = 0; g < 2; g++) { - auto tmp1 = calibration.Pedestal(m, g, s).GetPedestal(); - auto tmp2 = calibration.Pedestal(m, g, s).GetPedestalMask(); - for (int i = 0; i < RAW_MODULE_SIZE; i++) { - tmp1[i] = static_cast(distribution(g1)); - tmp2[i] = static_cast(mask_distribution(g1)); - } - calibration.Pedestal(m, g, s).SetCollectionTime(m * s + 2 * g); - calibration.Pedestal(m, g, s).SetFrameCount(m + s * g); - } - } - } - - for (int i = 0; i < RAW_MODULE_SIZE * nmodules; i++) - calibration.Mask(i) = i % 65534; - - JFJochProtoBuf::JFCalibration serialized = calibration; - - JFCalibration deserialized(serialized); - REQUIRE(deserialized.GetStorageCellNum() == nstorage_cells); - REQUIRE(deserialized.GetModulesNum() == nmodules); - - uint64_t diff_pedestal = 0, diff_pedestal_mask = 0, diff_pedestal_coll_time = 0, - diff_pedestal_frames = 0, diff_mask = 0, diff_gain = 0; - - for (int m = 0; m < nmodules; m++) { - auto gain_calib1 = calibration.GainCalibration(m).GetGainCalibration(); - auto gain_calib2 = deserialized.GainCalibration(m).GetGainCalibration(); - for (int i = 0; i < 3 * RAW_MODULE_SIZE; i++) { - if (gain_calib1[i] != gain_calib2[i]) diff_gain++; - } - - for (int s = 0; s < nstorage_cells; s++) { - for (int g = 0; g < 2; g++) { - for (int i = 0; i < RAW_MODULE_SIZE; i++) { - if (calibration.Pedestal(m, g, s).GetPedestal()[i] != deserialized.Pedestal(m, g, s).GetPedestal()[i]) - diff_pedestal++; - if (calibration.Pedestal(m, g, s).GetPedestalMask()[i] != deserialized.Pedestal(m, g, s).GetPedestalMask()[i]) - diff_pedestal_mask++; - } - if (calibration.Pedestal(m, g, s).GetCollectionTime() != deserialized.Pedestal(m, g, s).GetCollectionTime()) - diff_pedestal_coll_time++; - if (calibration.Pedestal(m, g, s).GetFrameCount() != deserialized.Pedestal(m, g, s).GetFrameCount()) - diff_pedestal_frames++; - } - } - } - - for (int i = 0; i < RAW_MODULE_SIZE * nmodules; i++) - if (calibration.Mask(i) != deserialized.Mask(i)) diff_mask++; - - REQUIRE(diff_gain == 0); - REQUIRE(diff_pedestal == 0); - REQUIRE(diff_pedestal_mask == 0); - REQUIRE(diff_pedestal_coll_time == 0); - REQUIRE(diff_pedestal_frames == 0); - REQUIRE(diff_mask == 0); -} - TEST_CASE("JFCalibration_GetPedestal","[JFCalibration]") { JFCalibration calibration(4, 2); diff --git a/tests/JFJochBrokerTest.cpp b/tests/JFJochBrokerTest.cpp index 9a600c72..11184430 100644 --- a/tests/JFJochBrokerTest.cpp +++ b/tests/JFJochBrokerTest.cpp @@ -199,10 +199,6 @@ TEST_CASE("JFJochStateMachine_StorageCells") { REQUIRE_NOTHROW(state_machine.SetDetectorSettings(settings)); REQUIRE(state_machine.NotThreadSafe_Experiment().GetStorageCellNumber() == 16); REQUIRE_NOTHROW(state_machine.Initialize()); - - JFJochProtoBuf::JFCalibration calibration_pbuf; - REQUIRE_NOTHROW(calibration_pbuf = state_machine.GetCalibration()); - REQUIRE(calibration_pbuf.nstorage_cells() == 16); } TEST_CASE("JFJochStateMachine_AddDetectorSetup_Multiple") { diff --git a/tests/JFPedestalTest.cpp b/tests/JFPedestalTest.cpp index 0c5a36e3..bd46c042 100644 --- a/tests/JFPedestalTest.cpp +++ b/tests/JFPedestalTest.cpp @@ -5,39 +5,6 @@ #include "../jungfrau/JFModulePedestal.h" -TEST_CASE("JFPedestal_Serialize","[ProtoBuf][JFModulePedestal]") { - // Predictable random number generator - std::mt19937 g1(1576); - std::normal_distribution distribution(12000, 100); - - JFModulePedestal pedestal; - for (int i = 0; i < RAW_MODULE_SIZE; i++) { - pedestal.GetPedestal()[i] = static_cast(distribution(g1)); - pedestal.GetPedestalMask()[i] = static_cast(i % UINT8_MAX); - } - - pedestal.SetCollectionTime(3456); - pedestal.SetFrameCount(5000); - - JFJochProtoBuf::JFPedestal serialized = pedestal; - JFModulePedestal deserialized = serialized; - - size_t diff = 0, diff_rms = 0, diff_mask = 0; - for (int i = 0; i < RAW_MODULE_SIZE; i++) { - if (pedestal.GetPedestal()[i] != deserialized.GetPedestal()[i]) - diff++; - if (pedestal.GetPedestalMask()[i] != deserialized.GetPedestalMask()[i]) - diff_mask++; - - } - REQUIRE(diff == 0); - REQUIRE(diff_rms == 0); - REQUIRE(diff_mask == 0); - - REQUIRE(deserialized.GetCollectionTime() == pedestal.GetCollectionTime()); - REQUIRE(deserialized.GetFrameCount() == pedestal.GetFrameCount()); -} - TEST_CASE("JFPedestal_Mean","[JFModulePedestal]") { JFModulePedestal pedestal; auto pedestal_arr = pedestal.GetPedestal();