diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63728c3d..4d54d878 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -316,7 +316,8 @@ release: - build:x86:rpm script: - export PACKAGE_VERSION=`head -n1 VERSION` - - export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION}" + - export PACKAGE_VERSION_SEM=${PACKAGE_VERSION//_/-} + - export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}" - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm"' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm"' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm"' @@ -325,7 +326,7 @@ release: - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_100g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs"' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_8x10g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs"' - > - release-cli create --name "Release $PACKAGE_VERSION" --tag-name $PACKAGE_VERSION + release-cli create --name "Release $PACKAGE_VERSION_SEM" --tag-name $PACKAGE_VERSION_SEM --assets-link "{\"name\":\"jfjoch_driver.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz\"}" --assets-link "{\"name\":\"jfjoch_frontend.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz\"}" --assets-link "{\"name\":\"jfjoch_fpga_pcie_8x10g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs\"}" diff --git a/CMakeLists.txt b/CMakeLists.txt index d246098d..52ff1e90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,10 @@ IF (NOT JFJOCH_WRITER_ONLY) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui) ADD_CUSTOM_TARGET(frontend DEPENDS frontend_ui/build/index.html) + ADD_CUSTOM_TARGET(openapi + COMMAND bash update_openapi.sh + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/ DESTINATION /usr/src/jfjoch-1.0.0 COMPONENT driver-dkms diff --git a/VERSION b/VERSION index 65241f96..c62cbe00 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0_rc.11 +1.0.0_rc.12 diff --git a/acquisition_device/FPGAAcquisitionDevice.cpp b/acquisition_device/FPGAAcquisitionDevice.cpp index 2e86f06e..69dda640 100644 --- a/acquisition_device/FPGAAcquisitionDevice.cpp +++ b/acquisition_device/FPGAAcquisitionDevice.cpp @@ -247,6 +247,11 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D if (x.GetPixelDepth() == 4) job.mode |= MODE_32BIT; + + if (x.GetLossyCompressionPoisson()) { + job.mode |= MODE_SQROOT; + job.sqrtmult = x.GetLossyCompressionPoisson().value(); + } } void FPGAAcquisitionDevice::Start(const DiffractionExperiment &experiment, uint32_t flag) { diff --git a/acquisition_device/HLSSimulatedDevice.cpp b/acquisition_device/HLSSimulatedDevice.cpp index ded0064d..5f2634f6 100644 --- a/acquisition_device/HLSSimulatedDevice.cpp +++ b/acquisition_device/HLSSimulatedDevice.cpp @@ -2,117 +2,29 @@ #include "HLSSimulatedDevice.h" -#include -#include -#include "../fpga/hls/datamover_model.h" -#include "../fpga/hls/hls_jfjoch.h" - -uint16_t checksum(const uint16_t *addr, size_t count) { -/* Compute Internet Checksum for "count" bytes - * beginning at location "addr". - */ - long sum = 0; - - for (int i = 0; i < count / 2; i++) - sum += addr[i]; - -/* Add left-over byte, if any */ - if (count % 2 == 1) - sum += ((uint8_t *) addr)[count / 2]; - -/* Fold 32-bit sum to 16 bits */ - while (sum>>16) - sum = (sum & 0xffff) + (sum >> 16); - - return ~sum; -} - HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node) - : FPGAAcquisitionDevice(data_stream), - datamover_in(Direction::Input, nullptr), - datamover_out(Direction::Output, nullptr), - datamover_out_hbm_0(Direction::Output, (char *) hbm.data()), - datamover_out_hbm_1(Direction::Output, (char *) hbm.data()), - datamover_in_hbm_0(Direction::Input, (char *) hbm.data()), - datamover_in_hbm_1(Direction::Input, (char *) hbm.data()), - idle(true), hbm(hbm_if_size / 32 * hbm_if_count), - dma_address_table(65536) { + : FPGAAcquisitionDevice(data_stream) { mac_addr = 0xCCAA11223344; ipv4_addr = 0x0132010A; max_modules = MAX_MODULES_FPGA; + if (data_stream != 0) + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, + "HLS simulation can only work with 1 data_stream, due to use of static variables"); MapBuffersStandard(in_frame_buffer_size_modules, numa_node); - auto in_mem_location32 = (uint32_t *) dma_address_table.data(); - for (int i = 0; i < buffer_device.size(); i++) { - in_mem_location32[2 * i ] = ((uint64_t) buffer_device[i]) & UINT32_MAX; - in_mem_location32[2 * i + 1] = ((uint64_t) buffer_device[i]) >> 32; - } + device = std::make_unique(buffer_device); } void HLSSimulatedDevice::CreateFinalPacket(const DiffractionExperiment& experiment) { - CreateJFPacket(experiment, UINT64_MAX, 0, 0, nullptr, false); -} - -void HLSSimulatedDevice::SendPacket(char *buffer, int len, uint8_t user) { - auto obuff = (ap_uint<512> *)buffer; - - for (int i = 0; i < (len + 63) / 64; i++) { - packet_512_t packet_in; - if (i == (len + 63) / 64 - 1) packet_in.last = 1; - else packet_in.last = 0; - packet_in.keep = 0xFFFFFFFFFFFFFFFF; - packet_in.user = user; - packet_in.data = obuff[i]; - din_eth.write(packet_in); - } + device->CreateFinalPacket(experiment); } void HLSSimulatedDevice::CreateJFPacket(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet, uint32_t module_number, const uint16_t *data, int8_t adjust_axis, uint8_t user) { - char buff[256*64]; - memset(buff, 0, 256*64); - - auto packet = (jf_raw_packet *)buff; - - packet->ether_type = htons(0x0800); - packet->sour_mac[0] = 0x00; // module 0 - - uint64_t tmp_mac = mac_addr; - for (int i = 0; i < 6; i++) - packet->dest_mac[i] = (tmp_mac >> (8*i)) % 256; - - uint32_t half_module = 2 * module_number | ((eth_packet >= 64) ? 1 : 0); - - packet->ipv4_header_h = htons(0x4500); // Big endian in IP header! - packet->ipv4_header_total_length = htons(8268); // Big endian in IP header! - packet->ipv4_header_dest_ip = ipv4_addr; - packet->ipv4_header_sour_ip = experiment.GetSrcIPv4Address(data_stream, half_module); - - packet->ipv4_header_ttl_protocol = htons(0x0011); - packet->ipv4_header_checksum = checksum( (uint16_t *) &packet->ipv4_header_h, 20); // checksum is already in network order - - packet->udp_dest_port = htons(GetUDPPort()); // module number - packet->udp_sour_port = htons(0xDFAC); - packet->udp_length = htons(8248); - - // JF headers are little endian - packet->jf.detectortype = SLS_DETECTOR_TYPE_JUNGFRAU; - packet->jf.timestamp = 0xABCDEF0000FEDCBAL; - packet->jf.bunchid = 0x1234567898765431L; - packet->jf.row = half_module; - packet->jf.column = 0; - packet->jf.framenum = frame_number; - packet->jf.packetnum = eth_packet % 64; - if (data != nullptr) { - for (int i = 0; i < 4096; i++) - packet->jf.data[i] = data[i]; - } - packet->udp_checksum = htons(checksum( (uint16_t *) (buff+42), 8192+48)); - - SendPacket(buff, (130+adjust_axis)*64, user); + device->CreateJFPacket(experiment, frame_number, eth_packet, module_number, data, adjust_axis, user); } void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames, @@ -126,635 +38,67 @@ void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment void HLSSimulatedDevice::CreateEIGERPacket(const DiffractionExperiment &experiment, uint64_t frame_number, uint32_t eth_packet, uint32_t module_number, uint32_t col, uint32_t row, const uint16_t *data) { - char buff[256*64]; - memset(buff, 0, 256*64); - - auto packet = (eiger_raw_packet *)buff; - - packet->ether_type = htons(0x0800); - packet->sour_mac[0] = 0x00; // module 0 - - uint64_t tmp_mac = mac_addr; - for (int i = 0; i < 6; i++) - packet->dest_mac[i] = (tmp_mac >> (8*i)) % 256; - - packet->ipv4_header_h = htons(0x4500); // Big endian in IP header! - packet->ipv4_header_total_length = htons(4172); // Big endian in IP header! - packet->ipv4_header_dest_ip = ipv4_addr; - packet->ipv4_header_sour_ip = experiment.GetSrcIPv4Address(data_stream, 0); - - packet->ipv4_header_ttl_protocol = htons(0x0011); - packet->ipv4_header_checksum = checksum( (uint16_t *) &packet->ipv4_header_h, 20); // checksum is already in network order - - packet->udp_dest_port = htons(GetUDPPort()); // module number - packet->udp_sour_port = htons(0xDFAC); - packet->udp_length = htons(4152); - - // JF headers are little endian - packet->eiger.detectortype = SLS_DETECTOR_TYPE_EIGER; - packet->eiger.timestamp = 0xABCDEF0000FEDCBAL; - packet->eiger.bunchid = 0x1234567898765431L; - packet->eiger.row = (2 * module_number) | (row % 2); - packet->eiger.column = col % 2; - packet->eiger.framenum = frame_number; - packet->eiger.packetnum = eth_packet % 64; - if (data != nullptr) { - for (int i = 0; i < 2048; i++) - packet->eiger.data[i] = data[i]; - } - packet->udp_checksum = htons(checksum( (uint16_t *) (buff+42), 4096+48)); - - SendPacket(buff, 66*64, 0); -} - -AXI_STREAM & HLSSimulatedDevice::OutputStream() { - return dout_eth; + device->CreateEIGERPacket(experiment, frame_number, eth_packet, module_number, col, row, data); } void HLSSimulatedDevice::HW_ReadActionRegister(DataCollectionConfig *job) { - memcpy(job, &cfg, sizeof(DataCollectionConfig)); + device->HW_ReadActionRegister(job); } void HLSSimulatedDevice::HW_WriteActionRegister(const DataCollectionConfig *job) { - memcpy(&cfg, job, sizeof(DataCollectionConfig)); + device->HW_WriteActionRegister(job); } void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experiment) { - if (action_thread.joinable()) - action_thread.join(); - - run_counter += 1; - run_data_collection = 1; - cancel_data_collection = 0; - idle = false; - - while (!din_frame_generator.empty()) - din_frame_generator.read(); - - datamover_out.ClearCompletedDescriptors(); - - action_thread = std::thread(&HLSSimulatedDevice::HLSMainThread, this ); -} - -void HLSSimulatedDevice::FrameGeneratorFuture(FrameGeneratorConfig config) { - frame_generator(din_frame_generator, - hbm.data(), - hbm.data(), - hbm_if_size, - mac_addr, - ipv4_addr, - cancel_data_collection, - config); + device->FPGA_StartAction(experiment); } void HLSSimulatedDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) { - frame_generator_future = std::async(std::launch::async, &HLSSimulatedDevice::FrameGeneratorFuture, this, config); + device->HW_RunInternalGenerator(config); } void HLSSimulatedDevice::FPGA_EndAction() { - if (action_thread.joinable()) - action_thread.join(); + device->FPGA_EndAction(); } -HLSSimulatedDevice::~HLSSimulatedDevice() { - if (action_thread.joinable()) - action_thread.join(); -} bool HLSSimulatedDevice::HW_ReadMailbox(uint32_t *values) { - std::unique_lock ul(completion_mutex); - - ap_uint<32> tmp; - bool ret = completion_stream.read_nb(tmp); - values[0] = tmp; - // equivalent to driver functionality - if (ret) { - uint32_t data_collection_id = (values[0] >> 16) & 0xFFFF; - uint32_t handle = values[0] & 0xFFFF; - if (handle == HANDLE_START) - completion_count = 0; - else if ((handle != HANDLE_END) && (data_collection_id != DATA_COLLECTION_ID_PURGE)) { - completion_count++; - while (completion_count * DMA_DESCRIPTORS_PER_MODULE > datamover_out.GetCompletedDescriptors()) - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - } - return ret; + return device->HW_ReadMailbox(values); } void HLSSimulatedDevice::Cancel() { - cancel_data_collection = 1; + device->Cancel(); } bool HLSSimulatedDevice::HW_IsIdle() const { - return idle && datamover_out.IsIdle(); + return device->HW_IsIdle(); } bool HLSSimulatedDevice::HW_SendWorkRequest(uint32_t handle) { - work_request_stream.write(handle); - return true; -} - -inline uint32_t float2uint(float f) { - float_uint32 fu; - fu.f = f; - return fu.u; -} - -void HLSSimulatedDevice::HLSMainThread() { - ap_uint<1> clear_counters = 0; - - uint64_t packets_processed; - - std::vector hls_cores; - - STREAM_512 ip1, udp1, udp2, icmp1, arp1; - - STREAM_512 network0; - - STREAM_768 stream_768_0; - STREAM_768 stream_768_1; - STREAM_768 stream_768_2; - STREAM_768 stream_768_3; - STREAM_768 stream_768_4; - STREAM_768 stream_768_5; - - STREAM_512 data_0; - hls::stream, 2> data_1; - hls::stream, 2> data_2; - STREAM_512 data_3; - STREAM_512 data_4; - STREAM_512 data_5; - STREAM_512 data_6; - STREAM_512 data_7; - STREAM_512 data_8; - STREAM_512 data_9; - STREAM_512 data_10; - STREAM_512 data_12; - STREAM_512 data_13; - - hls::stream addr0; - hls::stream addr1; - hls::stream addr2; - hls::stream addr3; - - hls::stream axi_compl[12]; - - hls::stream> hbm_handles; - hls::stream> adu_histo_result; - - hls::stream> integration_result_0; - hls::stream> integration_result_1; - - hls::stream> spot_finder_result_0; - hls::stream> spot_finder_result_1; - hls::stream> spot_finder_conn_0; - hls::stream> spot_finder_result_2; - hls::stream> spot_finder_result_3; - - hls::stream> spot_finder_mask_0; - - hls::stream> roi_calc_result_0; - - hls::stream > udp_metadata; - volatile ap_uint<1> idle_data_collection = 1; - ap_uint<1> load_to_hbm_idle; - ap_uint<1> save_to_hbm_idle; - ap_uint<1> integration_idle; - ap_uint<1> stream_conv_idle; - ap_uint<1> frame_summation_idle; - - volatile bool done = false; - volatile bool udp_done = false; // done AND udp_idle - volatile bool sls_done = false; // done AND sls_idle - - // Sent gratuitous ARP message - arp(arp1, dout_eth, mac_addr, ipv4_addr, 1, 1); - - Logger logger_hls("HLS"); - - volatile rcv_state_t state = RCV_INIT; - // Start data collection - data_collection_fsm(data_0, data_1, - addr0, addr1, - run_data_collection, - cancel_data_collection, - idle_data_collection, - cfg.mode, - float2uint(cfg.energy_kev), - cfg.nframes, - cfg.nmodules, - cfg.nstorage_cells, - cfg.nsummation , state); - - run_data_collection = 0; - data_collection_fsm(data_0, data_1, - addr0, addr1, - run_data_collection, - cancel_data_collection, - idle_data_collection, - cfg.mode, - float2uint(cfg.energy_kev), - cfg.nframes, - cfg.nmodules, - cfg.nstorage_cells, - cfg.nsummation, state); - - hls_cores.emplace_back([&] { - while (!udp_done) { - if (din_eth.empty() && din_frame_generator.empty()) - std::this_thread::sleep_for(std::chrono::microseconds(10)); - else - stream_merge(din_eth, din_frame_generator, network0, data_source); - } - logger_hls.Info("Stream_merge done"); - }); - - hls_cores.emplace_back([&] { - while (!udp_done) { - if (network0.empty()) - std::this_thread::sleep_for(std::chrono::microseconds(10)); - else - ethernet(network0, ip1, arp1, mac_addr, eth_packets, clear_counters); - } - logger_hls.Info("ethernet done"); - }); - - hls_cores.emplace_back([&] { - while (!udp_done) { - if (ip1.empty()) - std::this_thread::sleep_for(std::chrono::microseconds(10)); - else - ipv4(ip1, udp1, icmp1, ipv4_addr); - } - logger_hls.Info("ipv4 done"); - }); - - hls_cores.emplace_back([&] { - ap_uint<1> udp_idle = 1; - while (!done || !udp_idle) { - if (udp1.empty()) - std::this_thread::sleep_for(std::chrono::microseconds(10)); - else - udp(udp1, udp2, udp_metadata, udp_packets, clear_counters, udp_idle); - } - udp_done = true; - logger_hls.Info("udp done"); - }); - - hls_cores.emplace_back([&] { - ap_uint<1> sls_idle = 1; - while (!done || !sls_idle) { - if (udp2.empty()) - std::this_thread::sleep_for(std::chrono::microseconds (10)); - else - sls_detector(udp2, udp_metadata, data_0, addr0, sls_packets, udp_eth_err, udp_len_err, current_pulse_id, - clear_counters, sls_idle); - } - sls_done = true; - logger_hls.Info("sls_detector done"); - }); - - // 1. Parse incoming UDP packets - hls_cores.emplace_back([&] { - while ((state != RCV_WAIT_FOR_START) || (idle_data_collection.read() == 0) || (!data_0.empty())) { - data_collection_fsm(data_0, data_1, - addr0, addr1, - run_data_collection, - cancel_data_collection, - idle_data_collection, - cfg.mode, - float2uint(cfg.energy_kev), - cfg.nframes, - cfg.nmodules, - cfg.nstorage_cells, - cfg.nsummation, - state); - } - done = true; - - logger_hls.Info("data collection done"); - }); - - // 2. Cache images in HBM - hls_cores.emplace_back([&] { save_to_hbm(addr1, axi_compl[0], hbm_handles, - datamover_out_hbm_0.GetCtrlStream(), - datamover_out_hbm_1.GetCtrlStream(), - save_to_hbm_idle, - hbm_if_size);}); - - hls_cores.emplace_back([&] { save_to_hbm_data(data_1, - data_3, - datamover_out_hbm_0.GetDataStream(), - datamover_out_hbm_1.GetDataStream());}); - - hls_cores.emplace_back([&] {frame_summation_reorder_compl(data_3, data_4, axi_compl[0], axi_compl[1]);}); - - hls_cores.emplace_back([&] { load_from_hbm(data_4, data_5, axi_compl[1], axi_compl[2], hbm_handles, - datamover_in_hbm_0.GetDataStream(), datamover_in_hbm_1.GetDataStream(), - datamover_in_hbm_0.GetCtrlStream(), datamover_in_hbm_1.GetCtrlStream(), - load_to_hbm_idle, hbm_if_size);}); - - hls_cores.emplace_back([&] { pedestal(data_5, data_6, axi_compl[2], axi_compl[3], - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm_if_size);}); - - - // 3. Calculate histogram of ADU values - hls_cores.emplace_back([&] { adu_histo(data_6, data_7, adu_histo_result, axi_compl[3], axi_compl[4]);}); - - // 4. Mask missing pixels - hls_cores.emplace_back([&] { mask_missing(data_7, data_8, axi_compl[4], axi_compl[5]);}); - - // 5. Handle EIGER packets properly - hls_cores.emplace_back([&] { eiger_reorder(data_8, data_9, axi_compl[5], axi_compl[6]);}); - - // 6. Apply pedestal & gain corrections - hls_cores.emplace_back([&] { jf_conversion(data_9, stream_768_0, - axi_compl[6], axi_compl[7], - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm.data(), - hbm_if_size); }); - - // 7. Frame summation - hls_cores.emplace_back([&] { frame_summation(stream_768_0, stream_768_1, axi_compl[7], axi_compl[8], frame_summation_idle);}); - - // 8. Integration of pixels - hls_cores.emplace_back([&] { integration(stream_768_1, stream_768_2, integration_result_0, axi_compl[8], axi_compl[9], - hbm.data(), hbm.data(), hbm.data(), hbm.data(), integration_idle, hbm_if_size);}); - hls_cores.emplace_back([&] { axis_64_to_512(integration_result_0, integration_result_1);}); - - // 9. Spot finding - ap_uint<32> tmp_snr_threshold = float2uint(spot_finder_parameters.snr_threshold); - ap_uint<32> min_d = float2uint(spot_finder_parameters.min_d); - ap_uint<32> max_d = float2uint(spot_finder_parameters.max_d); - ap_int<32> tmp_count_threshold = spot_finder_parameters.count_threshold; - ap_uint<32> min_pix_per_spot = spot_finder_parameters.min_pix_per_spot; - - hls_cores.emplace_back([&] { - spot_finder_mask(stream_768_2, - stream_768_3, - spot_finder_mask_0, - axi_compl[9], - axi_compl[10], - hbm.data(), - hbm.data(), - min_d, - max_d, - hbm_if_size); - logger_hls.Info("spot_finder_mask done"); - }); - - hls_cores.emplace_back([&] { - spot_finder(stream_768_3, spot_finder_mask_0, stream_768_4, spot_finder_result_0, tmp_count_threshold, tmp_snr_threshold); - logger_hls.Info("spot_finder done"); - }); - - hls_cores.emplace_back([&] { - spot_finder_connectivity(spot_finder_result_0, - spot_finder_result_1, - spot_finder_conn_0); - logger_hls.Info("spot_finder_connectivity done"); - }); - - hls_cores.emplace_back([&] { - spot_finder_merge(spot_finder_result_1, - spot_finder_conn_0, - spot_finder_result_2, - min_pix_per_spot); - logger_hls.Info("spot_finder_merge done"); - }); - - hls_cores.emplace_back([&] { - axis_32_to_512(spot_finder_result_2, spot_finder_result_3); - logger_hls.Info("axis_32_to_512 done"); - }); - - hls_cores.emplace_back([&] { - roi_calc(stream_768_4, - stream_768_5, - roi_calc_result_0, - axi_compl[10], - axi_compl[11], - hbm.data(), - hbm.data(), - hbm_if_size); - logger_hls.Info("roi_calc done"); - }); - - // 10. Reduce/extend 24-bit stream - hls_cores.emplace_back([&] { stream_24bit_conv(stream_768_5, data_12, stream_conv_idle);}); - - // 11. Prepare data to write to host memory - hls_cores.emplace_back([&] { - ap_uint<3> state; - host_writer(data_12, adu_histo_result, integration_result_1, spot_finder_result_3, roi_calc_result_0, - axi_compl[11], datamover_out.GetDataStream(), - datamover_out.GetCtrlStream(), work_request_stream, completion_stream, - dma_address_table.data(), packets_processed, host_writer_idle, cancel_data_collection, state); - logger_hls.Info("host_writer done"); - }); - - for (auto &i : hls_cores) - i.join(); - - if (frame_generator_future.valid()) - frame_generator_future.get(); - - // reset static counter - arp(arp1, dout_eth, mac_addr, ipv4_addr, 0, 1); - try { - while (!din_eth.empty()) - din_eth.read(); - - if (!addr1.empty()) - throw std::runtime_error("Addr1 queue not empty"); - - if (!addr2.empty()) - throw std::runtime_error("Addr2 queue not empty"); - - if (!addr3.empty()) - throw std::runtime_error("Addr3 queue not empty"); - - if (!data_1.empty()) - throw std::runtime_error("data_1 queue not empty"); - - if (!data_2.empty()) - throw std::runtime_error("data_2 queue not empty"); - - if (!data_3.empty()) - throw std::runtime_error("data_3 queue not empty"); - - if (!data_4.empty()) - throw std::runtime_error("data_4 queue not empty"); - - if (!data_5.empty()) - throw std::runtime_error("data_5 queue not empty"); - - if (!data_7.empty()) - throw std::runtime_error("data_7 queue not empty"); - - if (!data_8.empty()) - throw std::runtime_error("data_8 queue not empty"); - - if (!data_9.empty()) - throw std::runtime_error("data_9 queue not empty"); - - if (!data_10.empty()) - throw std::runtime_error("data_10 queue not empty"); - - - - if (!data_12.empty()) - throw std::runtime_error("data_12 queue not empty"); - - if (!data_13.empty()) - throw std::runtime_error("data_13 queue not empty"); - - for (auto &c: axi_compl) { - if (!c.empty()) - throw std::runtime_error("Compl queue not empty"); - } - - if (!stream_768_0.empty()) - throw std::runtime_error("stream_768_0 queue not empty"); - - if (!stream_768_1.empty()) - throw std::runtime_error("stream_768_1 queue not empty"); - - if (!stream_768_2.empty()) - throw std::runtime_error("stream_768_2 queue not empty"); - - if (!stream_768_3.empty()) - throw std::runtime_error("stream_768_3 queue not empty"); - - if (!stream_768_4.empty()) - throw std::runtime_error("stream_768_4 queue not empty"); - - if (!hbm_handles.empty()) - throw std::runtime_error("Handles queue not empty"); - - if (!integration_result_0.empty()) - throw std::runtime_error("Integration result queue not empty"); - - if (!integration_result_1.empty()) - throw std::runtime_error("Integration result queue not empty"); - - if (!datamover_in.GetDataStream().empty()) - throw std::runtime_error("Datamover queue is not empty"); - - while (!datamover_out.IsIdle()) - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - } catch (const std::runtime_error &e) { - if (logger) - logger->ErrorException(e); - throw e; - } - if (logger) - logger->Info("Packets Eth {} UDP {} SLS {} Proc {}", eth_packets, udp_packets, sls_packets, packets_processed); - idle = true; + return device->HW_SendWorkRequest(handle); } DataCollectionStatus HLSSimulatedDevice::GetDataCollectionStatus() const { - DataCollectionStatus status{}; - - union { - uint64_t u64; - double d; - } pulse_id_conv; - pulse_id_conv.u64 = current_pulse_id; - - status.ctrl_reg = ap_uint<1>(host_writer_idle) ? (1 << 4) : 0; - status.max_modules = max_modules; - status.hbm_size_bytes = hbm_if_size; - status.run_counter = run_counter; - status.current_pulseid = pulse_id_conv.d; - status.packets_udp = udp_packets; - status.packets_eth = eth_packets; - status.packets_sls = sls_packets; - - return status; + return device->GetDataCollectionStatus(); } void HLSSimulatedDevice::HW_LoadCalibration(const LoadCalibrationConfig &config) { - int ret = load_calibration(hbm.data(), hbm.data(), - config, - hbm_if_size, - datamover_in.GetCtrlStream(), - datamover_in.GetDataStream(), - dma_address_table.data()); - if (ret) - throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError, - "Error in loading calibration " + std::to_string(ret)); - - if (!datamover_in.GetDataStream().empty()) - throw std::runtime_error("Datamover queue is not empty"); + device->HW_LoadCalibration(config); } void HLSSimulatedDevice::HW_SetSpotFinderParameters(const SpotFinderParameters ¶ms) { - spot_finder_parameters = params; + device->HW_SetSpotFinderParameters(params); } void HLSSimulatedDevice::HW_SetDataSource(uint32_t val) { - data_source = val; + device->HW_SetDataSource(val); } uint32_t HLSSimulatedDevice::HW_GetDataSource() { - return data_source; + return device->HW_GetDataSource(); } void HLSSimulatedDevice::CreateXfelBunchIDPacket(double pulse_id, uint32_t event_code) { - - union { - uint64_t u64; - double d; - } pulse_id_conv; - pulse_id_conv.d = pulse_id; - - bunchid_raw_packet packet{}; - - packet.ether_type = htons(0x0800); - for (int i = 0; i < 6; i++) - packet.dest_mac[i] = 0xFF; - - packet.ipv4_header_h = htons(0x4500); // Big endian in IP header! - packet.ipv4_header_total_length = htons(sizeof(bunchid_payload) + 8 + 20); // Big endian in IP header! - packet.ipv4_header_dest_ip = UINT32_MAX; - - packet.ipv4_header_ttl_protocol = htons(0x0011); - packet.ipv4_header_checksum = checksum( (uint16_t *) &packet.ipv4_header_h, 20); // checksum is already in network order - - packet.udp_length = htons(sizeof(bunchid_payload) + 8); - packet.payload.magicn[0] = BUNCHID_MAGICN; - packet.payload.magicn[1] = BUNCHID_MAGICN; - packet.payload.magicn[2] = BUNCHID_MAGICN; - packet.payload.bunchid_msb[0] = (pulse_id_conv.u64 >> 32) & UINT32_MAX; - packet.payload.bunchid_msb[1] = (pulse_id_conv.u64 >> 32) & UINT32_MAX; - packet.payload.bunchid_lsb[0] = pulse_id_conv.u64 & UINT32_MAX; - packet.payload.bunchid_lsb[1] = pulse_id_conv.u64 & UINT32_MAX; - packet.payload.montrig = event_code; - - SendPacket((char *) &packet, sizeof(bunchid_raw_packet)); + device->CreateXfelBunchIDPacket(pulse_id, event_code); } diff --git a/acquisition_device/HLSSimulatedDevice.h b/acquisition_device/HLSSimulatedDevice.h index 4ae4d235..a8402b31 100644 --- a/acquisition_device/HLSSimulatedDevice.h +++ b/acquisition_device/HLSSimulatedDevice.h @@ -5,61 +5,13 @@ #include -#include "../fpga/hls/hls_jfjoch.h" -#include "../fpga/hls/datamover_model.h" #include "../common/DiffractionExperiment.h" -#include "FPGAAcquisitionDevice.h" -#include "../jungfrau/sls_packet.h" +#include "../fpga/hls/HLSDevice.h" -uint16_t checksum(const uint16_t *addr, size_t count); +#include "FPGAAcquisitionDevice.h" class HLSSimulatedDevice : public FPGAAcquisitionDevice { - AXI_STREAM din_eth; - AXI_STREAM din_frame_generator; - AXI_STREAM dout_eth; - - uint32_t run_counter = 0; - - ap_uint<2> data_source = STREAM_MERGE_SRC_NETWORK; - SpotFinderParameters spot_finder_parameters; - - uint64_t current_pulse_id = 0; - - DataCollectionConfig cfg; - - volatile bool idle; - - constexpr static const size_t hbm_if_count = 32; - constexpr static const size_t hbm_if_size = 32*1024*1024LU; - std::vector> hbm; - - hls::stream > work_request_stream; - hls::stream > completion_stream; - std::mutex completion_mutex; - uint32_t completion_count; - - std::thread action_thread; - std::future frame_generator_future; - - Datamover<512> datamover_in; - Datamover<512> datamover_out; - Datamover<256> datamover_in_hbm_0; - Datamover<256> datamover_in_hbm_1; - Datamover<256, 16> datamover_out_hbm_0; - Datamover<256, 16> datamover_out_hbm_1; - - ap_uint<1> run_data_collection; - ap_uint<1> cancel_data_collection; - volatile ap_uint<1> host_writer_idle; - - std::vector dma_address_table; - - uint64_t eth_packets = 0; - uint64_t icmp_packets = 0; - uint64_t udp_packets = 0; - uint64_t sls_packets = 0; - uint32_t udp_len_err = 0; - uint32_t udp_eth_err = 0; + std::unique_ptr device; void HW_ReadActionRegister(DataCollectionConfig *job) override; void HW_WriteActionRegister(const DataCollectionConfig *job) override; @@ -74,12 +26,9 @@ class HLSSimulatedDevice : public FPGAAcquisitionDevice { uint32_t HW_GetDataSource() override; void HW_SetDataSource(uint32_t val) override; void HW_RunInternalGenerator(const FrameGeneratorConfig &config) override; - void FrameGeneratorFuture(FrameGeneratorConfig config); - void HLSMainThread(); public: HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node = -1); - ~HLSSimulatedDevice() override; - void SendPacket(char *buffer, int len, uint8_t user = 0); + ~HLSSimulatedDevice() override = default; void CreateJFPacket(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet, uint32_t module_number, const uint16_t *data, int8_t adjust_axis = 0, uint8_t user = 0); void CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames, @@ -90,7 +39,6 @@ public: void CreateXfelBunchIDPacket(double bunchid, uint32_t event_code); void CreateFinalPacket(const DiffractionExperiment& experiment); DataCollectionStatus GetDataCollectionStatus() const override; - AXI_STREAM &OutputStream(); void Cancel() override; }; diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index a1148582..5be49206 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -388,6 +388,8 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s else throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown compression"); } + if (input.poissonCompressionIsSet()) + ret.LossyCompressionPoisson(input.getPoissonCompression()); if (input.unitCellIsSet()) ret.SetUnitCell(UnitCell{ @@ -423,7 +425,7 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s ret.ImagesPerFile(input.getImagesPerFile()); if (input.dataReductionFactorSerialmxIsSet()) - ret.DataReductionFactorSerialMX(input.getDataReductionFactorSerialmx()); + ret.LossyCompressionSerialMX(input.getDataReductionFactorSerialmx()); return ret; } diff --git a/broker/gen/api/ApiBase.h b/broker/gen/api/ApiBase.h new file mode 100644 index 00000000..8187184e --- /dev/null +++ b/broker/gen/api/ApiBase.h @@ -0,0 +1,39 @@ +/** +* Jungfraujoch +* Jungfraujoch Broker Web API +* +* The version of the OpenAPI document: 1.0.0-rc.12 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * ApiBase.h + * + * Generalization of the Api classes + */ + +#ifndef ApiBase_H_ +#define ApiBase_H_ + +#include +#include + +namespace org::openapitools::server::api +{ + +class ApiBase { +public: + explicit ApiBase(const std::shared_ptr& rtr) : router(rtr) {}; + virtual ~ApiBase() = default; + virtual void init() = 0; + +protected: + const std::shared_ptr router; +}; + +} // namespace org::openapitools::server::api + +#endif /* ApiBase_H_ */ diff --git a/broker/gen/api/DefaultApi.cpp b/broker/gen/api/DefaultApi.cpp index 23cc59b1..4d6fb940 100644 --- a/broker/gen/api/DefaultApi.cpp +++ b/broker/gen/api/DefaultApi.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,7 +22,7 @@ using namespace org::openapitools::server::model; const std::string DefaultApi::base = ""; DefaultApi::DefaultApi(const std::shared_ptr& rtr) - : router(rtr) + : ApiBase(rtr) { } diff --git a/broker/gen/api/DefaultApi.h b/broker/gen/api/DefaultApi.h index ae7c4beb..bf428fba 100644 --- a/broker/gen/api/DefaultApi.h +++ b/broker/gen/api/DefaultApi.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,6 +19,8 @@ #define DefaultApi_H_ +#include "ApiBase.h" + #include #include #include @@ -42,15 +44,16 @@ #include "Roi_circle_list.h" #include "Spot_finding_settings.h" #include +#include namespace org::openapitools::server::api { -class DefaultApi { +class DefaultApi : public ApiBase { public: explicit DefaultApi(const std::shared_ptr& rtr); - virtual ~DefaultApi() = default; - void init(); + ~DefaultApi() override = default; + void init() override; static const std::string base; @@ -109,8 +112,6 @@ private: void xfel_pulse_id_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void default_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - const std::shared_ptr router; - /// /// Helper function to handle unexpected Exceptions during Parameter parsing and validation. /// May be overridden to return custom error formats. This is called inside a catch block. diff --git a/broker/gen/model/Broker_status.cpp b/broker/gen/model/Broker_status.cpp index 0cf2b479..21304932 100644 --- a/broker/gen/model/Broker_status.cpp +++ b/broker/gen/model/Broker_status.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -114,7 +114,7 @@ bool Broker_status::operator!=(const Broker_status& rhs) const void to_json(nlohmann::json& j, const Broker_status& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["state"] = o.m_State; if(o.progressIsSet()) j["progress"] = o.m_Progress; diff --git a/broker/gen/model/Broker_status.h b/broker/gen/model/Broker_status.h index a5905ea6..86185b11 100644 --- a/broker/gen/model/Broker_status.h +++ b/broker/gen/model/Broker_status.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -78,8 +78,8 @@ public: bool indexingRateIsSet() const; void unsetIndexing_rate(); - friend void to_json(nlohmann::json& j, const Broker_status& o); - friend void from_json(const nlohmann::json& j, Broker_status& o); + friend void to_json(nlohmann::json& j, const Broker_status& o); + friend void from_json(const nlohmann::json& j, Broker_status& o); protected: std::string m_State; diff --git a/broker/gen/model/Calibration_statistics_inner.cpp b/broker/gen/model/Calibration_statistics_inner.cpp index 2c472128..9cb947ca 100644 --- a/broker/gen/model/Calibration_statistics_inner.cpp +++ b/broker/gen/model/Calibration_statistics_inner.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -98,7 +98,7 @@ bool Calibration_statistics_inner::operator!=(const Calibration_statistics_inner void to_json(nlohmann::json& j, const Calibration_statistics_inner& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["module_number"] = o.m_Module_number; j["storage_cell_number"] = o.m_Storage_cell_number; j["pedestal_g0_mean"] = o.m_Pedestal_g0_mean; diff --git a/broker/gen/model/Calibration_statistics_inner.h b/broker/gen/model/Calibration_statistics_inner.h index d9d114dd..1d93704b 100644 --- a/broker/gen/model/Calibration_statistics_inner.h +++ b/broker/gen/model/Calibration_statistics_inner.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -103,8 +103,8 @@ public: int64_t getMaskedPixels() const; void setMaskedPixels(int64_t const value); - friend void to_json(nlohmann::json& j, const Calibration_statistics_inner& o); - friend void from_json(const nlohmann::json& j, Calibration_statistics_inner& o); + friend void to_json(nlohmann::json& j, const Calibration_statistics_inner& o); + friend void from_json(const nlohmann::json& j, Calibration_statistics_inner& o); protected: int64_t m_Module_number; diff --git a/broker/gen/model/Dataset_settings.cpp b/broker/gen/model/Dataset_settings.cpp index 4da92a9c..4c89b0d2 100644 --- a/broker/gen/model/Dataset_settings.cpp +++ b/broker/gen/model/Dataset_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -60,6 +60,8 @@ Dataset_settings::Dataset_settings() m_Run_nameIsSet = false; m_Experiment_group = ""; m_Experiment_groupIsSet = false; + m_Poisson_compression = 0L; + m_Poisson_compressionIsSet = false; m_Unit_cellIsSet = false; } @@ -257,7 +259,26 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP } } + + if (poissonCompressionIsSet()) + { + const int64_t& value = m_Poisson_compression; + const std::string currentValuePath = _pathPrefix + ".poissonCompression"; + + if (value < 0ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + if (value > 16ll) + { + success = false; + msg << currentValuePath << ": must be less than or equal to 16;"; + } + + } + return success; } @@ -336,6 +357,9 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const ((!experimentGroupIsSet() && !rhs.experimentGroupIsSet()) || (experimentGroupIsSet() && rhs.experimentGroupIsSet() && getExperimentGroup() == rhs.getExperimentGroup())) && + ((!poissonCompressionIsSet() && !rhs.poissonCompressionIsSet()) || (poissonCompressionIsSet() && rhs.poissonCompressionIsSet() && getPoissonCompression() == rhs.getPoissonCompression())) && + + ((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell())) ; @@ -348,7 +372,7 @@ bool Dataset_settings::operator!=(const Dataset_settings& rhs) const void to_json(nlohmann::json& j, const Dataset_settings& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); if(o.imagesPerTriggerIsSet()) j["images_per_trigger"] = o.m_Images_per_trigger; if(o.ntriggerIsSet()) @@ -391,6 +415,8 @@ void to_json(nlohmann::json& j, const Dataset_settings& o) j["run_name"] = o.m_Run_name; if(o.experimentGroupIsSet()) j["experiment_group"] = o.m_Experiment_group; + if(o.poissonCompressionIsSet()) + j["poisson_compression"] = o.m_Poisson_compression; if(o.unitCellIsSet()) j["unit_cell"] = o.m_Unit_cell; @@ -497,6 +523,11 @@ void from_json(const nlohmann::json& j, Dataset_settings& o) j.at("experiment_group").get_to(o.m_Experiment_group); o.m_Experiment_groupIsSet = true; } + if(j.find("poisson_compression") != j.end()) + { + j.at("poisson_compression").get_to(o.m_Poisson_compression); + o.m_Poisson_compressionIsSet = true; + } if(j.find("unit_cell") != j.end()) { j.at("unit_cell").get_to(o.m_Unit_cell); @@ -860,6 +891,23 @@ void Dataset_settings::unsetExperiment_group() { m_Experiment_groupIsSet = false; } +int64_t Dataset_settings::getPoissonCompression() const +{ + return m_Poisson_compression; +} +void Dataset_settings::setPoissonCompression(int64_t const value) +{ + m_Poisson_compression = value; + m_Poisson_compressionIsSet = true; +} +bool Dataset_settings::poissonCompressionIsSet() const +{ + return m_Poisson_compressionIsSet; +} +void Dataset_settings::unsetPoisson_compression() +{ + m_Poisson_compressionIsSet = false; +} org::openapitools::server::model::Dataset_settings_unit_cell Dataset_settings::getUnitCell() const { return m_Unit_cell; diff --git a/broker/gen/model/Dataset_settings.h b/broker/gen/model/Dataset_settings.h index e4ab0d70..d2190753 100644 --- a/broker/gen/model/Dataset_settings.h +++ b/broker/gen/model/Dataset_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -215,6 +215,13 @@ public: bool experimentGroupIsSet() const; void unsetExperiment_group(); /// + /// Enable lossy compression of pixel values that preserves Poisson statistics. Requires to provide a numerical factor SQ. Pixel value P will be transformed to round(sqrt(P) * SQ), with rounding to the closest integer. Compression is turned off if the value is missing or it is set to zero. + /// + int64_t getPoissonCompression() const; + void setPoissonCompression(int64_t const value); + bool poissonCompressionIsSet() const; + void unsetPoisson_compression(); + /// /// /// org::openapitools::server::model::Dataset_settings_unit_cell getUnitCell() const; @@ -222,8 +229,8 @@ public: bool unitCellIsSet() const; void unsetUnit_cell(); - friend void to_json(nlohmann::json& j, const Dataset_settings& o); - friend void from_json(const nlohmann::json& j, Dataset_settings& o); + friend void to_json(nlohmann::json& j, const Dataset_settings& o); + friend void from_json(const nlohmann::json& j, Dataset_settings& o); protected: int64_t m_Images_per_trigger; bool m_Images_per_triggerIsSet; @@ -271,6 +278,8 @@ protected: bool m_Run_nameIsSet; std::string m_Experiment_group; bool m_Experiment_groupIsSet; + int64_t m_Poisson_compression; + bool m_Poisson_compressionIsSet; org::openapitools::server::model::Dataset_settings_unit_cell m_Unit_cell; bool m_Unit_cellIsSet; diff --git a/broker/gen/model/Dataset_settings_unit_cell.cpp b/broker/gen/model/Dataset_settings_unit_cell.cpp index 30e2f433..bee813d2 100644 --- a/broker/gen/model/Dataset_settings_unit_cell.cpp +++ b/broker/gen/model/Dataset_settings_unit_cell.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -185,7 +185,7 @@ bool Dataset_settings_unit_cell::operator!=(const Dataset_settings_unit_cell& rh void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["a"] = o.m_a; j["b"] = o.m_b; j["c"] = o.m_c; diff --git a/broker/gen/model/Dataset_settings_unit_cell.h b/broker/gen/model/Dataset_settings_unit_cell.h index 4f8c7728..862e2e89 100644 --- a/broker/gen/model/Dataset_settings_unit_cell.h +++ b/broker/gen/model/Dataset_settings_unit_cell.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -88,8 +88,8 @@ public: float getGamma() const; void setGamma(float const value); - friend void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o); - friend void from_json(const nlohmann::json& j, Dataset_settings_unit_cell& o); + friend void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o); + friend void from_json(const nlohmann::json& j, Dataset_settings_unit_cell& o); protected: float m_a; diff --git a/broker/gen/model/Detector_list.cpp b/broker/gen/model/Detector_list.cpp index 2df87068..1b733f6a 100644 --- a/broker/gen/model/Detector_list.cpp +++ b/broker/gen/model/Detector_list.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -90,7 +90,7 @@ bool Detector_list::operator!=(const Detector_list& rhs) const void to_json(nlohmann::json& j, const Detector_list& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["detectors"] = o.m_Detectors; j["current_id"] = o.m_Current_id; diff --git a/broker/gen/model/Detector_list.h b/broker/gen/model/Detector_list.h index f2547167..ae778f37 100644 --- a/broker/gen/model/Detector_list.h +++ b/broker/gen/model/Detector_list.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -70,8 +70,8 @@ public: int64_t getCurrentId() const; void setCurrentId(int64_t const value); - friend void to_json(nlohmann::json& j, const Detector_list& o); - friend void from_json(const nlohmann::json& j, Detector_list& o); + friend void to_json(nlohmann::json& j, const Detector_list& o); + friend void from_json(const nlohmann::json& j, Detector_list& o); protected: std::vector m_Detectors; diff --git a/broker/gen/model/Detector_list_detectors_inner.cpp b/broker/gen/model/Detector_list_detectors_inner.cpp index f37bb3d7..0312a779 100644 --- a/broker/gen/model/Detector_list_detectors_inner.cpp +++ b/broker/gen/model/Detector_list_detectors_inner.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -96,7 +96,7 @@ bool Detector_list_detectors_inner::operator!=(const Detector_list_detectors_inn void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["id"] = o.m_Id; j["description"] = o.m_Description; j["nmodules"] = o.m_Nmodules; diff --git a/broker/gen/model/Detector_list_detectors_inner.h b/broker/gen/model/Detector_list_detectors_inner.h index 9e19589f..0357c20e 100644 --- a/broker/gen/model/Detector_list_detectors_inner.h +++ b/broker/gen/model/Detector_list_detectors_inner.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -84,8 +84,8 @@ public: int64_t getHeight() const; void setHeight(int64_t const value); - friend void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o); - friend void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o); + friend void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o); + friend void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o); protected: int64_t m_Id; diff --git a/broker/gen/model/Detector_selection.cpp b/broker/gen/model/Detector_selection.cpp index cd149807..689d8a92 100644 --- a/broker/gen/model/Detector_selection.cpp +++ b/broker/gen/model/Detector_selection.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -66,7 +66,7 @@ bool Detector_selection::operator!=(const Detector_selection& rhs) const void to_json(nlohmann::json& j, const Detector_selection& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["id"] = o.m_Id; } diff --git a/broker/gen/model/Detector_selection.h b/broker/gen/model/Detector_selection.h index 6f11cfc1..1e1f582a 100644 --- a/broker/gen/model/Detector_selection.h +++ b/broker/gen/model/Detector_selection.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -63,8 +63,8 @@ public: int64_t getId() const; void setId(int64_t const value); - friend void to_json(nlohmann::json& j, const Detector_selection& o); - friend void from_json(const nlohmann::json& j, Detector_selection& o); + friend void to_json(nlohmann::json& j, const Detector_selection& o); + friend void from_json(const nlohmann::json& j, Detector_selection& o); protected: int64_t m_Id; diff --git a/broker/gen/model/Detector_settings.cpp b/broker/gen/model/Detector_settings.cpp index 9183b8c9..377c5db6 100644 --- a/broker/gen/model/Detector_settings.cpp +++ b/broker/gen/model/Detector_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -220,7 +220,7 @@ bool Detector_settings::operator!=(const Detector_settings& rhs) const void to_json(nlohmann::json& j, const Detector_settings& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["frame_time_us"] = o.m_Frame_time_us; if(o.countTimeUsIsSet()) j["count_time_us"] = o.m_Count_time_us; diff --git a/broker/gen/model/Detector_settings.h b/broker/gen/model/Detector_settings.h index eb6a9776..356468bf 100644 --- a/broker/gen/model/Detector_settings.h +++ b/broker/gen/model/Detector_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -147,8 +147,8 @@ public: bool useGainHg0IsSet() const; void unsetUse_gain_hg0(); - friend void to_json(nlohmann::json& j, const Detector_settings& o); - friend void from_json(const nlohmann::json& j, Detector_settings& o); + friend void to_json(nlohmann::json& j, const Detector_settings& o); + friend void from_json(const nlohmann::json& j, Detector_settings& o); protected: int64_t m_Frame_time_us; diff --git a/broker/gen/model/Detector_status.cpp b/broker/gen/model/Detector_status.cpp index 779c6e25..edec9486 100644 --- a/broker/gen/model/Detector_status.cpp +++ b/broker/gen/model/Detector_status.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -126,7 +126,7 @@ bool Detector_status::operator!=(const Detector_status& rhs) const void to_json(nlohmann::json& j, const Detector_status& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["state"] = o.m_State; j["powerchip"] = o.m_Powerchip; j["server_version"] = o.m_Server_version; diff --git a/broker/gen/model/Detector_status.h b/broker/gen/model/Detector_status.h index 5471f534..343fcf6f 100644 --- a/broker/gen/model/Detector_status.h +++ b/broker/gen/model/Detector_status.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -90,8 +90,8 @@ public: std::vector getHighVoltageV() const; void setHighVoltageV(std::vector const value); - friend void to_json(nlohmann::json& j, const Detector_status& o); - friend void from_json(const nlohmann::json& j, Detector_status& o); + friend void to_json(nlohmann::json& j, const Detector_status& o); + friend void from_json(const nlohmann::json& j, Detector_status& o); protected: std::string m_State; diff --git a/broker/gen/model/Error_message.cpp b/broker/gen/model/Error_message.cpp index cae36e90..3499a80d 100644 --- a/broker/gen/model/Error_message.cpp +++ b/broker/gen/model/Error_message.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -70,7 +70,7 @@ bool Error_message::operator!=(const Error_message& rhs) const void to_json(nlohmann::json& j, const Error_message& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["msg"] = o.m_Msg; j["reason"] = o.m_Reason; diff --git a/broker/gen/model/Error_message.h b/broker/gen/model/Error_message.h index e873e4d8..ac278790 100644 --- a/broker/gen/model/Error_message.h +++ b/broker/gen/model/Error_message.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -69,8 +69,8 @@ public: std::string getReason() const; void setReason(std::string const& value); - friend void to_json(nlohmann::json& j, const Error_message& o); - friend void from_json(const nlohmann::json& j, Error_message& o); + friend void to_json(nlohmann::json& j, const Error_message& o); + friend void from_json(const nlohmann::json& j, Error_message& o); protected: std::string m_Msg; diff --git a/broker/gen/model/Helpers.cpp b/broker/gen/model/Helpers.cpp index 946cb8b7..0a4ecbd0 100644 --- a/broker/gen/model/Helpers.cpp +++ b/broker/gen/model/Helpers.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Helpers.h b/broker/gen/model/Helpers.h index 7f633102..d2c75c80 100644 --- a/broker/gen/model/Helpers.h +++ b/broker/gen/model/Helpers.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Measurement_statistics.cpp b/broker/gen/model/Measurement_statistics.cpp index 9440c446..ae80f83c 100644 --- a/broker/gen/model/Measurement_statistics.cpp +++ b/broker/gen/model/Measurement_statistics.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -185,7 +185,7 @@ bool Measurement_statistics::operator!=(const Measurement_statistics& rhs) const void to_json(nlohmann::json& j, const Measurement_statistics& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); if(o.filePrefixIsSet()) j["file_prefix"] = o.m_File_prefix; if(o.runNumberIsSet()) diff --git a/broker/gen/model/Measurement_statistics.h b/broker/gen/model/Measurement_statistics.h index ce7ef3ce..a04b0e57 100644 --- a/broker/gen/model/Measurement_statistics.h +++ b/broker/gen/model/Measurement_statistics.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -185,8 +185,8 @@ public: bool unitCellIsSet() const; void unsetUnit_cell(); - friend void to_json(nlohmann::json& j, const Measurement_statistics& o); - friend void from_json(const nlohmann::json& j, Measurement_statistics& o); + friend void to_json(nlohmann::json& j, const Measurement_statistics& o); + friend void from_json(const nlohmann::json& j, Measurement_statistics& o); protected: std::string m_File_prefix; bool m_File_prefixIsSet; diff --git a/broker/gen/model/Plot.cpp b/broker/gen/model/Plot.cpp index 9757fe8f..a1d02df0 100644 --- a/broker/gen/model/Plot.cpp +++ b/broker/gen/model/Plot.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -114,7 +114,7 @@ bool Plot::operator!=(const Plot& rhs) const void to_json(nlohmann::json& j, const Plot& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["title"] = o.m_Title; j["x"] = o.m_x; j["y"] = o.m_y; diff --git a/broker/gen/model/Plot.h b/broker/gen/model/Plot.h index cf77a0e6..1423d6f9 100644 --- a/broker/gen/model/Plot.h +++ b/broker/gen/model/Plot.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -75,8 +75,8 @@ public: std::vector getY() const; void setY(std::vector const value); - friend void to_json(nlohmann::json& j, const Plot& o); - friend void from_json(const nlohmann::json& j, Plot& o); + friend void to_json(nlohmann::json& j, const Plot& o); + friend void from_json(const nlohmann::json& j, Plot& o); protected: std::string m_Title; diff --git a/broker/gen/model/Plots.cpp b/broker/gen/model/Plots.cpp index 139b4d3f..d68ef17f 100644 --- a/broker/gen/model/Plots.cpp +++ b/broker/gen/model/Plots.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -91,7 +91,7 @@ bool Plots::operator!=(const Plots& rhs) const void to_json(nlohmann::json& j, const Plots& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); if(o.titleIsSet()) j["title"] = o.m_Title; j["plot"] = o.m_Plot; diff --git a/broker/gen/model/Plots.h b/broker/gen/model/Plots.h index 85517bc2..12a56fae 100644 --- a/broker/gen/model/Plots.h +++ b/broker/gen/model/Plots.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -73,8 +73,8 @@ public: std::vector getPlot() const; void setPlot(std::vector const& value); - friend void to_json(nlohmann::json& j, const Plots& o); - friend void from_json(const nlohmann::json& j, Plots& o); + friend void to_json(nlohmann::json& j, const Plots& o); + friend void from_json(const nlohmann::json& j, Plots& o); protected: std::string m_Title; bool m_TitleIsSet; diff --git a/broker/gen/model/Preview_settings.cpp b/broker/gen/model/Preview_settings.cpp index e7620228..b3ea7bba 100644 --- a/broker/gen/model/Preview_settings.cpp +++ b/broker/gen/model/Preview_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -153,7 +153,7 @@ bool Preview_settings::operator!=(const Preview_settings& rhs) const void to_json(nlohmann::json& j, const Preview_settings& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["saturation"] = o.m_Saturation; if(o.showSpotsIsSet()) j["show_spots"] = o.m_Show_spots; diff --git a/broker/gen/model/Preview_settings.h b/broker/gen/model/Preview_settings.h index 22ccb437..8e7a42f6 100644 --- a/broker/gen/model/Preview_settings.h +++ b/broker/gen/model/Preview_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -105,8 +105,8 @@ public: bool resolutionRingIsSet() const; void unsetResolution_ring(); - friend void to_json(nlohmann::json& j, const Preview_settings& o); - friend void from_json(const nlohmann::json& j, Preview_settings& o); + friend void to_json(nlohmann::json& j, const Preview_settings& o); + friend void from_json(const nlohmann::json& j, Preview_settings& o); protected: int64_t m_Saturation; diff --git a/broker/gen/model/Rad_int_settings.cpp b/broker/gen/model/Rad_int_settings.cpp index 60640622..6ccb4f01 100644 --- a/broker/gen/model/Rad_int_settings.cpp +++ b/broker/gen/model/Rad_int_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -102,7 +102,7 @@ bool Rad_int_settings::operator!=(const Rad_int_settings& rhs) const void to_json(nlohmann::json& j, const Rad_int_settings& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); if(o.polarizationFactorIsSet()) j["polarization_factor"] = o.m_Polarization_factor; j["solid_angle_corr"] = o.m_Solid_angle_corr; diff --git a/broker/gen/model/Rad_int_settings.h b/broker/gen/model/Rad_int_settings.h index 1d2f23d7..ef1a4a5e 100644 --- a/broker/gen/model/Rad_int_settings.h +++ b/broker/gen/model/Rad_int_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -85,8 +85,8 @@ public: float getQSpacing() const; void setQSpacing(float const value); - friend void to_json(nlohmann::json& j, const Rad_int_settings& o); - friend void from_json(const nlohmann::json& j, Rad_int_settings& o); + friend void to_json(nlohmann::json& j, const Rad_int_settings& o); + friend void from_json(const nlohmann::json& j, Rad_int_settings& o); protected: float m_Polarization_factor; bool m_Polarization_factorIsSet; diff --git a/broker/gen/model/Roi_box.cpp b/broker/gen/model/Roi_box.cpp index cc039149..03e0f8cb 100644 --- a/broker/gen/model/Roi_box.cpp +++ b/broker/gen/model/Roi_box.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -152,7 +152,7 @@ bool Roi_box::operator!=(const Roi_box& rhs) const void to_json(nlohmann::json& j, const Roi_box& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["name"] = o.m_Name; j["min_x_pxl"] = o.m_Min_x_pxl; j["max_x_pxl"] = o.m_Max_x_pxl; diff --git a/broker/gen/model/Roi_box.h b/broker/gen/model/Roi_box.h index f0bd276d..255da8cb 100644 --- a/broker/gen/model/Roi_box.h +++ b/broker/gen/model/Roi_box.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -84,8 +84,8 @@ public: int64_t getMaxYPxl() const; void setMaxYPxl(int64_t const value); - friend void to_json(nlohmann::json& j, const Roi_box& o); - friend void from_json(const nlohmann::json& j, Roi_box& o); + friend void to_json(nlohmann::json& j, const Roi_box& o); + friend void from_json(const nlohmann::json& j, Roi_box& o); protected: std::string m_Name; diff --git a/broker/gen/model/Roi_box_list.cpp b/broker/gen/model/Roi_box_list.cpp index e1093453..9b92f811 100644 --- a/broker/gen/model/Roi_box_list.cpp +++ b/broker/gen/model/Roi_box_list.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -92,7 +92,7 @@ bool Roi_box_list::operator!=(const Roi_box_list& rhs) const void to_json(nlohmann::json& j, const Roi_box_list& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); if(o.roisIsSet() || !o.m_Rois.empty()) j["rois"] = o.m_Rois; diff --git a/broker/gen/model/Roi_box_list.h b/broker/gen/model/Roi_box_list.h index 6a391eff..6b8a8284 100644 --- a/broker/gen/model/Roi_box_list.h +++ b/broker/gen/model/Roi_box_list.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,8 +67,8 @@ public: bool roisIsSet() const; void unsetRois(); - friend void to_json(nlohmann::json& j, const Roi_box_list& o); - friend void from_json(const nlohmann::json& j, Roi_box_list& o); + friend void to_json(nlohmann::json& j, const Roi_box_list& o); + friend void from_json(const nlohmann::json& j, Roi_box_list& o); protected: std::vector m_Rois; bool m_RoisIsSet; diff --git a/broker/gen/model/Roi_circle.cpp b/broker/gen/model/Roi_circle.cpp index 75b2a936..ba9a5d61 100644 --- a/broker/gen/model/Roi_circle.cpp +++ b/broker/gen/model/Roi_circle.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -106,7 +106,7 @@ bool Roi_circle::operator!=(const Roi_circle& rhs) const void to_json(nlohmann::json& j, const Roi_circle& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["name"] = o.m_Name; j["center_x_pxl"] = o.m_Center_x_pxl; j["center_y_pxl"] = o.m_Center_y_pxl; diff --git a/broker/gen/model/Roi_circle.h b/broker/gen/model/Roi_circle.h index 26753d46..8810cd31 100644 --- a/broker/gen/model/Roi_circle.h +++ b/broker/gen/model/Roi_circle.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -79,8 +79,8 @@ public: float getRadiusPxl() const; void setRadiusPxl(float const value); - friend void to_json(nlohmann::json& j, const Roi_circle& o); - friend void from_json(const nlohmann::json& j, Roi_circle& o); + friend void to_json(nlohmann::json& j, const Roi_circle& o); + friend void from_json(const nlohmann::json& j, Roi_circle& o); protected: std::string m_Name; diff --git a/broker/gen/model/Roi_circle_list.cpp b/broker/gen/model/Roi_circle_list.cpp index d2dd0b44..fce553d7 100644 --- a/broker/gen/model/Roi_circle_list.cpp +++ b/broker/gen/model/Roi_circle_list.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -91,7 +91,7 @@ bool Roi_circle_list::operator!=(const Roi_circle_list& rhs) const void to_json(nlohmann::json& j, const Roi_circle_list& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["rois"] = o.m_Rois; } diff --git a/broker/gen/model/Roi_circle_list.h b/broker/gen/model/Roi_circle_list.h index ce4a0dc8..002720af 100644 --- a/broker/gen/model/Roi_circle_list.h +++ b/broker/gen/model/Roi_circle_list.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -65,8 +65,8 @@ public: std::vector getRois() const; void setRois(std::vector const& value); - friend void to_json(nlohmann::json& j, const Roi_circle_list& o); - friend void from_json(const nlohmann::json& j, Roi_circle_list& o); + friend void to_json(nlohmann::json& j, const Roi_circle_list& o); + friend void from_json(const nlohmann::json& j, Roi_circle_list& o); protected: std::vector m_Rois; diff --git a/broker/gen/model/Rotation_axis.cpp b/broker/gen/model/Rotation_axis.cpp index cafed000..81bfe18d 100644 --- a/broker/gen/model/Rotation_axis.cpp +++ b/broker/gen/model/Rotation_axis.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -125,7 +125,7 @@ bool Rotation_axis::operator!=(const Rotation_axis& rhs) const void to_json(nlohmann::json& j, const Rotation_axis& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); if(o.nameIsSet()) j["name"] = o.m_Name; j["step"] = o.m_Step; diff --git a/broker/gen/model/Rotation_axis.h b/broker/gen/model/Rotation_axis.h index c037d34b..3c819a1c 100644 --- a/broker/gen/model/Rotation_axis.h +++ b/broker/gen/model/Rotation_axis.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -86,8 +86,8 @@ public: bool vectorIsSet() const; void unsetVector(); - friend void to_json(nlohmann::json& j, const Rotation_axis& o); - friend void from_json(const nlohmann::json& j, Rotation_axis& o); + friend void to_json(nlohmann::json& j, const Rotation_axis& o); + friend void from_json(const nlohmann::json& j, Rotation_axis& o); protected: std::string m_Name; bool m_NameIsSet; diff --git a/broker/gen/model/Spot_finding_settings.cpp b/broker/gen/model/Spot_finding_settings.cpp index 40193b87..f24d7fc7 100644 --- a/broker/gen/model/Spot_finding_settings.cpp +++ b/broker/gen/model/Spot_finding_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -197,7 +197,7 @@ bool Spot_finding_settings::operator!=(const Spot_finding_settings& rhs) const void to_json(nlohmann::json& j, const Spot_finding_settings& o) { - j = nlohmann::json(); + j = nlohmann::json::object(); j["enable"] = o.m_Enable; j["indexing"] = o.m_Indexing; if(o.filterPowderRingsIsSet()) diff --git a/broker/gen/model/Spot_finding_settings.h b/broker/gen/model/Spot_finding_settings.h index d040828f..f4a5e93f 100644 --- a/broker/gen/model/Spot_finding_settings.h +++ b/broker/gen/model/Spot_finding_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * Jungfraujoch Broker Web API * -* The version of the OpenAPI document: 1.0.0_rc.11 +* The version of the OpenAPI document: 1.0.0-rc.12 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -117,8 +117,8 @@ public: float getIndexingTolerance() const; void setIndexingTolerance(float const value); - friend void to_json(nlohmann::json& j, const Spot_finding_settings& o); - friend void from_json(const nlohmann::json& j, Spot_finding_settings& o); + friend void to_json(nlohmann::json& j, const Spot_finding_settings& o); + friend void from_json(const nlohmann::json& j, Spot_finding_settings& o); protected: bool m_Enable; diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 58c1e6ce..b91046d7 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Jungfraujoch description: Jungfraujoch Broker Web API - version: 1.0.0_rc.11 + version: 1.0.0-rc.12 contact: email: filip.leonarski@psi.ch components: @@ -198,6 +198,16 @@ components: description: | Name of group owning the data (e.g. p-group or proposal number). Transferred over CBOR stream, though not saved in HDF5 file. + poisson_compression: + type: integer + format: int64 + minimum: 0 + maximum: 16 + description: | + Enable lossy compression of pixel values that preserves Poisson statistics. + Requires to provide a numerical factor SQ. + Pixel value P will be transformed to round(sqrt(P) * SQ), with rounding to the closest integer. + Compression is turned off if the value is missing or it is set to zero. unit_cell: type: object description: Units of angstrom and degree diff --git a/broker/redoc-static.html b/broker/redoc-static.html index 9b13140c..647871f9 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -12,343 +12,344 @@ margin: 0; } - -

