diff --git a/broker/JFJochServices.cpp b/broker/JFJochServices.cpp index 088a9d72..78c884a4 100644 --- a/broker/JFJochServices.cpp +++ b/broker/JFJochServices.cpp @@ -271,6 +271,16 @@ void JFJochServices::SetupIndexing(const IndexingSettings &input) { receiver->Indexing(input); } +ImagePusherStatus JFJochServices::GetImagePusherStatus() const { + if (receiver) + return receiver->GetImagePusherStatus(); + return { + .pusher_type = ImagePusherType::None, + .address = {}, + .connected_writers = 0 + }; +} + uint64_t JFJochServices::GetConnectedWriters() const { if (receiver) return receiver->GetConnectedWriters(); diff --git a/broker/JFJochServices.h b/broker/JFJochServices.h index 22dc8b1c..2db067ab 100644 --- a/broker/JFJochServices.h +++ b/broker/JFJochServices.h @@ -68,7 +68,7 @@ public: void SetupIndexing(const IndexingSettings& input); - uint64_t GetConnectedWriters() const; + ImagePusherStatus GetImagePusherStatus() const; }; diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index 15d99777..924c5f60 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -554,7 +554,6 @@ BrokerStatus JFJochStateMachine::GetStatus() const { ret.progress = services.GetReceiverProgress(); ret.gpu_count = gpu_count; ret.broker_version = jfjoch_version(); - ret.connected_writers = services.GetConnectedWriters(); return ret; } @@ -1043,3 +1042,7 @@ void JFJochStateMachine::SetDarkMaskSettings(const DarkMaskSettings &settings) { measurement = std::async(std::launch::async, &JFJochStateMachine::PedestalThread, this, std::move(ul)); } } + +ImagePusherStatus JFJochStateMachine::GetImagePusherStatus() const { + return services.GetImagePusherStatus(); +} diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index 83e601df..41226764 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -244,6 +244,8 @@ public: void SetDarkMaskSettings(const DarkMaskSettings& settings); DarkMaskSettings GetDarkMaskSettings() const; + + ImagePusherStatus GetImagePusherStatus() const; }; diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index 53159cef..1af83240 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -1091,3 +1091,29 @@ DarkMaskSettings Convert(const org::openapitools::server::model::Dark_mask_setti .Threshold_keV(input.getDetectorThresholdKeV()); return ret; } + +org::openapitools::server::model::Image_pusher_status Convert(const ImagePusherStatus& input) { + org::openapitools::server::model::Image_pusher_status ret; + ret.setAddr(input.address); + ret.setConnectedWriters(input.connected_writers); + org::openapitools::server::model::Image_pusher_type tmp; + switch (input.pusher_type) { + case ImagePusherType::HDF5: + tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::HDF5); + break; + case ImagePusherType::CBOR: + tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::CBOR); + break; + case ImagePusherType::TCP: + tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::TCP); + break; + case ImagePusherType::ZMQ: + tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::ZEROMQ); + break; + default: + tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::NONE); + break; + } + ret.setPusherType(tmp); + return ret; +} \ No newline at end of file diff --git a/broker/OpenAPIConvert.h b/broker/OpenAPIConvert.h index 018e0332..9c382cfd 100644 --- a/broker/OpenAPIConvert.h +++ b/broker/OpenAPIConvert.h @@ -5,6 +5,7 @@ #define JFJOCH_OPENAPICONVERT_H #include "Dark_mask_settings.h" +#include "Image_pusher_status.h" #include "gen/model/Spot_finding_settings.h" #include "gen/model/Measurement_statistics.h" #include "gen/model/Detector_settings.h" @@ -39,6 +40,7 @@ #include "../jungfrau/JFCalibration.h" #include "../common/InstrumentMetadata.h" #include "../common/ScanResult.h" +#include "../image_pusher/ImagePusher.h" SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input); org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input); @@ -92,4 +94,6 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input); org::openapitools::server::model::Dark_mask_settings Convert(const DarkMaskSettings& input); DarkMaskSettings Convert(const org::openapitools::server::model::Dark_mask_settings& input); + +org::openapitools::server::model::Image_pusher_status Convert(const ImagePusherStatus& input); #endif //JFJOCH_OPENAPICONVERT_H diff --git a/broker/gen/api/DefaultApi.cpp b/broker/gen/api/DefaultApi.cpp index e3318ae8..acd24f00 100644 --- a/broker/gen/api/DefaultApi.cpp +++ b/broker/gen/api/DefaultApi.cpp @@ -76,6 +76,7 @@ void DefaultApi::setupRoutes() { Routes::Get(*router, base + "/image_buffer/image.tiff", Routes::bind(&DefaultApi::image_buffer_image_tiff_get_handler, this)); Routes::Get(*router, base + "/image_buffer/start.cbor", Routes::bind(&DefaultApi::image_buffer_start_cbor_get_handler, this)); Routes::Get(*router, base + "/image_buffer/status", Routes::bind(&DefaultApi::image_buffer_status_get_handler, this)); + Routes::Get(*router, base + "/image_pusher/status", Routes::bind(&DefaultApi::image_pusher_status_get_handler, this)); Routes::Post(*router, base + "/initialize", Routes::bind(&DefaultApi::initialize_post_handler, this)); Routes::Post(*router, base + "/pedestal", Routes::bind(&DefaultApi::pedestal_post_handler, this)); Routes::Get(*router, base + "/preview/pedestal.tiff", Routes::bind(&DefaultApi::preview_pedestal_tiff_get_handler, this)); @@ -1644,6 +1645,36 @@ void DefaultApi::image_buffer_status_get_handler(const Pistache::Rest::Request& } +} + +void DefaultApi::image_pusher_status_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->image_pusher_status_get(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + + } void DefaultApi::initialize_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { diff --git a/broker/gen/api/DefaultApi.h b/broker/gen/api/DefaultApi.h index 42bff9a5..ee494759 100644 --- a/broker/gen/api/DefaultApi.h +++ b/broker/gen/api/DefaultApi.h @@ -42,6 +42,7 @@ #include "Fpga_status_inner.h" #include "Image_buffer_status.h" #include "Image_format_settings.h" +#include "Image_pusher_status.h" #include "Indexing_settings.h" #include "Instrument_metadata.h" #include "Jfjoch_statistics.h" @@ -113,6 +114,7 @@ private: void image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void image_buffer_start_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void image_buffer_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void image_pusher_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void pedestal_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); @@ -492,6 +494,13 @@ private: /// virtual void image_buffer_status_get( Pistache::Http::ResponseWriter &response) = 0; /// + /// Get status of image pusher + /// + /// + /// + /// + virtual void image_pusher_status_get( Pistache::Http::ResponseWriter &response) = 0; + /// /// Initialize detector and data acquisition /// /// diff --git a/broker/gen/model/Broker_status.cpp b/broker/gen/model/Broker_status.cpp index ef4a0640..228da9cd 100644 --- a/broker/gen/model/Broker_status.cpp +++ b/broker/gen/model/Broker_status.cpp @@ -32,8 +32,6 @@ Broker_status::Broker_status() m_Gpu_countIsSet = false; m_Broker_version = ""; m_Broker_versionIsSet = false; - m_Connected_writers = 0L; - m_Connected_writersIsSet = false; } @@ -75,7 +73,7 @@ bool Broker_status::validate(std::stringstream& msg, const std::string& pathPref } } - + return success; } @@ -100,10 +98,7 @@ bool Broker_status::operator==(const Broker_status& rhs) const ((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount())) && - ((!brokerVersionIsSet() && !rhs.brokerVersionIsSet()) || (brokerVersionIsSet() && rhs.brokerVersionIsSet() && getBrokerVersion() == rhs.getBrokerVersion())) && - - - ((!connectedWritersIsSet() && !rhs.connectedWritersIsSet()) || (connectedWritersIsSet() && rhs.connectedWritersIsSet() && getConnectedWriters() == rhs.getConnectedWriters())) + ((!brokerVersionIsSet() && !rhs.brokerVersionIsSet()) || (brokerVersionIsSet() && rhs.brokerVersionIsSet() && getBrokerVersion() == rhs.getBrokerVersion())) ; } @@ -127,8 +122,6 @@ void to_json(nlohmann::json& j, const Broker_status& o) j["gpu_count"] = o.m_Gpu_count; if(o.brokerVersionIsSet()) j["broker_version"] = o.m_Broker_version; - if(o.connectedWritersIsSet()) - j["connected_writers"] = o.m_Connected_writers; } @@ -160,11 +153,6 @@ void from_json(const nlohmann::json& j, Broker_status& o) j.at("broker_version").get_to(o.m_Broker_version); o.m_Broker_versionIsSet = true; } - if(j.find("connected_writers") != j.end()) - { - j.at("connected_writers").get_to(o.m_Connected_writers); - o.m_Connected_writersIsSet = true; - } } @@ -261,23 +249,6 @@ void Broker_status::unsetBroker_version() { m_Broker_versionIsSet = false; } -int64_t Broker_status::getConnectedWriters() const -{ - return m_Connected_writers; -} -void Broker_status::setConnectedWriters(int64_t const value) -{ - m_Connected_writers = value; - m_Connected_writersIsSet = true; -} -bool Broker_status::connectedWritersIsSet() const -{ - return m_Connected_writersIsSet; -} -void Broker_status::unsetConnected_writers() -{ - m_Connected_writersIsSet = false; -} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Broker_status.h b/broker/gen/model/Broker_status.h index 3833dd4a..d5552c3e 100644 --- a/broker/gen/model/Broker_status.h +++ b/broker/gen/model/Broker_status.h @@ -98,13 +98,6 @@ public: void setBrokerVersion(std::string const& value); bool brokerVersionIsSet() const; void unsetBroker_version(); - /// - /// Number of connected writers For ZeroMQ image socket: number is constant For TCP/IP image socket: number is updated live during operation - /// - int64_t getConnectedWriters() const; - void setConnectedWriters(int64_t const value); - bool connectedWritersIsSet() const; - void unsetConnected_writers(); friend void to_json(nlohmann::json& j, const Broker_status& o); friend void from_json(const nlohmann::json& j, Broker_status& o); @@ -121,8 +114,6 @@ protected: bool m_Gpu_countIsSet; std::string m_Broker_version; bool m_Broker_versionIsSet; - int64_t m_Connected_writers; - bool m_Connected_writersIsSet; }; diff --git a/broker/gen/model/Image_pusher_status.cpp b/broker/gen/model/Image_pusher_status.cpp new file mode 100644 index 00000000..a7a83fd5 --- /dev/null +++ b/broker/gen/model/Image_pusher_status.cpp @@ -0,0 +1,138 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms. +* +* The version of the OpenAPI document: 1.0.0-rc.129 +* 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. +*/ + + +#include "Image_pusher_status.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Image_pusher_status::Image_pusher_status() +{ + m_Connected_writers = 0L; + +} + +void Image_pusher_status::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Image_pusher_status::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Image_pusher_status::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Image_pusher_status" : pathPrefix; + + + + /* Addr */ { + const std::vector& value = m_Addr; + const std::string currentValuePath = _pathPrefix + ".addr"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const std::string& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + + i++; + } + } + + } + + return success; +} + +bool Image_pusher_status::operator==(const Image_pusher_status& rhs) const +{ + return + + + (getPusherType() == rhs.getPusherType()) + && + + (getAddr() == rhs.getAddr()) + && + + (getConnectedWriters() == rhs.getConnectedWriters()) + + + ; +} + +bool Image_pusher_status::operator!=(const Image_pusher_status& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Image_pusher_status& o) +{ + j = nlohmann::json::object(); + j["pusher_type"] = o.m_Pusher_type; + j["addr"] = o.m_Addr; + j["connected_writers"] = o.m_Connected_writers; + +} + +void from_json(const nlohmann::json& j, Image_pusher_status& o) +{ + j.at("pusher_type").get_to(o.m_Pusher_type); + j.at("addr").get_to(o.m_Addr); + j.at("connected_writers").get_to(o.m_Connected_writers); + +} + +org::openapitools::server::model::Image_pusher_type Image_pusher_status::getPusherType() const +{ + return m_Pusher_type; +} +void Image_pusher_status::setPusherType(org::openapitools::server::model::Image_pusher_type const& value) +{ + m_Pusher_type = value; +} +std::vector Image_pusher_status::getAddr() const +{ + return m_Addr; +} +void Image_pusher_status::setAddr(std::vector const& value) +{ + m_Addr = value; +} +int64_t Image_pusher_status::getConnectedWriters() const +{ + return m_Connected_writers; +} +void Image_pusher_status::setConnectedWriters(int64_t const value) +{ + m_Connected_writers = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Image_pusher_status.h b/broker/gen/model/Image_pusher_status.h new file mode 100644 index 00000000..c9347ff6 --- /dev/null +++ b/broker/gen/model/Image_pusher_status.h @@ -0,0 +1,93 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms. +* +* The version of the OpenAPI document: 1.0.0-rc.129 +* 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. +*/ +/* + * Image_pusher_status.h + * + * Informs about status of the image pusher. + */ + +#ifndef Image_pusher_status_H_ +#define Image_pusher_status_H_ + + +#include "Image_pusher_type.h" +#include +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// Informs about status of the image pusher. +/// +class Image_pusher_status +{ +public: + Image_pusher_status(); + virtual ~Image_pusher_status() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Image_pusher_status& rhs) const; + bool operator!=(const Image_pusher_status& rhs) const; + + ///////////////////////////////////////////// + /// Image_pusher_status members + + /// + /// + /// + org::openapitools::server::model::Image_pusher_type getPusherType() const; + void setPusherType(org::openapitools::server::model::Image_pusher_type const& value); + /// + /// List of addresses of image pushers. For HDF5 socket - no addresses will be returned. For ZeroMQ - list of addresses for each socket will be provided. For TCP/IP - single address to connect all writers will be provided. + /// + std::vector getAddr() const; + void setAddr(std::vector const& value); + /// + /// Number of connected writers For ZeroMQ image socket: number is constant For TCP/IP image socket: number is updated live during operation + /// + int64_t getConnectedWriters() const; + void setConnectedWriters(int64_t const value); + + friend void to_json(nlohmann::json& j, const Image_pusher_status& o); + friend void from_json(const nlohmann::json& j, Image_pusher_status& o); +protected: + org::openapitools::server::model::Image_pusher_type m_Pusher_type; + + std::vector m_Addr; + + int64_t m_Connected_writers; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Image_pusher_status_H_ */ diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 2046c221..930984c0 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -1344,6 +1344,27 @@ components: type: string description: Version of the jfjoch_broker example: "1.0.0-rc.128" + image_pusher_status: + type: object + required: + - pusher_type + - addr + - connected_writers + description: | + Informs about status of the image pusher. + properties: + pusher_type: + $ref: "#/components/schemas/image_pusher_type" + addr: + type: array + items: + type: string + example: [ "tcp://1.2.3.4:5000", "tcp://1.2.3.4:5001" ] + description: | + List of addresses of image pushers. + For HDF5 socket - no addresses will be returned. + For ZeroMQ - list of addresses for each socket will be provided. + For TCP/IP - single address to connect all writers will be provided. connected_writers: type: integer format: int64 @@ -2960,6 +2981,23 @@ paths: "404": description: "Not in XFEL mode or no acquisition recorded" + /image_pusher/status: + get: + summary: Get status of image pusher + responses: + "200": + description: Everything OK + content: + application/json: + schema: + $ref: '#/components/schemas/image_pusher_status' + "500": + description: Error encountered when trying to read status + content: + text/plain: + schema: + type: string + description: Exception error /detector/status: get: summary: Get detector status diff --git a/broker/redoc-static.html b/broker/redoc-static.html index a4302053..f8a539c2 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -367,7 +367,7 @@ data-styled.g138[id="sc-dxcDKg"]{content:"eajCCh,"}/*!sc*/ -

