JFJochReceiver: Transfer all radial integration profiles in one ProtoBuf
This commit is contained in:
1 parent
5b49971dd7
commit
e5739f5408
17 files changed
+324
-79
No files matched your search
@@ -54,6 +54,11 @@ grpc::Status JFJochBroker::GetPlots(grpc::ServerContext *context, const JFJochPr
|
||||
GRPC_RUN( *response = state_machine.GetPlots(*request) );
|
||||
}
|
||||
|
||||
grpc::Status JFJochBroker::GetRadialIntegrationProfiles(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::RadialIntegrationProfiles *response) {
|
||||
GRPC_RUN( *response = state_machine.GetRadialIntegrationProfiles() );
|
||||
}
|
||||
|
||||
grpc::Status JFJochBroker::GetPreview(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::PreviewFrame *response) {
|
||||
GRPC_RUN( *response = services.GetPreviewFrame() );
|
||||
|
||||
@@ -44,6 +44,9 @@ public:
|
||||
grpc::Status GetPlots(grpc::ServerContext *context, const JFJochProtoBuf::PlotRequest *request,
|
||||
JFJochProtoBuf::Plot *response) override;
|
||||
|
||||
grpc::Status GetRadialIntegrationProfiles(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::RadialIntegrationProfiles *response) override;
|
||||
|
||||
grpc::Status GetPreview(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::PreviewFrame *response) override;
|
||||
|
||||
|
||||
@@ -151,6 +151,14 @@ JFJochProtoBuf::Plot JFJochServices::GetPlots(const JFJochProtoBuf::PlotRequest
|
||||
}
|
||||
}
|
||||
|
||||
JFJochProtoBuf::RadialIntegrationProfiles JFJochServices::GetRadialIntegrationProfiles() {
|
||||
try {
|
||||
return receiver.GetRadialIntegrationProfiles();
|
||||
} catch (...) {
|
||||
return JFJochProtoBuf::RadialIntegrationProfiles();
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochServices::SetDataProcessingSettings(const JFJochProtoBuf::DataProcessingSettings &settings) {
|
||||
receiver.SetDataProcessingSettings(settings);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
JFJochProtoBuf::ReceiverStatus GetReceiverStatus();
|
||||
JFJochProtoBuf::PreviewFrame GetPreviewFrame();
|
||||
JFJochProtoBuf::Plot GetPlots(const JFJochProtoBuf::PlotRequest &request);
|
||||
JFJochProtoBuf::RadialIntegrationProfiles GetRadialIntegrationProfiles();
|
||||
|
||||
void SetDataProcessingSettings(const JFJochProtoBuf::DataProcessingSettings &settings);
|
||||
JFJochServices& Receiver(const std::string &addr);
|
||||
|
||||
@@ -501,6 +501,10 @@ JFJochProtoBuf::Plot JFJochStateMachine::GetPlots(const JFJochProtoBuf::PlotRequ
|
||||
return services.GetPlots(request);
|
||||
}
|
||||
|
||||
JFJochProtoBuf::RadialIntegrationProfiles JFJochStateMachine::GetRadialIntegrationProfiles() const {
|
||||
return services.GetRadialIntegrationProfiles();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetDataProcessingSettings(const JFJochProtoBuf::DataProcessingSettings &settings) {
|
||||
std::unique_lock<std::mutex> ul(data_processing_settings_mutex);
|
||||
DiffractionExperiment::CheckDataProcessingSettings(settings);
|
||||
|
||||
@@ -85,6 +85,7 @@ public:
|
||||
|
||||
JFJochProtoBuf::BrokerStatus GetStatus() const;
|
||||
JFJochProtoBuf::Plot GetPlots(const JFJochProtoBuf::PlotRequest &request) const;
|
||||
JFJochProtoBuf::RadialIntegrationProfiles GetRadialIntegrationProfiles() const;
|
||||
|
||||
JFJochProtoBuf::Image GetNeXusMask() const;
|
||||
JFJochProtoBuf::Image GetPedestalG0() const;
|
||||
|
||||
@@ -143,4 +143,19 @@ JFJochProtoBuf::Plot JFJochReceiverClient::GetPlots(const JFJochProtoBuf::PlotRe
|
||||
// TODO: Write some dummy plots
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
JFJochProtoBuf::RadialIntegrationProfiles JFJochReceiverClient::GetRadialIntegrationProfiles() {
|
||||
JFJochProtoBuf::RadialIntegrationProfiles ret;
|
||||
if (_stub) {
|
||||
grpc::ClientContext context;
|
||||
JFJochProtoBuf::Empty empty;
|
||||
auto status = _stub->GetRadialIntegrationProfiles(&context, empty, &ret);
|
||||
if (!status.ok()) throw JFJochException(JFJochExceptionCategory::gRPCError,
|
||||
"JFJochReceiver: " + status.error_message());
|
||||
} else {
|
||||
// TODO: Write some dummy plots
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public:
|
||||
JFJochProtoBuf::PreviewFrame GetPreviewFrame();
|
||||
JFJochProtoBuf::ReceiverNetworkConfig GetNetworkConfig();
|
||||
JFJochProtoBuf::Plot GetPlots(const JFJochProtoBuf::PlotRequest& request);
|
||||
JFJochProtoBuf::RadialIntegrationProfiles GetRadialIntegrationProfiles();
|
||||
};
|
||||
|
||||
|
||||
|
||||
+5
-9
@@ -275,11 +275,9 @@ message PlotRequest {
|
||||
optional uint64 file_number = 3;
|
||||
}
|
||||
|
||||
message ReceiverDataProcessingPlots {
|
||||
Plot bkg_estimate = 1;
|
||||
Plot radial_int_profile = 2;
|
||||
Plot spot_count = 3;
|
||||
Plot indexing_rate = 4;
|
||||
message RadialIntegrationProfiles {
|
||||
repeated Plot file_plots = 1;
|
||||
Plot total = 2;
|
||||
}
|
||||
|
||||
// Writer
|
||||
@@ -384,10 +382,6 @@ message FPGAStatus {
|
||||
uint32 error_packet_len = 39;
|
||||
}
|
||||
|
||||
message IndexerDataProcessingPlots {
|
||||
Plot indexing_rate = 1;
|
||||
}
|
||||
|
||||
message DataProcessingSettings {
|
||||
float signal_to_noise_threshold = 1; // STRONG_PIXEL in XDS
|
||||
int64 photon_count_threshold = 2; // Threshold in photon counts
|
||||
@@ -505,6 +499,7 @@ service gRPC_JFJochReceiver {
|
||||
rpc GetStatus (Empty) returns (ReceiverStatus) {}
|
||||
rpc SetDataProcessingSettings(DataProcessingSettings) returns (Empty) {}
|
||||
rpc GetDataProcessingPlots(PlotRequest) returns (Plot) {}
|
||||
rpc GetRadialIntegrationProfiles(Empty) returns (RadialIntegrationProfiles) {}
|
||||
rpc GetPreviewFrame (Empty) returns (PreviewFrame) {}
|
||||
rpc GetNetworkConfig (Empty) returns (ReceiverNetworkConfig) {}
|
||||
}
|
||||
@@ -541,6 +536,7 @@ service gRPC_JFJochBroker {
|
||||
rpc GetDataProcessingSettings (Empty) returns (DataProcessingSettings) {}
|
||||
rpc PutDataProcessingSettings (DataProcessingSettings) returns (Empty) {}
|
||||
rpc GetPlots (PlotRequest) returns (Plot) {}
|
||||
rpc GetRadialIntegrationProfiles(Empty) returns (RadialIntegrationProfiles) {}
|
||||
|
||||
rpc GetPreview (Empty) returns (PreviewFrame) {}
|
||||
rpc GetPedestalG0 (Empty) returns (Image) {}
|
||||
|
||||
@@ -199,6 +199,17 @@ async def get_settings(request: Request):
|
||||
raise HTTPException(status_code=400, detail=e.details())
|
||||
|
||||
|
||||
@app.post("/data_processing/rad_int_profiles")
|
||||
async def get_settings():
|
||||
try:
|
||||
stub = jfjoch_pb2_grpc.gRPC_JFJochBrokerStub(channel)
|
||||
return MessageToDict(
|
||||
stub.GetRadialIntegrationProfiles(jfjoch_pb2.Empty()), including_default_value_fields=True
|
||||
)
|
||||
except grpc.RpcError as e:
|
||||
raise HTTPException(status_code=400, detail=e.details())
|
||||
|
||||
|
||||
@app.get("/detector/measurement_statistics")
|
||||
async def get_meas_stats():
|
||||
try:
|
||||
|
||||
+65
-67
@@ -13,7 +13,7 @@ _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\"\xc7\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12\x13\n\tsummation\x18\x03 \x01(\x03H\x00\x12\x17\n\rimage_time_us\x18\x04 \x01(\x03H\x00\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\x30\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCellH\x01\x88\x01\x01\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12\x36\n\x11scattering_vector\x18\x0f \x01(\x0b\x32\x16.JFJochProtoBuf.VectorH\x02\x88\x01\x01\x12\x18\n\x10\x61pply_pixel_mask\x18\x10 \x01(\x08\x12\x12\n\nbinning2x2\x18\x11 \x01(\x08\x12 \n\x18rad_int_solid_angle_corr\x18\x12 \x01(\x08\x42\x08\n\x06timingB\x0c\n\n_unit_cellB\x14\n\x12_scattering_vector\"\xf7\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x1a\n\rcount_time_us\x18\x02 \x01(\x03H\x00\x88\x01\x01\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\x1f\n\x12pedestal_g0_frames\x18\x06 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\x12pedestal_g1_frames\x18\x07 \x01(\x03H\x02\x88\x01\x01\x12\x1f\n\x12pedestal_g2_frames\x18\x08 \x01(\x03H\x03\x88\x01\x01\x12\x19\n\x11\x63onversion_on_cpu\x18\t \x01(\x08\x42\x10\n\x0e_count_time_usB\x15\n\x13_pedestal_g0_framesB\x15\n\x13_pedestal_g1_framesB\x15\n\x13_pedestal_g2_frames\"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\"\xc1\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*\n\x04type\x18\x06 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorType\"\xe1\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\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\x1e\n\x16spot_finding_period_us\x18\x10 \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\x19\n\x11\x63onversion_on_cpu\x18\x1f \x01(\x08\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\"|\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\x3Line truncated
|
||||
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\"\xc7\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12\x13\n\tsummation\x18\x03 \x01(\x03H\x00\x12\x17\n\rimage_time_us\x18\x04 \x01(\x03H\x00\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\x30\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCellH\x01\x88\x01\x01\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12\x36\n\x11scattering_vector\x18\x0f \x01(\x0b\x32\x16.JFJochProtoBuf.VectorH\x02\x88\x01\x01\x12\x18\n\x10\x61pply_pixel_mask\x18\x10 \x01(\x08\x12\x12\n\nbinning2x2\x18\x11 \x01(\x08\x12 \n\x18rad_int_solid_angle_corr\x18\x12 \x01(\x08\x42\x08\n\x06timingB\x0c\n\n_unit_cellB\x14\n\x12_scattering_vector\"\xf7\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x1a\n\rcount_time_us\x18\x02 \x01(\x03H\x00\x88\x01\x01\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\x1f\n\x12pedestal_g0_frames\x18\x06 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\x12pedestal_g1_frames\x18\x07 \x01(\x03H\x02\x88\x01\x01\x12\x1f\n\x12pedestal_g2_frames\x18\x08 \x01(\x03H\x03\x88\x01\x01\x12\x19\n\x11\x63onversion_on_cpu\x18\t \x01(\x08\x42\x10\n\x0e_count_time_usB\x15\n\x13_pedestal_g0_framesB\x15\n\x13_pedestal_g1_framesB\x15\n\x13_pedestal_g2_frames\"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\"\xc1\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*\n\x04type\x18\x06 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorType\"\xe1\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\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\x1e\n\x16spot_finding_period_us\x18\x10 \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\x19\n\x11\x63onversion_on_cpu\x18\x1f \x01(\x08\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\"|\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\x3Line truncated
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'jfjoch_pb2', globals())
|
||||
@@ -22,18 +22,18 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
DESCRIPTOR._options = None
|
||||
_FPGASTATUS_FIFOSTATUSENTRY._options = None
|
||||
_FPGASTATUS_FIFOSTATUSENTRY._serialized_options = b'8\001'
|
||||
_COMPRESSION._serialized_start=8782
|
||||
_COMPRESSION._serialized_end=8866
|
||||
_DETECTORTYPE._serialized_start=8868
|
||||
_DETECTORTYPE._serialized_end=8907
|
||||
_DETECTORMODE._serialized_start=8909
|
||||
_DETECTORMODE._serialized_end=8999
|
||||
_FPGAFIFOSTATUS._serialized_start=9001
|
||||
_FPGAFIFOSTATUS._serialized_end=9051
|
||||
_STATE._serialized_start=9053
|
||||
_STATE._serialized_end=9147
|
||||
_PLOTTYPE._serialized_start=9149
|
||||
_PLOTTYPE._serialized_end=9225
|
||||
_COMPRESSION._serialized_start=8602
|
||||
_COMPRESSION._serialized_end=8686
|
||||
_DETECTORTYPE._serialized_start=8688
|
||||
_DETECTORTYPE._serialized_end=8727
|
||||
_DETECTORMODE._serialized_start=8729
|
||||
_DETECTORMODE._serialized_end=8819
|
||||
_FPGAFIFOSTATUS._serialized_start=8821
|
||||
_FPGAFIFOSTATUS._serialized_end=8871
|
||||
_STATE._serialized_start=8873
|
||||
_STATE._serialized_end=8967
|
||||
_PLOTTYPE._serialized_start=8969
|
||||
_PLOTTYPE._serialized_end=9045
|
||||
_EMPTY._serialized_start=32
|
||||
_EMPTY._serialized_end=39
|
||||
_UNITCELL._serialized_start=41
|
||||
@@ -80,58 +80,56 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
_RECEIVERSTATUS._serialized_end=4147
|
||||
_PLOTREQUEST._serialized_start=4149
|
||||
_PLOTREQUEST._serialized_end=4261
|
||||
_RECEIVERDATAPROCESSINGPLOTS._serialized_start=4264
|
||||
_RECEIVERDATAPROCESSINGPLOTS._serialized_end=4474
|
||||
_WRITERINPUT._serialized_start=4476
|
||||
_WRITERINPUT._serialized_end=4538
|
||||
_DATAFILESTATISTICS._serialized_start=4540
|
||||
_DATAFILESTATISTICS._serialized_end=4591
|
||||
_WRITEROUTPUT._serialized_start=4594
|
||||
_WRITEROUTPUT._serialized_end=4735
|
||||
_DETECTORMODULECONFIG._serialized_start=4738
|
||||
_DETECTORMODULECONFIG._serialized_end=4996
|
||||
_DETECTORCONFIG._serialized_start=4998
|
||||
_DETECTORCONFIG._serialized_end=5094
|
||||
_DETECTORINPUT._serialized_start=5097
|
||||
_DETECTORINPUT._serialized_end=5346
|
||||
_DETECTOROUTPUT._serialized_start=5348
|
||||
_DETECTOROUTPUT._serialized_end=5364
|
||||
_DETECTORSTATUS._serialized_start=5366
|
||||
_DETECTORSTATUS._serialized_end=5464
|
||||
_FPGASTATUS._serialized_start=5467
|
||||
_FPGASTATUS._serialized_end=6537
|
||||
_FPGASTATUS_FIFOSTATUSENTRY._serialized_start=6456
|
||||
_FPGASTATUS_FIFOSTATUSENTRY._serialized_end=6537
|
||||
_INDEXERDATAPROCESSINGPLOTS._serialized_start=6539
|
||||
_INDEXERDATAPROCESSINGPLOTS._serialized_end=6612
|
||||
_DATAPROCESSINGSETTINGS._serialized_start=6615
|
||||
_DATAPROCESSINGSETTINGS._serialized_end=6961
|
||||
_PREVIEWFRAME._serialized_start=6964
|
||||
_PREVIEWFRAME._serialized_end=7233
|
||||
_MODULESTATISTICS._serialized_start=7236
|
||||
_MODULESTATISTICS._serialized_end=7473
|
||||
_IMAGE._serialized_start=7475
|
||||
_IMAGE._serialized_end=7548
|
||||
_MASKTOLOAD._serialized_start=7550
|
||||
_MASKTOLOAD._serialized_end=7596
|
||||
_MEASUREMENTSTATISTICS._serialized_start=7599
|
||||
_MEASUREMENTSTATISTICS._serialized_end=8168
|
||||
_BROKERSTATUS._serialized_start=8171
|
||||
_BROKERSTATUS._serialized_end=8386
|
||||
_BROKERFULLSTATUS._serialized_start=8389
|
||||
_BROKERFULLSTATUS._serialized_end=8553
|
||||
_DETECTORLISTELEMENT._serialized_start=8555
|
||||
_DETECTORLISTELEMENT._serialized_end=8627
|
||||
_DETECTORLIST._serialized_start=8629
|
||||
_DETECTORLIST._serialized_end=8747
|
||||
_DETECTORSELECTION._serialized_start=8749
|
||||
_DETECTORSELECTION._serialized_end=8780
|
||||
_GRPC_JFJOCHRECEIVER._serialized_start=9228
|
||||
_GRPC_JFJOCHRECEIVER._serialized_end=9895
|
||||
_GRPC_JFJOCHWRITER._serialized_start=9898
|
||||
_GRPC_JFJOCHWRITER._serialized_end=10100
|
||||
_GRPC_JFJOCHDETECTOR._serialized_start=10103
|
||||
_GRPC_JFJOCHDETECTOR._serialized_end=10489
|
||||
_GRPC_JFJOCHBROKER._serialized_start=10492
|
||||
_GRPC_JFJOCHBROKER._serialized_end=12081
|
||||
_RADIALINTEGRATIONPROFILES._serialized_start=4263
|
||||
_RADIALINTEGRATIONPROFILES._serialized_end=4369
|
||||
_WRITERINPUT._serialized_start=4371
|
||||
_WRITERINPUT._serialized_end=4433
|
||||
_DATAFILESTATISTICS._serialized_start=4435
|
||||
_DATAFILESTATISTICS._serialized_end=4486
|
||||
_WRITEROUTPUT._serialized_start=4489
|
||||
_WRITEROUTPUT._serialized_end=4630
|
||||
_DETECTORMODULECONFIG._serialized_start=4633
|
||||
_DETECTORMODULECONFIG._serialized_end=4891
|
||||
_DETECTORCONFIG._serialized_start=4893
|
||||
_DETECTORCONFIG._serialized_end=4989
|
||||
_DETECTORINPUT._serialized_start=4992
|
||||
_DETECTORINPUT._serialized_end=5241
|
||||
_DETECTOROUTPUT._serialized_start=5243
|
||||
_DETECTOROUTPUT._serialized_end=5259
|
||||
_DETECTORSTATUS._serialized_start=5261
|
||||
_DETECTORSTATUS._serialized_end=5359
|
||||
_FPGASTATUS._serialized_start=5362
|
||||
_FPGASTATUS._serialized_end=6432
|
||||
_FPGASTATUS_FIFOSTATUSENTRY._serialized_start=6351
|
||||
_FPGASTATUS_FIFOSTATUSENTRY._serialized_end=6432
|
||||
_DATAPROCESSINGSETTINGS._serialized_start=6435
|
||||
_DATAPROCESSINGSETTINGS._serialized_end=6781
|
||||
_PREVIEWFRAME._serialized_start=6784
|
||||
_PREVIEWFRAME._serialized_end=7053
|
||||
_MODULESTATISTICS._serialized_start=7056
|
||||
_MODULESTATISTICS._serialized_end=7293
|
||||
_IMAGE._serialized_start=7295
|
||||
_IMAGE._serialized_end=7368
|
||||
_MASKTOLOAD._serialized_start=7370
|
||||
_MASKTOLOAD._serialized_end=7416
|
||||
_MEASUREMENTSTATISTICS._serialized_start=7419
|
||||
_MEASUREMENTSTATISTICS._serialized_end=7988
|
||||
_BROKERSTATUS._serialized_start=7991
|
||||
_BROKERSTATUS._serialized_end=8206
|
||||
_BROKERFULLSTATUS._serialized_start=8209
|
||||
_BROKERFULLSTATUS._serialized_end=8373
|
||||
_DETECTORLISTELEMENT._serialized_start=8375
|
||||
_DETECTORLISTELEMENT._serialized_end=8447
|
||||
_DETECTORLIST._serialized_start=8449
|
||||
_DETECTORLIST._serialized_end=8567
|
||||
_DETECTORSELECTION._serialized_start=8569
|
||||
_DETECTORSELECTION._serialized_end=8600
|
||||
_GRPC_JFJOCHRECEIVER._serialized_start=9048
|
||||
_GRPC_JFJOCHRECEIVER._serialized_end=9815
|
||||
_GRPC_JFJOCHWRITER._serialized_start=9818
|
||||
_GRPC_JFJOCHWRITER._serialized_end=10020
|
||||
_GRPC_JFJOCHDETECTOR._serialized_start=10023
|
||||
_GRPC_JFJOCHDETECTOR._serialized_end=10409
|
||||
_GRPC_JFJOCHBROKER._serialized_start=10412
|
||||
_GRPC_JFJOCHBROKER._serialized_end=12101
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -49,6 +49,11 @@ class gRPC_JFJochReceiverStub(object):
|
||||
request_serializer=jfjoch__pb2.PlotRequest.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.Plot.FromString,
|
||||
)
|
||||
self.GetRadialIntegrationProfiles = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochReceiver/GetRadialIntegrationProfiles',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.RadialIntegrationProfiles.FromString,
|
||||
)
|
||||
self.GetPreviewFrame = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochReceiver/GetPreviewFrame',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
@@ -106,6 +111,12 @@ class gRPC_JFJochReceiverServicer(object):
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetRadialIntegrationProfiles(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetPreviewFrame(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
@@ -156,6 +167,11 @@ def add_gRPC_JFJochReceiverServicer_to_server(servicer, server):
|
||||
request_deserializer=jfjoch__pb2.PlotRequest.FromString,
|
||||
response_serializer=jfjoch__pb2.Plot.SerializeToString,
|
||||
),
|
||||
'GetRadialIntegrationProfiles': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetRadialIntegrationProfiles,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
response_serializer=jfjoch__pb2.RadialIntegrationProfiles.SerializeToString,
|
||||
),
|
||||
'GetPreviewFrame': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetPreviewFrame,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
@@ -295,6 +311,23 @@ class gRPC_JFJochReceiver(object):
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetRadialIntegrationProfiles(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/JFJochProtoBuf.gRPC_JFJochReceiver/GetRadialIntegrationProfiles',
|
||||
jfjoch__pb2.Empty.SerializeToString,
|
||||
jfjoch__pb2.RadialIntegrationProfiles.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetPreviewFrame(request,
|
||||
target,
|
||||
@@ -767,6 +800,11 @@ class gRPC_JFJochBrokerStub(object):
|
||||
request_serializer=jfjoch__pb2.PlotRequest.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.Plot.FromString,
|
||||
)
|
||||
self.GetRadialIntegrationProfiles = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochBroker/GetRadialIntegrationProfiles',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.RadialIntegrationProfiles.FromString,
|
||||
)
|
||||
self.GetPreview = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochBroker/GetPreview',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
@@ -897,6 +935,12 @@ class gRPC_JFJochBrokerServicer(object):
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetRadialIntegrationProfiles(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetPreview(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
@@ -1017,6 +1061,11 @@ def add_gRPC_JFJochBrokerServicer_to_server(servicer, server):
|
||||
request_deserializer=jfjoch__pb2.PlotRequest.FromString,
|
||||
response_serializer=jfjoch__pb2.Plot.SerializeToString,
|
||||
),
|
||||
'GetRadialIntegrationProfiles': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetRadialIntegrationProfiles,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
response_serializer=jfjoch__pb2.RadialIntegrationProfiles.SerializeToString,
|
||||
),
|
||||
'GetPreview': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetPreview,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
@@ -1317,6 +1366,23 @@ class gRPC_JFJochBroker(object):
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetRadialIntegrationProfiles(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/JFJochProtoBuf.gRPC_JFJochBroker/GetRadialIntegrationProfiles',
|
||||
jfjoch__pb2.Empty.SerializeToString,
|
||||
jfjoch__pb2.RadialIntegrationProfiles.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetPreview(request,
|
||||
target,
|
||||
|
||||
@@ -683,6 +683,18 @@ JFJochProtoBuf::Plot JFJochReceiver::GetPlots(const JFJochProtoBuf::PlotRequest
|
||||
return ret;
|
||||
}
|
||||
|
||||
JFJochProtoBuf::RadialIntegrationProfiles JFJochReceiver::GetRadialIntegrationProfiles() {
|
||||
JFJochProtoBuf::RadialIntegrationProfiles ret;
|
||||
|
||||
for (auto &i: rad_int_profile_per_file)
|
||||
i->GetPlot(*ret.add_file_plots());
|
||||
|
||||
if (rad_int_profile)
|
||||
rad_int_profile->GetPlot(*ret.mutable_total());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void JFJochReceiver::PrepareConversionOnCPU() {
|
||||
if (experiment.GetStorageCellNumber() != 1)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
|
||||
@@ -130,6 +130,7 @@ public:
|
||||
|
||||
float GetAvailableSendBuffers() const;
|
||||
JFJochProtoBuf::Plot GetPlots(const JFJochProtoBuf::PlotRequest& request);
|
||||
JFJochProtoBuf::RadialIntegrationProfiles GetRadialIntegrationProfiles();
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHRECEIVER_H
|
||||
|
||||
@@ -138,9 +138,9 @@ grpc::Status JFJochReceiverService::GetStatus(grpc::ServerContext *context, cons
|
||||
return grpc::Status::OK;
|
||||
}
|
||||
|
||||
grpc::Status
|
||||
JFJochReceiverService::GetDataProcessingPlots(grpc::ServerContext *context, const JFJochProtoBuf::PlotRequest *request,
|
||||
JFJochProtoBuf::Plot *response) {
|
||||
grpc::Status JFJochReceiverService::GetDataProcessingPlots(grpc::ServerContext *context,
|
||||
const JFJochProtoBuf::PlotRequest *request,
|
||||
JFJochProtoBuf::Plot *response) {
|
||||
// Need to hold mutex, as receiver might not exist here, if state is idle
|
||||
std::unique_lock<std::mutex> ul(state_mutex);
|
||||
if (receiver)
|
||||
@@ -148,6 +148,16 @@ JFJochReceiverService::GetDataProcessingPlots(grpc::ServerContext *context, cons
|
||||
return grpc::Status::OK;
|
||||
}
|
||||
|
||||
grpc::Status JFJochReceiverService::GetRadialIntegrationProfiles(grpc::ServerContext *context,
|
||||
const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::RadialIntegrationProfiles *response) {
|
||||
// Need to hold mutex, as receiver might not exist here, if state is idle
|
||||
std::unique_lock<std::mutex> ul(state_mutex);
|
||||
if (receiver)
|
||||
*response = receiver->GetRadialIntegrationProfiles();
|
||||
return grpc::Status::OK;
|
||||
}
|
||||
|
||||
grpc::Status JFJochReceiverService::SetDataProcessingSettings(grpc::ServerContext *context,
|
||||
const JFJochProtoBuf::DataProcessingSettings *request,
|
||||
JFJochProtoBuf::Empty *response) {
|
||||
|
||||
@@ -52,6 +52,8 @@ public:
|
||||
JFJochProtoBuf::ReceiverNetworkConfig *response) override;
|
||||
grpc::Status GetDataProcessingPlots(grpc::ServerContext *context, const JFJochProtoBuf::PlotRequest *request,
|
||||
JFJochProtoBuf::Plot *response) override;
|
||||
grpc::Status GetRadialIntegrationProfiles(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::RadialIntegrationProfiles *response) override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1274,6 +1274,117 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index", "[JFJochReceiver]
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_rad_int", "[JFJochReceiver]") {
|
||||
Logger logger("JFJochIntegrationTest_ZMQ_lysozyme_rad_int");
|
||||
|
||||
RegisterHDF5Filter();
|
||||
|
||||
size_t nimages = 24;
|
||||
int64_t ndatastream = 1;
|
||||
int64_t nmodules = 8;
|
||||
|
||||
JFJochServices services(logger);
|
||||
JFJochStateMachine state_machine(services, logger);
|
||||
state_machine.AddDetectorSetup(DetectorGeometry(ndatastream * nmodules, 2, 8, 36));
|
||||
|
||||
state_machine.NotThreadSafe_Experiment().DataStreams(ndatastream);
|
||||
state_machine.NotThreadSafe_Experiment().PedestalG0Frames(0).PedestalG1Frames(0).PedestalG2Frames(0)
|
||||
.SpotFindingPeriod(10ms);
|
||||
state_machine.NotThreadSafe_Experiment().LowQForRadialInt_recipA(0.5).HighQForRadialInt_recipA(3.5)
|
||||
.QSpacingForRadialInt_recipA(1.0);
|
||||
services.Writer("unix:writer_test", "inproc://#1").Receiver("unix:fpga_receiver_test");
|
||||
|
||||
logger.Verbose(true);
|
||||
|
||||
std::vector<uint16_t> image(RAW_MODULE_SIZE);
|
||||
|
||||
HDF5File data("../../tests/test_data/compression_benchmark.h5", false, false, false);
|
||||
HDF5DataSet dataset(data, "/entry/data/data");
|
||||
HDF5DataSpace file_space(dataset);
|
||||
|
||||
std::vector<int16_t> image_conv(nimages * file_space.GetDimensions()[1] * file_space.GetDimensions()[2]);
|
||||
|
||||
std::vector<hsize_t> start = {0, 0, 0};
|
||||
std::vector<hsize_t> file_size = {nimages, file_space.GetDimensions()[1], file_space.GetDimensions()[2]};
|
||||
dataset.ReadVector(image_conv, start, file_size);
|
||||
|
||||
std::vector<int16_t> image_raw_geom(
|
||||
nimages * state_machine.NotThreadSafe_Experiment().GetModulesNum() * RAW_MODULE_SIZE * sizeof(int16_t));
|
||||
for (int i = 0; i < nimages; i++)
|
||||
ConvertedToRawGeometry(state_machine.NotThreadSafe_Experiment(),
|
||||
image_raw_geom.data() +
|
||||
i * RAW_MODULE_SIZE * state_machine.NotThreadSafe_Experiment().GetModulesNum(),
|
||||
image_conv.data() + i * file_space.GetDimensions()[1] * file_space.GetDimensions()[2]);
|
||||
|
||||
|
||||
std::vector<std::unique_ptr<AcquisitionDevice>> aq_devices;
|
||||
|
||||
auto *test = new MockAcquisitionDevice(0, 512);
|
||||
|
||||
for (int m = 0; m < state_machine.NotThreadSafe_Experiment().GetModulesNum(0); m++) {
|
||||
for (int image_num = 1; image_num <= nimages; image_num++)
|
||||
test->AddModule(image_num, m, (uint16_t *) (image_raw_geom.data()
|
||||
+ (m + (image_num - 1) *
|
||||
state_machine.NotThreadSafe_Experiment().GetModulesNum(
|
||||
0))
|
||||
* RAW_MODULE_SIZE));
|
||||
}
|
||||
test->Terminate();
|
||||
|
||||
aq_devices.emplace_back(test);
|
||||
|
||||
ZMQContext zmq_context;
|
||||
|
||||
std::vector<AcquisitionDevice *> tmp_devices;
|
||||
for (const auto &i: aq_devices)
|
||||
tmp_devices.emplace_back(i.get());
|
||||
|
||||
ZMQImagePusher pusher(zmq_context, {"inproc://#1"});
|
||||
JFJochReceiverService fpga_receiver(tmp_devices, logger, pusher);
|
||||
JFJochWriterService writer(zmq_context, logger);;
|
||||
|
||||
auto fpga_receiver_server = gRPCServer("unix:fpga_receiver_test", fpga_receiver);
|
||||
auto writer_server = gRPCServer("unix:writer_test", writer);
|
||||
|
||||
REQUIRE_NOTHROW(state_machine.Initialize());
|
||||
logger.Info("Initialized");
|
||||
|
||||
JFJochProtoBuf::DatasetSettings setup;
|
||||
setup.set_ntrigger(1);
|
||||
setup.set_detector_distance_mm(75);
|
||||
setup.set_summation(1);
|
||||
setup.set_file_prefix("spot_finding_test");
|
||||
setup.set_images_per_trigger(nimages);
|
||||
setup.set_photon_energy_kev(12.4);
|
||||
setup.set_beam_x_pxl(1090);
|
||||
setup.set_beam_y_pxl(1136);
|
||||
setup.mutable_unit_cell()->set_a(36.9);
|
||||
setup.mutable_unit_cell()->set_b(78.95);
|
||||
setup.mutable_unit_cell()->set_c(78.95);
|
||||
setup.mutable_unit_cell()->set_alpha(90.0);
|
||||
setup.mutable_unit_cell()->set_beta(90.0);
|
||||
setup.mutable_unit_cell()->set_gamma(90.0);
|
||||
setup.set_data_file_count(4);
|
||||
|
||||
REQUIRE_NOTHROW(state_machine.Start(setup));
|
||||
logger.Info("Started measurement");
|
||||
|
||||
REQUIRE_NOTHROW(state_machine.Stop());
|
||||
logger.Info("Stopped measurement");
|
||||
|
||||
auto rad_int = state_machine.GetRadialIntegrationProfiles();
|
||||
REQUIRE(rad_int.file_plots_size() == 4);
|
||||
REQUIRE(rad_int.file_plots(0).x_size() == 3);
|
||||
REQUIRE(rad_int.file_plots(0).y_size() == 3);
|
||||
REQUIRE(rad_int.file_plots(3).x_size() == 3);
|
||||
REQUIRE(rad_int.file_plots(3).y_size() == 3);
|
||||
REQUIRE(rad_int.file_plots(3).x(0) == Approx(1.0));
|
||||
REQUIRE(rad_int.total().x_size() == 3);
|
||||
|
||||
fpga_receiver_server->Shutdown();
|
||||
writer_server->Shutdown();
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index_sum", "[JFJochReceiver]") {
|
||||
Logger logger("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index_sum");
|
||||
|
||||
|
||||
Reference in new issue
Block a user