Jungfraujoch (1.0.0_rc.11)

Download OpenAPI specification:Download

Jungfraujoch Broker Web API

-

Initialize detector and data acquisition

Jungfraujoch (1.0.0-rc.12)

Download OpenAPI specification:Download

Jungfraujoch Broker Web API

+

Initialize detector and data acquisition

Should be used in two cases:

+" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Should be used in two cases:

  • Detector is in Inactive state
  • Detector is in Error state @@ -388,469 +389,477 @@ During operation of the detector it is recommended to use the POST /pedest If storage cells are used, the execution time might be few minutes.

This is async function - one needs to use POST /wait_till_done to ensure operation is done.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Collect dark current for the detector

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Collect dark current for the detector

Updates calibration of the JUNGFRAU detector. Must be in Idle state.

+" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Updates calibration of the JUNGFRAU detector. Must be in Idle state.

X-ray shutter must be closed. Recommended to run once per hour for long integration times (> 100 us).

This is async function - one needs to use POST /wait_till_done to ensure operation is done.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Start detector

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Start detector

Start data acquisition. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Start data acquisition. Detector must be in Idle state. Doesn't run calibration procedure. This is async function - one needs to use POST /wait_till_done to ensure operation is done.

-
Request Body schema: application/json
images_per_trigger
integer <int64> >= 1
Default: 1
Request Body schema: application/json
images_per_trigger
integer <int64> >= 1
Default: 1