Get Jungfraujoch status

Status of the data acquisition

Responses

Response samples

Content type
application/json
{
  • "state": "Inactive",
  • "progress": 1,
  • "message": "string",
  • "message_severity": "success",
  • "gpu_count": 0,
  • "broker_version": "1.0.0-rc.128",
  • "connected_writers": 0
}

Get status of FPGA devices

Responses

Response samples

Content type
application/json
{
  • "state": "Inactive",
  • "progress": 1,
  • "message": "string",
  • "message_severity": "success",
  • "gpu_count": 0,
  • "broker_version": "1.0.0-rc.128"
}

Get status of FPGA devices

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Return XFEL pulse IDs for the current data acquisition

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

Responses

Responses

Response samples

Content type
application/json
[
  • 0
]

Get detector status

Status of the JUNGFRAU detector

+
http://localhost:5232/xfel/event_code

Response samples

Content type
application/json
[
  • 0
]

Get status of image pusher

Responses

Response samples

Content type
application/json
{
  • "pusher_type": "ZeroMQ",
  • "addr": [
    ],
  • "connected_writers": 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 ROI definitions

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 ROI definitions

Responses

Response samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Upload ROI definitions

Request Body schema: application/json
required
object (roi_box_list)

List of box ROIs

+
http://localhost:5232/config/roi

Response samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Upload ROI definitions

Request Body schema: application/json
required
object (roi_box_list)

List of box ROIs

required
object (roi_circle_list)

List of circular ROIs

required
object (roi_azim_list)

List of azimuthal ROIs

Responses

Request samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Response samples

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

Get general statistics

query Parameters
compression
boolean
Default: false

Enable DEFLATE compression of output data.

+
http://localhost:5232/config/roi

Request samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Response samples

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

Get general statistics

query Parameters
compression
boolean
Default: false

Enable DEFLATE compression of output data.

Responses

Response samples

Content type
application/json
{
  • "detector": {
    },
  • "detector_list": {
    },
  • "detector_settings": {
    },
  • "image_format_settings": {
    },
  • "instrument_metadata": {
    },
  • "file_writer_settings": {
    },
  • "data_processing_settings": {
    },
  • "measurement": {
    },
  • "broker": {
    },
  • "fpga": [
    ],
  • "calibration": [
    ],
  • "zeromq_preview": {
    },
  • "zeromq_metadata": {
    },
  • "dark_mask": {
    },
  • "pixel_mask": {
    },
  • "roi": {
    },
  • "az_int": {
    },
  • "buffer": {
    },
  • "indexing": {
    }
}

Get data collection statistics

Results of the last data collection

+
http://localhost:5232/statistics

Response samples

Content type
application/json
{
  • "detector": {
    },
  • "detector_list": {
    },
  • "detector_settings": {
    },
  • "image_format_settings": {
    },
  • "instrument_metadata": {
    },
  • "file_writer_settings": {
    },
  • "data_processing_settings": {
    },
  • "measurement": {
    },
  • "broker": {
    },
  • "fpga": [
    ],
  • "calibration": [
    ],
  • "zeromq_preview": {
    },
  • "zeromq_metadata": {
    },
  • "dark_mask": {
    },
  • "pixel_mask": {
    },
  • "roi": {
    },
  • "az_int": {
    },
  • "buffer": {
    },
  • "indexing": {
    }
}

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_written": 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",
  • "error_pixels": 0.1,
  • "saturated_pixels": 0.1,
  • "roi_beam_pixels": 0.1,
  • "roi_beam_sum": 0.1
}

