diff --git a/CMakeLists.txt b/CMakeLists.txt index 19cb11d1..42eb58e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,10 +73,13 @@ FetchContent_Declare(hdf5 GIT_SHALLOW 1 EXCLUDE_FROM_ALL) +SET(PISTACHE_USE_CONTENT_ENCODING_DEFLATE ON) +SET(PISTACHE_BUILD_TESTS OFF) + FetchContent_Declare( pistache_http GIT_REPOSITORY https://github.com/fleon-psi/pistache - GIT_TAG 51553b92cc7bb25ac792462722ddd4fae33d14b1 + GIT_TAG 784955df8bbef471924d1631606f0f2a2f93d570 EXCLUDE_FROM_ALL ) diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index 8ccf00af..23e1fc69 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -139,8 +139,9 @@ void JFJochBrokerHttp::config_spot_finding_put( response.send(Pistache::Http::Code::Ok); } -void JFJochBrokerHttp::plot_azim_int_get(Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::AzInt, 0, response); +void JFJochBrokerHttp::plot_azim_int_get(const std::optional& compression, + Pistache::Http::ResponseWriter &response) { + GenericPlot(PlotType::AzInt, 0, compression, response); } void JFJochBrokerHttp::statistics_calibration_get(Pistache::Http::ResponseWriter &response) { @@ -347,7 +348,10 @@ void JFJochBrokerHttp::preview_pedestal_tiff_get(const std::optional &g } void JFJochBrokerHttp::GenericPlot(PlotType plot_type, const std::optional &binning, + const std::optional& in_compression, Pistache::Http::ResponseWriter &response) { + bool compression = !in_compression.has_value() || in_compression.value(); + PlotRequest req{.type = plot_type, .binning = 0}; if (binning) { if (binning.value() < 0) @@ -356,62 +360,73 @@ void JFJochBrokerHttp::GenericPlot(PlotType plot_type, const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::BkgEstimate, binning, response); + GenericPlot(PlotType::BkgEstimate, binning, compression, response); } void JFJochBrokerHttp::plot_error_pixel_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ErrorPixels, binning, response); + GenericPlot(PlotType::ErrorPixels, binning, compression, response); } void JFJochBrokerHttp::plot_image_collection_efficiency_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ImageCollectionEfficiency, binning, response); + GenericPlot(PlotType::ImageCollectionEfficiency, binning, compression, response); } void JFJochBrokerHttp::plot_indexing_rate_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::IndexingRate, binning, response); + GenericPlot(PlotType::IndexingRate, binning, compression, response); } void JFJochBrokerHttp::plot_receiver_delay_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ReceiverDelay, binning, response); + GenericPlot(PlotType::ReceiverDelay, binning, compression, response); } void JFJochBrokerHttp::plot_receiver_free_send_buffers_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ReceiverFreeSendBuf, binning, response); + GenericPlot(PlotType::ReceiverFreeSendBuf, binning, compression, response); } void JFJochBrokerHttp::plot_roi_max_count_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROIMaxCount, binning, response); + GenericPlot(PlotType::ROIMaxCount, binning, compression, response); } void JFJochBrokerHttp::plot_roi_sum_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROISum, binning, response); + GenericPlot(PlotType::ROISum, binning, compression, response); } void JFJochBrokerHttp::plot_roi_valid_pixels_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROIPixels, binning, response); + GenericPlot(PlotType::ROIPixels, binning, compression, response); } void JFJochBrokerHttp::plot_spot_count_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::SpotCount, binning, response); + GenericPlot(PlotType::SpotCount, binning, compression, response); } void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional &binning, + const std::optional& compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::StrongPixels, binning, response); + GenericPlot(PlotType::StrongPixels, binning, compression, response); } void JFJochBrokerHttp::config_mask_tiff_get(Pistache::Http::ResponseWriter &response) { diff --git a/broker/JFJochBrokerHttp.h b/broker/JFJochBrokerHttp.h index 131601c2..75105848 100644 --- a/broker/JFJochBrokerHttp.h +++ b/broker/JFJochBrokerHttp.h @@ -51,33 +51,34 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { Pistache::Http::ResponseWriter &response) override; void GenericPlot(PlotType plot_type, - const std::optional &binning, - Pistache::Http::ResponseWriter &response); + const std::optional &binning, + const std::optional& compression, + Pistache::Http::ResponseWriter &response); - void plot_bkg_estimate_get(const std::optional &binning, - Pistache::Http::ResponseWriter &response) override; - void plot_error_pixel_get(const std::optional &binning, + void plot_bkg_estimate_get(const std::optional &binning, const std::optional& compression, + Pistache::Http::ResponseWriter &response) override; + void plot_error_pixel_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_image_collection_efficiency_get(const std::optional &binning, + void plot_image_collection_efficiency_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_indexing_rate_get(const std::optional &binning, + void plot_indexing_rate_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_receiver_delay_get(const std::optional &binning, + void plot_receiver_delay_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_receiver_free_send_buffers_get(const std::optional &binning, + void plot_receiver_free_send_buffers_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_roi_max_count_get(const std::optional &binning, + void plot_roi_max_count_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_roi_sum_get(const std::optional &binning, + void plot_roi_sum_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_roi_valid_pixels_get(const std::optional &binning, + void plot_roi_valid_pixels_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_spot_count_get(const std::optional &binning, + void plot_spot_count_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_strong_pixel_get(const std::optional &binning, + void plot_strong_pixel_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void plot_azim_int_get(Pistache::Http::ResponseWriter &response) override; + void plot_azim_int_get(const std::optional& compression, Pistache::Http::ResponseWriter &response) override; void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override; @@ -141,7 +142,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { std::pair handleOperationException(const std::exception &ex) const noexcept override; template - void ProcessOutput(const T& output, Pistache::Http::ResponseWriter &response) { + void ProcessOutput(const T& output, Pistache::Http::ResponseWriter &response, bool compression = false) { std::stringstream s; if(!output.validate(s)) { logger.Error(s.str()); @@ -149,6 +150,8 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { } nlohmann::json j = output; + if (compression) + response.setCompression(Pistache::Http::Header::Encoding::Deflate); response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json)); } diff --git a/broker/gen/api/DefaultApi.cpp b/broker/gen/api/DefaultApi.cpp index 1625e0eb..26dbb3c4 100644 --- a/broker/gen/api/DefaultApi.cpp +++ b/broker/gen/api/DefaultApi.cpp @@ -667,12 +667,22 @@ void DefaultApi::pedestal_post_handler(const Pistache::Rest::Request &, Pistache } } -void DefaultApi::plot_azim_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { +void DefaultApi::plot_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { try { + // Getting the query params + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } + try { - this->plot_azim_int_get(response); + this->plot_azim_int_get(compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -699,9 +709,17 @@ void DefaultApi::plot_bkg_estimate_get_handler(const Pistache::Rest::Request &re binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_bkg_estimate_get(binning, response); + this->plot_bkg_estimate_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -728,9 +746,17 @@ void DefaultApi::plot_error_pixel_get_handler(const Pistache::Rest::Request &req binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_error_pixel_get(binning, response); + this->plot_error_pixel_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -757,9 +783,17 @@ void DefaultApi::plot_image_collection_efficiency_get_handler(const Pistache::Re binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_image_collection_efficiency_get(binning, response); + this->plot_image_collection_efficiency_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -786,9 +820,17 @@ void DefaultApi::plot_indexing_rate_get_handler(const Pistache::Rest::Request &r binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_indexing_rate_get(binning, response); + this->plot_indexing_rate_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -815,9 +857,17 @@ void DefaultApi::plot_receiver_delay_get_handler(const Pistache::Rest::Request & binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_receiver_delay_get(binning, response); + this->plot_receiver_delay_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -844,9 +894,17 @@ void DefaultApi::plot_receiver_free_send_buffers_get_handler(const Pistache::Res binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_receiver_free_send_buffers_get(binning, response); + this->plot_receiver_free_send_buffers_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -873,9 +931,17 @@ void DefaultApi::plot_roi_max_count_get_handler(const Pistache::Rest::Request &r binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_roi_max_count_get(binning, response); + this->plot_roi_max_count_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -902,9 +968,17 @@ void DefaultApi::plot_roi_sum_get_handler(const Pistache::Rest::Request &request binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_roi_sum_get(binning, response); + this->plot_roi_sum_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -931,9 +1005,17 @@ void DefaultApi::plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_roi_valid_pixels_get(binning, response); + this->plot_roi_valid_pixels_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -960,9 +1042,17 @@ void DefaultApi::plot_spot_count_get_handler(const Pistache::Rest::Request &requ binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_spot_count_get(binning, response); + this->plot_spot_count_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -989,9 +1079,17 @@ void DefaultApi::plot_strong_pixel_get_handler(const Pistache::Rest::Request &re binning = valueQuery_instance; } } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } try { - this->plot_strong_pixel_get(binning, response); + this->plot_strong_pixel_get(binning, compression, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; diff --git a/broker/gen/api/DefaultApi.h b/broker/gen/api/DefaultApi.h index d4d86db0..316b33e3 100644 --- a/broker/gen/api/DefaultApi.h +++ b/broker/gen/api/DefaultApi.h @@ -335,7 +335,8 @@ private: /// /// Generate average radial integration profile /// - virtual void plot_azim_int_get(Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_azim_int_get(const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate background estimate plot /// @@ -343,7 +344,8 @@ private: /// Mean intensity for d = 3 - 5 A per image; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_bkg_estimate_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_bkg_estimate_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate error pixels plot /// @@ -351,7 +353,8 @@ private: /// Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_error_pixel_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_error_pixel_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate image collection efficiency plot /// @@ -359,7 +362,8 @@ private: /// Ratio of collected and expected packets per image; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_image_collection_efficiency_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_image_collection_efficiency_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate indexing rate plot /// @@ -367,7 +371,8 @@ private: /// Image indexing rate; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_indexing_rate_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_indexing_rate_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate receiver delay plot /// @@ -375,7 +380,8 @@ private: /// Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_receiver_delay_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_receiver_delay_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate receiver free send buffer plot /// @@ -383,7 +389,8 @@ private: /// Amount of send buffers available during frame processing - used for internal debugging; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_receiver_free_send_buffers_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_receiver_free_send_buffers_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate plot of ROI max count /// @@ -391,7 +398,8 @@ private: /// Max count of ROI per image; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_roi_max_count_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_roi_max_count_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate ROI sum plot /// @@ -399,7 +407,8 @@ private: /// Sum of ROI rectangle per image; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_roi_sum_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_roi_sum_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate plot of ROI valid pixels /// @@ -407,7 +416,8 @@ private: /// Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_roi_valid_pixels_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_roi_valid_pixels_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate spot count plot /// @@ -415,7 +425,8 @@ private: /// Number of spots per image; binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_spot_count_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_spot_count_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate strong pixels plot /// @@ -423,7 +434,8 @@ private: /// Count of strong pixels per image (from spot finding); binning is configurable /// /// Binning of frames for the plot (0 = default binning) (optional, default to 0) - virtual void plot_strong_pixel_get(const std::optional &binning, Pistache::Http::ResponseWriter &response) = 0; + /// Enable DEFLATE compression of output data (optional, default to true) + virtual void plot_strong_pixel_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Get last preview image in TIFF format for calibration with PyFAI/Dioptas /// diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 66dcadee..14c24bdb 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -13,6 +13,22 @@ servers: - url: http://localhost:5232 description: Test Jungfraujoch system components: + parameters: + binning: + in: query + name: binning + required: false + schema: + type: integer + description: Binning of frames for the plot (0 = default binning) + compression: + in: query + name: compression + required: false + schema: + type: boolean + default: true + description: Enable DEFLATE compression of output data. schemas: rotation_axis: description: Definition of a crystal rotation axis @@ -1792,15 +1808,11 @@ paths: summary: Generate background estimate plot description: Mean intensity for d = 3 - 5 A per image; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Everything OK. Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1817,15 +1829,11 @@ paths: summary: Generate spot count plot description: Number of spots per image; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1842,15 +1850,11 @@ paths: summary: Generate indexing rate plot description: Image indexing rate; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1867,15 +1871,11 @@ paths: summary: Generate error pixels plot description: Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1892,15 +1892,11 @@ paths: summary: Generate strong pixels plot description: Count of strong pixels per image (from spot finding); binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1917,15 +1913,11 @@ paths: summary: Generate ROI sum plot description: Sum of ROI rectangle per image; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1942,15 +1934,11 @@ paths: summary: Generate plot of ROI max count description: Max count of ROI per image; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1967,15 +1955,11 @@ paths: summary: Generate plot of ROI valid pixels description: Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": - description: Everything OK + description: Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. content: application/json: schema: @@ -1992,12 +1976,8 @@ paths: summary: Generate receiver delay plot description: Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": description: Everything OK @@ -2017,12 +1997,8 @@ paths: summary: Generate receiver free send buffer plot description: Amount of send buffers available during frame processing - used for internal debugging; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": description: Everything OK @@ -2043,12 +2019,8 @@ paths: summary: Generate image collection efficiency plot description: Ratio of collected and expected packets per image; binning is configurable parameters: - - in: query - name: binning - required: false - schema: - type: integer - description: Binning of frames for the plot (0 = default binning) + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' responses: "200": description: Everything OK @@ -2067,6 +2039,8 @@ paths: get: summary: Generate radial integration profile description: Generate average radial integration profile + parameters: + - $ref: '#/components/parameters/compression' responses: "200": description: Everything OK diff --git a/broker/redoc-static.html b/broker/redoc-static.html index db8ee6be..22a897d3 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -885,88 +885,106 @@ Changing detector will set detector to Inactive state and will requ " class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Test Jungfraujoch system

http://localhost:5232/roi/circle

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
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

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
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

Responses

Response samples

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

Generate indexing rate plot

Image indexing rate; binning is configurable

-
query Parameters
binning
integer
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

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
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

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
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

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
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

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
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

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
query Parameters
binning
integer

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

-

Responses

compression
boolean
Default: true

Enable DEFLATE compression of output data

+

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
query Parameters
binning
integer

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

+
compression
boolean
Default: true

Enable DEFLATE compression of output data

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
query Parameters
binning
integer

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

+
compression
boolean
Default: true

Enable DEFLATE compression of output data

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
query Parameters
binning
integer

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

+
compression
boolean
Default: true

Enable DEFLATE compression of output data

Responses

Response samples

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

Generate radial integration profile

Generate average radial integration profile

-

Responses