For standard synchrotron data collection - this is number of images collected per one TTL trigger +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

For standard synchrotron data collection - this is number of images collected per one TTL trigger For XFEL (pulsed source) - this number is ignored and set to 1 For storage cell mode - this number is ignored and set to number of storage cells

-
ntrigger
integer <int64> >= 1
Default: 1

Number of TTL trigger that the detector is expected to receive during data collection

-
image_time_us
integer <int64> >= 0
ntrigger
integer <int64> >= 1
Default: 1

Number of TTL trigger that the detector is expected to receive during data collection

+
image_time_us
integer <int64> >= 0

Image time. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Image time. If not provided (or zero value) the frame time is assumed as default. Image time must be multiple of frame time; max value is 256 * frame_time.
In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells and if raw data are saved.

-
beam_x_pxl
required
number <float>
beam_x_pxl
required
number <float>

/entry/detector/beam_center_x in NXmx +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

/entry/detector/beam_center_x in NXmx Beam center in X direction [pixels]

-
beam_y_pxl
required
number <float>
beam_y_pxl
required
number <float>

/entry/detector/beam_center_y in NXmx +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

/entry/detector/beam_center_y in NXmx Beam center in X direction [pixels]

-
detector_distance_mm
required
number <float> >= 0

/entry/detector/distance in NXmx Detector distance [mm]