Get calibration statistics

Statistics are provided for each module/storage cell separately

+
http://localhost:5232/statistics/data_collection

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_written": 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",
  • "error_pixels": 0.1,
  • "saturated_pixels": 0.1,
  • "roi_beam_pixels": 0.1,
  • "roi_beam_sum": 0.1
}

Get calibration statistics

Statistics are provided for each module/storage cell separately

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get mask of the detector (binary)

Detector must be Initialized. +

http://localhost:5232/statistics/calibration

Response samples

Content type
application/json
[
  • {
    }
]

Get mask of the detector (binary)

Detector must be Initialized. Get full pixel mask of the detector. See NXmx standard for meaning of pixel values.

Responses

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

Responses

Response samples

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

Get mask of the detector (TIFF)

Should be in Idle state. +

http://localhost:5232/config/user_mask

Response samples

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

Get mask of the detector (TIFF)

Should be in Idle state. Get full pixel mask of the detector See NXmx standard for meaning of pixel values

Responses

Request Body schema: image/tiff
string <binary>

Responses

Response samples

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

Get pedestal in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

+
http://localhost:5232/config/user_mask.tiff

Response samples

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

Get pedestal in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

sc
integer

Storage cell number

Responses

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "unit_x": "image_number",
  • "size_x": 0.1,
  • "size_y": 0.1,
  • "plot": [
    ]
}