-
incident_energy_keV
required
number <float> >= 0
detector_distance_mm
required
number <float> >= 0

/entry/detector/distance in NXmx Detector distance [mm]

+
incident_energy_keV
required
number <float> >= 0

Used to calculate /entry/beam/incident_wavelength in NXmx +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Used to calculate /entry/beam/incident_wavelength in NXmx Incident particle (photon, electron) energy in keV

-
file_prefix
string
Default: ""

Prefix for filenames. If left empty, no file will be saved.

-
images_per_file
integer <int64> >= 0
Default: 1000

Number of files in a single HDF5 data file (0 = write all images to a single data file).

-
space_group_number
integer <int64> [ 0 .. 194 ]
Default: 0
sample_name
string
Default: ""
file_prefix
string
Default: ""

Prefix for filenames. If left empty, no file will be saved.

+
images_per_file
integer <int64> >= 0
Default: 1000

Number of files in a single HDF5 data file (0 = write all images to a single data file).

+
space_group_number
integer <int64> [ 0 .. 194 ]
Default: 0
sample_name
string
Default: ""

/entry/sample/name in NXmx +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

/entry/sample/name in NXmx Sample name

-
fpga_output
string
Default: "auto"
Enum: "auto" "int32" "int16" "uint32" "uint16"

FPGA output data type

-
compression
string
Default: "bslz4"
Enum: "bslz4" "bszstd" "bszstd_rle" "none"
total_flux
number <float>
fpga_output
string
Default: "auto"
Enum: "auto" "int32" "int16" "uint32" "uint16"

FPGA output data type

+
compression
string
Default: "bslz4"
Enum: "bslz4" "bszstd" "bszstd_rle" "none"
total_flux
number <float>

/entry/beam/total_flux in NXmx +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

/entry/beam/total_flux in NXmx Flux incident on beam plane in photons per second. In other words this is the flux integrated over area. [photons/s]

-
transmission
number <float> [ 0 .. 1 ]
transmission
number <float> [ 0 .. 1 ]

/entry/instrument/attenuator/attenuator_transmission +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

/entry/instrument/attenuator/attenuator_transmission Transmission of attenuator (filter) [no units]

-
object (rotation_axis)

Definition of a crystal rotation axis

-
header_appendix
any

Header appendix, added as user_data/user to start message (can be any valid JSON)

-
image_appendix
any

Image appendix, added as user_data to image message (can be any valid JSON)

-
energy_multiplier
number <float> [ 0.015625 .. 4 ]
Default: 1

For JUNGFRAU conversion it is possible to multiply incident energy by a given factor to get fractional/multiplied particle counts