Generate 1D plot from Jungfraujoch and send in raw binary format. +

http://localhost:5232/preview/plot

Response samples

Content type
application/json
{
  • "title": "string",
  • "unit_x": "image_number",
  • "size_x": 0.1,
  • "size_y": 0.1,
  • "plot": [
    ]
}

Generate 1D plot from Jungfraujoch and send in raw binary format. Data are provided as (32-bit) float binary array. This format doesn't transmit information about X-axis, only values, so it is of limited use for azimuthal integration.

query Parameters
type
required
string
Enum: "bkg_estimate" "azint" "azint_1d" "spot_count" "spot_count_low_res" "spot_count_indexed" "spot_count_ice" "indexing_rate" "indexing_time" "indexing_unit_cell_length" "indexing_unit_cell_angle" "profile_radius" "mosaicity" "b_factor" "error_pixels" "saturated_pixels" "image_collection_efficiency" "receiver_delay" "receiver_free_send_buf" "strong_pixels" "roi_sum" "roi_mean" "roi_max_count" "roi_pixels" "roi_weighted_x" "roi_weighted_y" "packets_received" "max_pixel_value" "resolution_estimate" "pixel_sum" "processing_time" "beam_center_x" "beam_center_y"

Type of requested plot

@@ -866,18 +869,18 @@ This format doesn't transmit information about X-axis, only values, so it i