-
data_reduction_factor_serialmx
number <float> [ 0 .. 1 ]
Default: 1
object (rotation_axis)

Definition of a crystal rotation axis

+
header_appendix
any

Header appendix, added as user_data/user to start message (can be any valid JSON)

+
image_appendix
any

Image appendix, added as user_data to image message (can be any valid JSON)

+
energy_multiplier
number <float> [ 0.015625 .. 4 ]
Default: 1

For JUNGFRAU conversion it is possible to multiply incident energy by a given factor to get fractional/multiplied particle counts

+
data_reduction_factor_serialmx
number <float> [ 0 .. 1 ]
Default: 1

Rate at which non-indexed images are accepted to be forwarded to writer. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Rate at which non-indexed images are accepted to be forwarded to writer. Value of 1.0 (default) means that all images are written. Values below zero mean that non-indexed images will be accepted with a given probability.

-
run_number
integer <int64> >= 0
run_number
integer <int64> >= 0

Number of run within an experimental session. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Number of run within an experimental session. Transferred over CBOR stream as "series ID", though not saved in HDF5 file. It is highly recommended to keep this number unique for each data collection during experimental series. If not provided, the number will be automatically incremented.

-
run_name
string
run_name
string

Unique ID of run. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Unique ID of run. Transferred over CBOR stream as "unique series ID", though not saved in HDF5 file. It is highly recommended to keep this name unique for each data collection during experimental series. If not provided, the name will be automatically generated as number + colon + file_prefix.

-
experiment_group
string
experiment_group
string

Name of group owning the data (e.g. p-group or proposal number). +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Name of group owning the data (e.g. p-group or proposal number). Transferred over CBOR stream, though not saved in HDF5 file.

-
object

Units of angstrom and degree

-

Responses

Request samples

Content type
application/json
{
  • "images_per_trigger": 1,
  • "ntrigger": 1,
  • "image_time_us": 0,
  • "beam_x_pxl": 0.1,
  • "beam_y_pxl": 0.1,
  • "detector_distance_mm": 0.1,
  • "incident_energy_keV": 0.1,
  • "file_prefix": "",
  • "images_per_file": 1000,
  • "space_group_number": 0,
  • "sample_name": "",
  • "fpga_output": "auto",
  • "compression": "bslz4",
  • "total_flux": 0.1,
  • "transmission": 1,
  • "goniometer": {
    },
  • "header_appendix": null,
  • "image_appendix": null,
  • "energy_multiplier": 1,
  • "data_reduction_factor_serialmx": 1,
  • "run_number": 0,
  • "run_name": "string",
  • "experiment_group": "string",
  • "unit_cell": {
    }
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Wait for acquisition done

poisson_compression
integer <int64> [ 0 .. 16 ]

Enable lossy compression of pixel values that preserves Poisson statistics. +Requires to provide a numerical factor SQ. +Pixel value P will be transformed to round(sqrt(P) * SQ), with rounding to the closest integer. +Compression is turned off if the value is missing or it is set to zero.

+
object

Units of angstrom and degree

+

Responses

Request samples

Content type
application/json
{
  • "images_per_trigger": 1,
  • "ntrigger": 1,
  • "image_time_us": 0,
  • "beam_x_pxl": 0.1,
  • "beam_y_pxl": 0.1,
  • "detector_distance_mm": 0.1,
  • "incident_energy_keV": 0.1,
  • "file_prefix": "",
  • "images_per_file": 1000,
  • "space_group_number": 0,
  • "sample_name": "",
  • "fpga_output": "auto",
  • "compression": "bslz4",
  • "total_flux": 0.1,
  • "transmission": 1,
  • "goniometer": {
    },
  • "header_appendix": null,
  • "image_appendix": null,
  • "energy_multiplier": 1,
  • "data_reduction_factor_serialmx": 1,
  • "run_number": 0,
  • "run_name": "string",
  • "experiment_group": "string",
  • "poisson_compression": 16,
  • "unit_cell": {
    }
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Wait for acquisition done

Block execution of external script till initialization, data collection or pedestal is finished. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software.

To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection.

-
query Parameters
timeout
integer [ 0 .. 3600 ]
Default: 60

Timeout in seconds (0 == immediate response)

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Send soft trigger to the detector

Generate soft trigger

-

Responses

Cancel running data collection

query Parameters
timeout
integer [ 0 .. 3600 ]
Default: 60

Timeout in seconds (0 == immediate response)

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Send soft trigger to the detector

Generate soft trigger

+

Responses

Cancel running data collection

Command will inform FPGA network card to stop pedestal or data collection at the current stage. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Command will inform FPGA network card to stop pedestal or data collection at the current stage. Any frame that is currently being processed by CPU will be finished and sent to writer. Given the command is making sure to gracefully stop data acquisition and detector, it might take some time to switch back after command finished to Idle state.

If data collection is not running, the command has no effect.

-

Responses

Prepare detector to turn off

Responses

Prepare detector to turn off

Should be in Idle or Error state. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Should be in Idle or Error state. Command deactivates data acquisition and turns off detector high voltage and ASIC. Should be used always before turning off power from the detector.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Change detector configuration

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Change detector configuration

Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. This can only be done when detector is Idle, Error or Inactive states. If detector is in Idle state , pedestal procedure will be executed automatically - there must be no X-rays on the detector during the operation. If detector is in Inactive or Error states, new settings will be saved, but no calibration will be executed.

-
Request Body schema: application/json
frame_time_us
required
integer <int64> >= 450

Interval between consecutive frames.

-
count_time_us
integer <int64>

Integration time of the detector. If not provided count time will be set to maximum value for a given frame time.

-
storage_cell_count
integer <int64> [ 1 .. 16 ]
Default: 1
internal_frame_generator
boolean
Default: false

Use internal frame generator in FPGA instead of getting data from a real detector

-
internal_frame_generator_images
integer <int64> [ 1 .. 128 ]
Default: 1
collect_raw_data
boolean
Default: false

Turn off conversion of pixel read-out to photon count

-
pedestal_g0_frames
integer <int64> >= 0
pedestal_g1_frames
integer <int64> >= 0
pedestal_g2_frames
integer <int64> >= 0
storage_cell_delay_us
number <float>

Delay between two storage cells [us]

-
detector_trigger_delay_us
number <float>

Delay between TTL trigger and acquisition start [us]

-
fixed_gain_g1
boolean
Default: false

Fix gain to G1 (can be useful for storage cells)

-
use_gain_hg0
boolean
Default: false

Use high G0 (for low energy applications)

-

Responses

Request samples

Content type
application/json
{
  • "frame_time_us": 450,
  • "count_time_us": 0,
  • "storage_cell_count": 1,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "collect_raw_data": false,
  • "pedestal_g0_frames": 0,
  • "pedestal_g1_frames": 0,
  • "pedestal_g2_frames": 0,
  • "storage_cell_delay_us": 0.1,
  • "detector_trigger_delay_us": 0.1,
  • "fixed_gain_g1": false,
  • "use_gain_hg0": false
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get detector configuration

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "frame_time_us": 450,
  • "count_time_us": 0,
  • "storage_cell_count": 1,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "collect_raw_data": false,
  • "pedestal_g0_frames": 0,
  • "pedestal_g1_frames": 0,
  • "pedestal_g2_frames": 0,
  • "storage_cell_delay_us": 0.1,
  • "detector_trigger_delay_us": 0.1,
  • "fixed_gain_g1": false,
  • "use_gain_hg0": false
}

Configure spot finding

Can be done anytime, also while data collection is running

-
Request Body schema: application/json
enable
required
boolean
Default: true
Request Body schema: application/json
frame_time_us
required
integer <int64> >= 450

Interval between consecutive frames.

+
count_time_us
integer <int64>

Integration time of the detector. If not provided count time will be set to maximum value for a given frame time.

+
storage_cell_count
integer <int64> [ 1 .. 16 ]
Default: 1
internal_frame_generator
boolean
Default: false

Use internal frame generator in FPGA instead of getting data from a real detector

+
internal_frame_generator_images
integer <int64> [ 1 .. 128 ]
Default: 1
collect_raw_data
boolean
Default: false

Turn off conversion of pixel read-out to photon count

+
pedestal_g0_frames
integer <int64> >= 0
pedestal_g1_frames
integer <int64> >= 0
pedestal_g2_frames
integer <int64> >= 0
storage_cell_delay_us
number <float>

Delay between two storage cells [us]

+
detector_trigger_delay_us
number <float>

Delay between TTL trigger and acquisition start [us]

+
fixed_gain_g1
boolean
Default: false

Fix gain to G1 (can be useful for storage cells)

+
use_gain_hg0
boolean
Default: false

Use high G0 (for low energy applications)

+

Responses

Request samples

Content type
application/json
{
  • "frame_time_us": 450,
  • "count_time_us": 0,
  • "storage_cell_count": 1,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "collect_raw_data": false,
  • "pedestal_g0_frames": 0,
  • "pedestal_g1_frames": 0,
  • "pedestal_g2_frames": 0,
  • "storage_cell_delay_us": 0.1,
  • "detector_trigger_delay_us": 0.1,
  • "fixed_gain_g1": false,
  • "use_gain_hg0": false
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get detector configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "frame_time_us": 450,
  • "count_time_us": 0,
  • "storage_cell_count": 1,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "collect_raw_data": false,
  • "pedestal_g0_frames": 0,
  • "pedestal_g1_frames": 0,
  • "pedestal_g2_frames": 0,
  • "storage_cell_delay_us": 0.1,
  • "detector_trigger_delay_us": 0.1,
  • "fixed_gain_g1": false,
  • "use_gain_hg0": false
}

Configure spot finding

Can be done anytime, also while data collection is running

+
Request Body schema: application/json
enable
required
boolean
Default: true

Enable spot finding. This is temporary setting, i.e. can be changed anytime during data collection. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Enable spot finding. This is temporary setting, i.e. can be changed anytime during data collection. Even if disabled spot finding information will still be send and written, though always with zero spots.

-
indexing
required
boolean
Default: true

Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.

-
filter_powder_rings
boolean
Default: false

Filter spots which form powder rings (e.g., ice rings)

-
min_spot_count_powder_ring
integer <int64> >= 5

Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.

-
signal_to_noise_threshold
required
number <float> >= 0
photon_count_threshold
required
integer <int64> >= 0
min_pix_per_spot
required
integer <int64> >= 1
max_pix_per_spot
required
integer <int64> >= 1
high_resolution_limit
required
number <float>
low_resolution_limit
required
number <float>
indexing_tolerance
required
number <float> [ 0 .. 1 ]

Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted

-

Responses

Request samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1
}

Get data processing configuration

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1
}

Configure radial integration

Can be done when detector is Inactive or Idle

-
Request Body schema: application/json
polarization_factor
number <float> [ -1 .. 1 ]

If polarization factor is provided, than polarization correction is enabled.

-
solid_angle_corr
required
boolean
Default: true

Apply solid angle correction for radial integration

-
high_q_recipA
required
number <float>
low_q_recipA
required
number <float>
q_spacing
required
number <float>