Response samples

Content type
application/json
{
  • "file_prefix": "string",
  • "rotation_unit_cell": {
    },
  • "rotation_crystal_lattice": [
    ],
  • "images": [
    ]
}

Get Start message in CBOR format

Contains metadata for a dataset (e.g., experimental geometry)

+
http://localhost:5232/result/scan

Response samples

Content type
application/json
{
  • "file_prefix": "string",
  • "rotation_unit_cell": {
    },
  • "rotation_crystal_lattice": [
    ],
  • "images": [
    ]
}

Get Start message in CBOR format

Contains metadata for a dataset (e.g., experimental geometry)

Responses

Response samples

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

Get image message in CBOR format

Contains full image data and metadata. The image must come from the latest data collection.

+
http://localhost:5232/image_buffer/start.cbor

Response samples

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

Get image message in CBOR format

Contains full image data and metadata. The image must come from the latest data collection.

query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

Responses

Response samples

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

Get preview image in JPEG format using custom settings

query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

+
http://localhost:5232/image_buffer/image.cbor

Response samples

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

Get preview image in JPEG format using custom settings

query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

show_user_mask
boolean
Default: false

Show user mask

show_roi
boolean
Default: false

Show ROI areas on the image

show_spots
boolean
Default: true

Show spot finding results on the image