Responses

Request samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get radial integration configuration

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Load binary image for internal FPGA generator

indexing
required
boolean
Default: true

Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.

+
filter_powder_rings
boolean
Default: false

Filter spots which form powder rings (e.g., ice rings)

+
min_spot_count_powder_ring
integer <int64> >= 5

Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.

+
signal_to_noise_threshold
required
number <float> >= 0
photon_count_threshold
required
integer <int64> >= 0
min_pix_per_spot
required
integer <int64> >= 1
max_pix_per_spot
required
integer <int64> >= 1
high_resolution_limit
required
number <float>
low_resolution_limit
required
number <float>
indexing_tolerance
required
number <float> [ 0 .. 1 ]

Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted

+

Responses

Request samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1
}

Get data processing configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1
}

Configure radial integration

Can be done when detector is Inactive or Idle

+
Request Body schema: application/json
polarization_factor
number <float> [ -1 .. 1 ]

If polarization factor is provided, than polarization correction is enabled.

+
solid_angle_corr
required
boolean
Default: true

Apply solid angle correction for radial integration

+
high_q_recipA
required
number <float>
low_q_recipA
required
number <float>
q_spacing
required
number <float>

Responses

Request samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get radial integration configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Load binary image for internal FPGA generator

Load image for internal FPGA generator. This can only happen in Idle state of the detector. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).

-
query Parameters
id
integer <int64> [ 0 .. 127 ]

Image id to upload

-
Request Body schema: application/octet-stream
string <binary>

Responses

Load TIFF image for internal FPGA generator

query Parameters
id
integer <int64> [ 0 .. 127 ]

Image id to upload

+
Request Body schema: application/octet-stream
string <binary>

Responses

Load TIFF image for internal FPGA generator

Load image for internal FPGA generator. This can only happen in Idle state of the detector. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).

-
query Parameters
id
integer [ 0 .. 127 ]

Image ID to upload

-
Request Body schema: image/tiff
string <binary>

Responses

Select detector

query Parameters
id
integer [ 0 .. 127 ]

Image ID to upload

+
Request Body schema: image/tiff
string <binary>

Responses

Select detector

Jungfraujoch allows to control multiple detectors and/or region-of-interests. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Jungfraujoch allows to control multiple detectors and/or region-of-interests. The command allows to choose one detector from the list (ID has to be consistent with one provided by GET response). Changing detector will set detector to Inactive state and will require reinitialization.

-
Request Body schema: application/json
id
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "id": 1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

List available detectors

Configured detectors that can be selected by used

-

Responses

Response samples

Content type
application/json
{
  • "detectors": [
    ],
  • "current_id": 0
}

Get Jungfraujoch status

Status of the data acquisition

-

Responses

Response samples

Content type
application/json
{
  • "state": "Inactive",
  • "progress": 1,
  • "indexing_rate": 0.1
}

Return XFEL pulse IDs for the current data acquisition

Return array of XFEL pulse IDs - (-1) if image not recorded

-

Responses

Response samples

Content type
application/json
[
  • 0
]

Return XFEL event codes for the current data acquisition

Return array of XFEL event codes

-

Responses

Response samples

Content type
application/json
[
  • 0
]

Get detector status

Status of the JUNGFRAU detector

-

Responses

Response samples

Content type
application/json
{
  • "state": "Idle",
  • "powerchip": "PowerOn",
  • "server_version": "string",
  • "number_of_triggers_left": 0,
  • "fpga_temp_degC": [
    ],
  • "high_voltage_V": [
    ]
}

Get box ROIs

Responses

Response samples

Content type
application/json
{
  • "rois": [
    ]
}

Upload box ROIs

Request Body schema: application/json
Array of objects (roi_box) <= 32 items

Responses

Request samples

Content type
application/json
{
  • "rois": [
    ]
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get circular ROI

Responses

Response samples

Content type
application/json
{
  • "rois": [
    ]
}

Upload circular ROI

Request Body schema: application/json
required
Array of objects (roi_circle) <= 32 items

Responses

Request samples

Content type
application/json
{
  • "rois": [
    ]
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Generate background estimate plot

Mean intensity for d = 3 - 5 A per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate spot count plot

Number of spots per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing rate plot

Image indexing rate; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate error pixels plot

Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate strong pixels plot

Count of strong pixels per image (from spot finding); binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate ROI sum plot

Sum of ROI rectangle per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI max count

Max count of ROI per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI valid pixels

Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver delay plot

Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver free send buffer plot

Amount of send buffers available during frame processing - used for internal debugging; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate image collection efficiency plot

Ratio of collected and expected packets per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing rate per file

Indexing rate per each of data files; useful for example for time resolved data

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate radial integration profile

Generate average radial integration profile

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate radial integration profiles per file

Radial integration plots for both the whole dataset and per file; useful for time-resolved measurements

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Get data collection statistics

Results of the last data collection

-

Responses

Response samples

Content type
application/json
{
  • "file_prefix": "string",
  • "run_number": 0,
  • "experiment_group": "string",
  • "images_expected": 0,
  • "images_collected": 0,
  • "images_sent": 0,
  • "images_discarded_lossy_compression": 0,
  • "max_image_number_sent": 0,
  • "collection_efficiency": 1,
  • "compression_ratio": 5.3,
  • "cancelled": true,
  • "max_receiver_delay": 0,
  • "indexing_rate": 0.1,
  • "detector_width": 0,
  • "detector_height": 0,
  • "detector_pixel_depth": 2,
  • "bkg_estimate": 0.1,
  • "unit_cell": "string"
}

Get calibration statistics

Statistics are provided for each module/storage cell separately

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get last preview image in JPEG format using custom settings

Request Body schema: application/json
saturation
required
integer <int64> [ 0 .. 65535 ]

Saturation value to set contrast in the preview image

-
show_spots
boolean
Default: true

Show spot finding results on the image

-
show_roi
boolean
Default: false

Show ROI areas on the image

-
jpeg_quality
integer <int64> [ 0 .. 100 ]
Default: 100

Quality of JPEG image (100 - highest; 0 - lowest)

-
show_indexed
boolean
Default: false

Preview indexed images only

-
show_user_mask
boolean
Default: false

Show user mask

-
resolution_ring
number <float> [ 0.1 .. 100 ]
Default: 0.1

Responses

Request samples

Content type
application/json
{
  • "saturation": 65535,
  • "show_spots": true,
  • "show_roi": false,
  • "jpeg_quality": 100,
  • "show_indexed": false,
  • "show_user_mask": false,
  • "resolution_ring": 0.1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get last preview image in JPEG format using default settings

Responses

Get last preview image in TIFF format

Responses

Get last preview image in TIFF format for calibration with PyFAI/Dioptas

Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction

-

Responses

Get mask of the detector

Request Body schema: application/json
id
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "id": 1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

List available detectors

Configured detectors that can be selected by used

+

Responses

Response samples

Content type
application/json
{
  • "detectors": [
    ],
  • "current_id": 0
}

Get Jungfraujoch status

Status of the data acquisition

+

Responses

Response samples

Content type
application/json
{
  • "state": "Inactive",
  • "progress": 1,
  • "indexing_rate": 0.1
}

Return XFEL pulse IDs for the current data acquisition

Return array of XFEL pulse IDs - (-1) if image not recorded

+

Responses

Response samples

Content type
application/json
[
  • 0
]

Return XFEL event codes for the current data acquisition

Return array of XFEL event codes

+

Responses

Response samples

Content type
application/json
[
  • 0
]

Get detector status

Status of the JUNGFRAU detector

+

Responses

Response samples

Content type
application/json
{
  • "state": "Idle",
  • "powerchip": "PowerOn",
  • "server_version": "string",
  • "number_of_triggers_left": 0,
  • "fpga_temp_degC": [
    ],
  • "high_voltage_V": [
    ]
}

Get box ROIs

Responses

Response samples

Content type
application/json
{
  • "rois": [
    ]
}

Upload box ROIs

Request Body schema: application/json
Array of objects (roi_box) <= 32 items

Responses

Request samples

Content type
application/json
{
  • "rois": [
    ]
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get circular ROI

Responses

Response samples

Content type
application/json
{
  • "rois": [
    ]
}

Upload circular ROI

Request Body schema: application/json
required
Array of objects (roi_circle) <= 32 items

Responses

Request samples

Content type
application/json
{
  • "rois": [
    ]
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Generate background estimate plot

Mean intensity for d = 3 - 5 A per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate spot count plot

Number of spots per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing rate plot

Image indexing rate; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate error pixels plot

Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate strong pixels plot

Count of strong pixels per image (from spot finding); binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate ROI sum plot

Sum of ROI rectangle per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI max count

Max count of ROI per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI valid pixels

Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver delay plot

Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver free send buffer plot

Amount of send buffers available during frame processing - used for internal debugging; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate image collection efficiency plot

Ratio of collected and expected packets per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing rate per file

Indexing rate per each of data files; useful for example for time resolved data

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate radial integration profile

Generate average radial integration profile

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate radial integration profiles per file

Radial integration plots for both the whole dataset and per file; useful for time-resolved measurements

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Get data collection statistics

Results of the last data collection

+

Responses

Response samples

Content type
application/json
{
  • "file_prefix": "string",
  • "run_number": 0,
  • "experiment_group": "string",
  • "images_expected": 0,
  • "images_collected": 0,
  • "images_sent": 0,
  • "images_discarded_lossy_compression": 0,
  • "max_image_number_sent": 0,
  • "collection_efficiency": 1,
  • "compression_ratio": 5.3,
  • "cancelled": true,
  • "max_receiver_delay": 0,
  • "indexing_rate": 0.1,
  • "detector_width": 0,
  • "detector_height": 0,
  • "detector_pixel_depth": 2,
  • "bkg_estimate": 0.1,
  • "unit_cell": "string"
}

Get calibration statistics

Statistics are provided for each module/storage cell separately

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get last preview image in JPEG format using custom settings

Request Body schema: application/json
saturation
required
integer <int64> [ 0 .. 65535 ]

Saturation value to set contrast in the preview image

+
show_spots
boolean
Default: true

Show spot finding results on the image

+
show_roi
boolean
Default: false

Show ROI areas on the image

+
jpeg_quality
integer <int64> [ 0 .. 100 ]
Default: 100

Quality of JPEG image (100 - highest; 0 - lowest)

+
show_indexed
boolean
Default: false

Preview indexed images only

+
show_user_mask
boolean
Default: false

Show user mask

+
resolution_ring
number <float> [ 0.1 .. 100 ]
Default: 0.1

Responses

Request samples

Content type
application/json
{
  • "saturation": 65535,
  • "show_spots": true,
  • "show_roi": false,
  • "jpeg_quality": 100,
  • "show_indexed": false,
  • "show_user_mask": false,
  • "resolution_ring": 0.1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get last preview image in JPEG format using default settings

Responses

Get last preview image in TIFF format

Responses

Get last preview image in TIFF format for calibration with PyFAI/Dioptas

Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction

+

Responses

Get mask of the detector

Get full pixel mask of the detector +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Get full pixel mask of the detector See NXmx standard for meaning of pixel values

-

Responses

Get user mask of the detector

Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked

-

Responses

Upload user mask of the detector

Responses

Get user mask of the detector

Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked

+

Responses

Upload user mask of the detector

Should be in Idle state. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX cWARBq">

Should be in Idle state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don't need to be assigned value. @@ -866,23 +875,23 @@ Mask is expected as TIFF (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images.

-
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get pedestal G0 in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

-
sc
integer

Storage cell number

-

Responses

/version

Responses

+
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get pedestal G0 in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

+
sc
integer

Storage cell number

+

Responses

/version

Responses