@@ -892,7 +895,7 @@ This format doesn't transmit information about X-axis, only values, so it i

Response samples

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

Get preview image in TIFF format

query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

+
http://localhost:5232/image_buffer/image.jpeg

Response samples

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

Get preview image in TIFF format

query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

Responses

Response samples

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

Get status of the image buffers

Can be run at any stage of Jungfraujoch operation, including during data collection. +

http://localhost:5232/image_buffer/clear

Response samples

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

Get status of the image buffers

Can be run at any stage of Jungfraujoch operation, including during data collection. The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, then image might be replaced in the buffer between calling /images and /image.cbor.

Responses

Response samples

Content type
application/json
{
  • "min_image_number": 0,
  • "max_image_number": 0,
  • "image_numbers": [
    ],
  • "total_slots": 0,
  • "available_slots": 0,
  • "in_preparation_slots": 0,
  • "in_sending_slots": 0,
  • "current_counter": 0
}

Get Jungfraujoch version of jfjoch_broker

Responses

Response samples

Content type
application/json
{
  • "min_image_number": 0,
  • "max_image_number": 0,
  • "image_numbers": [
    ],
  • "total_slots": 0,
  • "available_slots": 0,
  • "in_preparation_slots": 0,
  • "in_sending_slots": 0,
  • "current_counter": 0
}

Get Jungfraujoch version of jfjoch_broker

Responses