diff --git a/broker/gen/model/Analysis_mode.cpp b/broker/gen/model/Analysis_mode.cpp new file mode 100644 index 000000000..565400ed5 --- /dev/null +++ b/broker/gen/model/Analysis_mode.cpp @@ -0,0 +1,134 @@ +/** +* 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.167 +* 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 "Analysis_mode.h" +#include "Helpers.h" +#include +#include + +namespace org::openapitools::server::model +{ + +Analysis_mode::Analysis_mode() +{ + +} + +void Analysis_mode::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Analysis_mode::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Analysis_mode::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Analysis_mode" : pathPrefix; + + + if (m_value == Analysis_mode::eAnalysis_mode::INVALID_VALUE_OPENAPI_GENERATED) + { + success = false; + msg << _pathPrefix << ": has no value;"; + } + + return success; +} + +bool Analysis_mode::operator==(const Analysis_mode& rhs) const +{ + return + getValue() == rhs.getValue() + + ; +} + +bool Analysis_mode::operator!=(const Analysis_mode& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Analysis_mode& o) +{ + j = nlohmann::json::object(); + + switch (o.getValue()) + { + case Analysis_mode::eAnalysis_mode::INVALID_VALUE_OPENAPI_GENERATED: + j = "INVALID_VALUE_OPENAPI_GENERATED"; + break; + case Analysis_mode::eAnalysis_mode::NONE: + j = "None"; + break; + case Analysis_mode::eAnalysis_mode::MXSTILLS: + j = "MXStills"; + break; + case Analysis_mode::eAnalysis_mode::AZINT: + j = "Azint"; + break; + case Analysis_mode::eAnalysis_mode::GRID: + j = "Grid"; + break; + case Analysis_mode::eAnalysis_mode::POWDERCALIBRATION: + j = "PowderCalibration"; + break; + } +} + +void from_json(const nlohmann::json& j, Analysis_mode& o) +{ + + auto s = j.get(); + if (s == "None") { + o.setValue(Analysis_mode::eAnalysis_mode::NONE); + } + else if (s == "MXStills") { + o.setValue(Analysis_mode::eAnalysis_mode::MXSTILLS); + } + else if (s == "Azint") { + o.setValue(Analysis_mode::eAnalysis_mode::AZINT); + } + else if (s == "Grid") { + o.setValue(Analysis_mode::eAnalysis_mode::GRID); + } + else if (s == "PowderCalibration") { + o.setValue(Analysis_mode::eAnalysis_mode::POWDERCALIBRATION); + } else { + std::stringstream ss; + ss << "Unexpected value " << s << " in json" + << " cannot be converted to enum of type" + << " Analysis_mode::eAnalysis_mode"; + throw std::invalid_argument(ss.str()); + } + +} + +Analysis_mode::eAnalysis_mode Analysis_mode::getValue() const +{ + return m_value; +} +void Analysis_mode::setValue(Analysis_mode::eAnalysis_mode value) +{ + m_value = value; +} + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Analysis_mode.h b/broker/gen/model/Analysis_mode.h new file mode 100644 index 000000000..c38eb4997 --- /dev/null +++ b/broker/gen/model/Analysis_mode.h @@ -0,0 +1,82 @@ +/** +* 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.167 +* 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. +*/ +/* + * Analysis_mode.h + * + * What analysis jfjoch_broker runs over the images. One setting replaces the several independent switches - spot finding on/off in two places, indexing on/off, rotation on/off - that used to be composed at each site into an answer nobody had written down. None - images are received, written and streamed; nothing is analysed. MXStills - spot finding, per-image indexing, refinement and integration. The default, and what an out-of-the-box broker has always done. Azint - azimuthal integration only; no spots are found. Grid - grid scan: per-image scoring and crystal selection. PowderCalibration - detector geometry from a calibrant's powder rings. Forces azimuthal integration onto the CPU, since the FPGA core cannot hold enough bins for the sectored profile a ring fit needs; a calibration exposure is a few images at a few Hz, so the cost does not matter. Rotation MX analysis is deliberately absent: jfjoch_broker has no rotation analysis path, so this API cannot express it. Rotation data is collected here and processed offline with rugnux. + */ + +#ifndef Analysis_mode_H_ +#define Analysis_mode_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// What analysis jfjoch_broker runs over the images. One setting replaces the several independent switches - spot finding on/off in two places, indexing on/off, rotation on/off - that used to be composed at each site into an answer nobody had written down. None - images are received, written and streamed; nothing is analysed. MXStills - spot finding, per-image indexing, refinement and integration. The default, and what an out-of-the-box broker has always done. Azint - azimuthal integration only; no spots are found. Grid - grid scan: per-image scoring and crystal selection. PowderCalibration - detector geometry from a calibrant's powder rings. Forces azimuthal integration onto the CPU, since the FPGA core cannot hold enough bins for the sectored profile a ring fit needs; a calibration exposure is a few images at a few Hz, so the cost does not matter. Rotation MX analysis is deliberately absent: jfjoch_broker has no rotation analysis path, so this API cannot express it. Rotation data is collected here and processed offline with rugnux. +/// +class Analysis_mode +{ +public: + Analysis_mode(); + virtual ~Analysis_mode() = default; + + enum class eAnalysis_mode { + // To have a valid default value. + // Avoiding name clashes with user defined + // enum values + INVALID_VALUE_OPENAPI_GENERATED = 0, + NONE, + MXSTILLS, + AZINT, + GRID, + POWDERCALIBRATION + }; + + /// + /// 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 Analysis_mode& rhs) const; + bool operator!=(const Analysis_mode& rhs) const; + + ///////////////////////////////////////////// + /// Analysis_mode members + + Analysis_mode::eAnalysis_mode getValue() const; + void setValue(Analysis_mode::eAnalysis_mode value); + + friend void to_json(nlohmann::json& j, const Analysis_mode& o); + friend void from_json(const nlohmann::json& j, Analysis_mode& o); +protected: + Analysis_mode::eAnalysis_mode m_value = Analysis_mode::eAnalysis_mode::INVALID_VALUE_OPENAPI_GENERATED; +}; + +} // namespace org::openapitools::server::model + +#endif /* Analysis_mode_H_ */ diff --git a/broker/gen/model/Analysis_settings.cpp b/broker/gen/model/Analysis_settings.cpp new file mode 100644 index 000000000..60c3e9930 --- /dev/null +++ b/broker/gen/model/Analysis_settings.cpp @@ -0,0 +1,90 @@ +/** +* 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.167 +* 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 "Analysis_settings.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Analysis_settings::Analysis_settings() +{ + +} + +void Analysis_settings::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Analysis_settings::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Analysis_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Analysis_settings" : pathPrefix; + + + return success; +} + +bool Analysis_settings::operator==(const Analysis_settings& rhs) const +{ + return + + + (getMode() == rhs.getMode()) + + + ; +} + +bool Analysis_settings::operator!=(const Analysis_settings& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Analysis_settings& o) +{ + j = nlohmann::json::object(); + j["mode"] = o.m_Mode; + +} + +void from_json(const nlohmann::json& j, Analysis_settings& o) +{ + j.at("mode").get_to(o.m_Mode); + +} + +org::openapitools::server::model::Analysis_mode Analysis_settings::getMode() const +{ + return m_Mode; +} +void Analysis_settings::setMode(org::openapitools::server::model::Analysis_mode const& value) +{ + m_Mode = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Analysis_settings.h b/broker/gen/model/Analysis_settings.h new file mode 100644 index 000000000..7e36b94ce --- /dev/null +++ b/broker/gen/model/Analysis_settings.h @@ -0,0 +1,77 @@ +/** +* 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.167 +* 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. +*/ +/* + * Analysis_settings.h + * + * What every analysis method shares, and nothing else. Each method's own parameters have their own settings object and their own endpoint - grid_scan_analysis_settings (/config/grid_scan_analysis), calibration_settings (/config/calibration) - so that adding a parameter to one method does not widen the structure every method reads. Persistent: it survives a data collection, unlike the per-dataset settings given to /start. + */ + +#ifndef Analysis_settings_H_ +#define Analysis_settings_H_ + + +#include "Analysis_mode.h" +#include + +namespace org::openapitools::server::model +{ + +/// +/// What every analysis method shares, and nothing else. Each method's own parameters have their own settings object and their own endpoint - grid_scan_analysis_settings (/config/grid_scan_analysis), calibration_settings (/config/calibration) - so that adding a parameter to one method does not widen the structure every method reads. Persistent: it survives a data collection, unlike the per-dataset settings given to /start. +/// +class Analysis_settings +{ +public: + Analysis_settings(); + virtual ~Analysis_settings() = 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 Analysis_settings& rhs) const; + bool operator!=(const Analysis_settings& rhs) const; + + ///////////////////////////////////////////// + /// Analysis_settings members + + /// + /// + /// + org::openapitools::server::model::Analysis_mode getMode() const; + void setMode(org::openapitools::server::model::Analysis_mode const& value); + + friend void to_json(nlohmann::json& j, const Analysis_settings& o); + friend void from_json(const nlohmann::json& j, Analysis_settings& o); +protected: + org::openapitools::server::model::Analysis_mode m_Mode; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Analysis_settings_H_ */ diff --git a/broker/gen/model/Calibration_method.cpp b/broker/gen/model/Calibration_method.cpp new file mode 100644 index 000000000..703639d95 --- /dev/null +++ b/broker/gen/model/Calibration_method.cpp @@ -0,0 +1,116 @@ +/** +* 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.167 +* 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 "Calibration_method.h" +#include "Helpers.h" +#include +#include + +namespace org::openapitools::server::model +{ + +Calibration_method::Calibration_method() +{ + +} + +void Calibration_method::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Calibration_method::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Calibration_method::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Calibration_method" : pathPrefix; + + + if (m_value == Calibration_method::eCalibration_method::INVALID_VALUE_OPENAPI_GENERATED) + { + success = false; + msg << _pathPrefix << ": has no value;"; + } + + return success; +} + +bool Calibration_method::operator==(const Calibration_method& rhs) const +{ + return + getValue() == rhs.getValue() + + ; +} + +bool Calibration_method::operator!=(const Calibration_method& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Calibration_method& o) +{ + j = nlohmann::json::object(); + + switch (o.getValue()) + { + case Calibration_method::eCalibration_method::INVALID_VALUE_OPENAPI_GENERATED: + j = "INVALID_VALUE_OPENAPI_GENERATED"; + break; + case Calibration_method::eCalibration_method::RINGS: + j = "Rings"; + break; + case Calibration_method::eCalibration_method::SPOTS: + j = "Spots"; + break; + } +} + +void from_json(const nlohmann::json& j, Calibration_method& o) +{ + + auto s = j.get(); + if (s == "Rings") { + o.setValue(Calibration_method::eCalibration_method::RINGS); + } + else if (s == "Spots") { + o.setValue(Calibration_method::eCalibration_method::SPOTS); + } else { + std::stringstream ss; + ss << "Unexpected value " << s << " in json" + << " cannot be converted to enum of type" + << " Calibration_method::eCalibration_method"; + throw std::invalid_argument(ss.str()); + } + +} + +Calibration_method::eCalibration_method Calibration_method::getValue() const +{ + return m_value; +} +void Calibration_method::setValue(Calibration_method::eCalibration_method value) +{ + m_value = value; +} + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Calibration_method.h b/broker/gen/model/Calibration_method.h new file mode 100644 index 000000000..cfe04d138 --- /dev/null +++ b/broker/gen/model/Calibration_method.h @@ -0,0 +1,79 @@ +/** +* 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.167 +* 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. +*/ +/* + * Calibration_method.h + * + * How the powder rings the detector geometry is fitted to are measured. Rings - the run-summed (q x azimuth) azimuthal profile: the ring measured at every azimuth. Spots - the pooled per-image spot lists: the ring sampled wherever the spot finder bit. + */ + +#ifndef Calibration_method_H_ +#define Calibration_method_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// How the powder rings the detector geometry is fitted to are measured. Rings - the run-summed (q x azimuth) azimuthal profile: the ring measured at every azimuth. Spots - the pooled per-image spot lists: the ring sampled wherever the spot finder bit. +/// +class Calibration_method +{ +public: + Calibration_method(); + virtual ~Calibration_method() = default; + + enum class eCalibration_method { + // To have a valid default value. + // Avoiding name clashes with user defined + // enum values + INVALID_VALUE_OPENAPI_GENERATED = 0, + RINGS, + SPOTS + }; + + /// + /// 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 Calibration_method& rhs) const; + bool operator!=(const Calibration_method& rhs) const; + + ///////////////////////////////////////////// + /// Calibration_method members + + Calibration_method::eCalibration_method getValue() const; + void setValue(Calibration_method::eCalibration_method value); + + friend void to_json(nlohmann::json& j, const Calibration_method& o); + friend void from_json(const nlohmann::json& j, Calibration_method& o); +protected: + Calibration_method::eCalibration_method m_value = Calibration_method::eCalibration_method::INVALID_VALUE_OPENAPI_GENERATED; +}; + +} // namespace org::openapitools::server::model + +#endif /* Calibration_method_H_ */ diff --git a/broker/gen/model/Calibration_settings.cpp b/broker/gen/model/Calibration_settings.cpp new file mode 100644 index 000000000..6a1280ac4 --- /dev/null +++ b/broker/gen/model/Calibration_settings.cpp @@ -0,0 +1,119 @@ +/** +* 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.167 +* 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 "Calibration_settings.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Calibration_settings::Calibration_settings() +{ + m_Calibrant = ""; + m_CalibrantIsSet = false; + +} + +void Calibration_settings::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Calibration_settings::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Calibration_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Calibration_settings" : pathPrefix; + + + return success; +} + +bool Calibration_settings::operator==(const Calibration_settings& rhs) const +{ + return + + + + ((!calibrantIsSet() && !rhs.calibrantIsSet()) || (calibrantIsSet() && rhs.calibrantIsSet() && getCalibrant() == rhs.getCalibrant())) && + + (getMethod() == rhs.getMethod()) + + + ; +} + +bool Calibration_settings::operator!=(const Calibration_settings& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Calibration_settings& o) +{ + j = nlohmann::json::object(); + if(o.calibrantIsSet()) + j["calibrant"] = o.m_Calibrant; + j["method"] = o.m_Method; + +} + +void from_json(const nlohmann::json& j, Calibration_settings& o) +{ + if(j.find("calibrant") != j.end()) + { + j.at("calibrant").get_to(o.m_Calibrant); + o.m_CalibrantIsSet = true; + } + j.at("method").get_to(o.m_Method); + +} + +std::string Calibration_settings::getCalibrant() const +{ + return m_Calibrant; +} +void Calibration_settings::setCalibrant(std::string const& value) +{ + m_Calibrant = value; + m_CalibrantIsSet = true; +} +bool Calibration_settings::calibrantIsSet() const +{ + return m_CalibrantIsSet; +} +void Calibration_settings::unsetCalibrant() +{ + m_CalibrantIsSet = false; +} +org::openapitools::server::model::Calibration_method Calibration_settings::getMethod() const +{ + return m_Method; +} +void Calibration_settings::setMethod(org::openapitools::server::model::Calibration_method const& value) +{ + m_Method = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Calibration_settings.h b/broker/gen/model/Calibration_settings.h new file mode 100644 index 000000000..76e3a1961 --- /dev/null +++ b/broker/gen/model/Calibration_settings.h @@ -0,0 +1,87 @@ +/** +* 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.167 +* 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. +*/ +/* + * Calibration_settings.h + * + * Settings for analysis mode PowderCalibration and nothing else. Selecting that mode also moves azimuthal integration onto the CPU and, where fewer than four azimuthal sectors were asked for, sets a usable count. Ring positions are read off a (q x azimuth) profile, and the FPGA integration core holds 2048 bins in total - at 32 sectors that leaves 64 q bins, far too coarse to locate a ring. The frame rate this costs is not frame rate a calibration exposure needs. + */ + +#ifndef Calibration_settings_H_ +#define Calibration_settings_H_ + + +#include +#include "Calibration_method.h" +#include + +namespace org::openapitools::server::model +{ + +/// +/// Settings for analysis mode PowderCalibration and nothing else. Selecting that mode also moves azimuthal integration onto the CPU and, where fewer than four azimuthal sectors were asked for, sets a usable count. Ring positions are read off a (q x azimuth) profile, and the FPGA integration core holds 2048 bins in total - at 32 sectors that leaves 64 q bins, far too coarse to locate a ring. The frame rate this costs is not frame rate a calibration exposure needs. +/// +class Calibration_settings +{ +public: + Calibration_settings(); + virtual ~Calibration_settings() = 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 Calibration_settings& rhs) const; + bool operator!=(const Calibration_settings& rhs) const; + + ///////////////////////////////////////////// + /// Calibration_settings members + + /// + /// Which calibrant's ring d-spacings the geometry is fitted against. Empty selects the processing program's own default rather than meaning \"no calibrant\". + /// + std::string getCalibrant() const; + void setCalibrant(std::string const& value); + bool calibrantIsSet() const; + void unsetCalibrant(); + /// + /// + /// + org::openapitools::server::model::Calibration_method getMethod() const; + void setMethod(org::openapitools::server::model::Calibration_method const& value); + + friend void to_json(nlohmann::json& j, const Calibration_settings& o); + friend void from_json(const nlohmann::json& j, Calibration_settings& o); +protected: + std::string m_Calibrant; + bool m_CalibrantIsSet; + org::openapitools::server::model::Calibration_method m_Method; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Calibration_settings_H_ */ diff --git a/broker/gen/model/Dataset_settings.h b/broker/gen/model/Dataset_settings.h index fc1245771..0fc5fa0f2 100644 --- a/broker/gen/model/Dataset_settings.h +++ b/broker/gen/model/Dataset_settings.h @@ -302,7 +302,7 @@ public: bool unitCellIsSet() const; void unsetUnit_cell(); /// - /// Enable spot finding and save spots + /// Enable spot finding and save spots. DEPRECATED - use the analysis mode instead (/config/analysis). The mode takes precedence: a mode that analyses no spots (None, Azint, PowderCalibration) switches spot finding off whatever this says, and under a mode that does find spots this remains a finer control that can still turn it off. It is kept while callers move over. /// bool isSpotFinding() const; void setSpotFinding(bool const value); diff --git a/broker/gen/model/Grid_scan_analysis_settings.cpp b/broker/gen/model/Grid_scan_analysis_settings.cpp new file mode 100644 index 000000000..102cf4565 --- /dev/null +++ b/broker/gen/model/Grid_scan_analysis_settings.cpp @@ -0,0 +1,213 @@ +/** +* 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.167 +* 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 "Grid_scan_analysis_settings.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Grid_scan_analysis_settings::Grid_scan_analysis_settings() +{ + m_Protein_score_threshold = 0.5f; + m_Min_blob_cells = 3L; + m_Decisive_single_cell_score = 0.9f; + m_Max_crystals = 10L; + m_Indexing = true; + +} + +void Grid_scan_analysis_settings::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Grid_scan_analysis_settings::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Grid_scan_analysis_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan_analysis_settings" : pathPrefix; + + + + /* Protein_score_threshold */ { + const float& value = m_Protein_score_threshold; + const std::string currentValuePath = _pathPrefix + ".proteinScoreThreshold"; + + + if (value < static_cast(0)) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + if (value > static_cast(1)) + { + success = false; + msg << currentValuePath << ": must be less than or equal to 1;"; + } + + } + + + /* Min_blob_cells */ { + const int64_t& value = m_Min_blob_cells; + const std::string currentValuePath = _pathPrefix + ".minBlobCells"; + + + if (value < 1ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 1;"; + } + + } + + + /* Decisive_single_cell_score */ { + const float& value = m_Decisive_single_cell_score; + const std::string currentValuePath = _pathPrefix + ".decisiveSingleCellScore"; + + + if (value < static_cast(0)) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + if (value > static_cast(1)) + { + success = false; + msg << currentValuePath << ": must be less than or equal to 1;"; + } + + } + + + /* Max_crystals */ { + const int64_t& value = m_Max_crystals; + const std::string currentValuePath = _pathPrefix + ".maxCrystals"; + + + if (value < 1ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 1;"; + } + + } + + return success; +} + +bool Grid_scan_analysis_settings::operator==(const Grid_scan_analysis_settings& rhs) const +{ + return + + + (getProteinScoreThreshold() == rhs.getProteinScoreThreshold()) + && + + (getMinBlobCells() == rhs.getMinBlobCells()) + && + + (getDecisiveSingleCellScore() == rhs.getDecisiveSingleCellScore()) + && + + (getMaxCrystals() == rhs.getMaxCrystals()) + && + + (isIndexing() == rhs.isIndexing()) + + + ; +} + +bool Grid_scan_analysis_settings::operator!=(const Grid_scan_analysis_settings& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Grid_scan_analysis_settings& o) +{ + j = nlohmann::json::object(); + j["protein_score_threshold"] = o.m_Protein_score_threshold; + j["min_blob_cells"] = o.m_Min_blob_cells; + j["decisive_single_cell_score"] = o.m_Decisive_single_cell_score; + j["max_crystals"] = o.m_Max_crystals; + j["indexing"] = o.m_Indexing; + +} + +void from_json(const nlohmann::json& j, Grid_scan_analysis_settings& o) +{ + j.at("protein_score_threshold").get_to(o.m_Protein_score_threshold); + j.at("min_blob_cells").get_to(o.m_Min_blob_cells); + j.at("decisive_single_cell_score").get_to(o.m_Decisive_single_cell_score); + j.at("max_crystals").get_to(o.m_Max_crystals); + j.at("indexing").get_to(o.m_Indexing); + +} + +float Grid_scan_analysis_settings::getProteinScoreThreshold() const +{ + return m_Protein_score_threshold; +} +void Grid_scan_analysis_settings::setProteinScoreThreshold(float const value) +{ + m_Protein_score_threshold = value; +} +int64_t Grid_scan_analysis_settings::getMinBlobCells() const +{ + return m_Min_blob_cells; +} +void Grid_scan_analysis_settings::setMinBlobCells(int64_t const value) +{ + m_Min_blob_cells = value; +} +float Grid_scan_analysis_settings::getDecisiveSingleCellScore() const +{ + return m_Decisive_single_cell_score; +} +void Grid_scan_analysis_settings::setDecisiveSingleCellScore(float const value) +{ + m_Decisive_single_cell_score = value; +} +int64_t Grid_scan_analysis_settings::getMaxCrystals() const +{ + return m_Max_crystals; +} +void Grid_scan_analysis_settings::setMaxCrystals(int64_t const value) +{ + m_Max_crystals = value; +} +bool Grid_scan_analysis_settings::isIndexing() const +{ + return m_Indexing; +} +void Grid_scan_analysis_settings::setIndexing(bool const value) +{ + m_Indexing = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Grid_scan_analysis_settings.h b/broker/gen/model/Grid_scan_analysis_settings.h new file mode 100644 index 000000000..2b5a7c553 --- /dev/null +++ b/broker/gen/model/Grid_scan_analysis_settings.h @@ -0,0 +1,104 @@ +/** +* 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.167 +* 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. +*/ +/* + * Grid_scan_analysis_settings.h + * + * Settings for analysis mode Grid and nothing else: how the per-image protein score is turned into a list of crystals, and whether the raster indexes as well as scores. + */ + +#ifndef Grid_scan_analysis_settings_H_ +#define Grid_scan_analysis_settings_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// Settings for analysis mode Grid and nothing else: how the per-image protein score is turned into a list of crystals, and whether the raster indexes as well as scores. +/// +class Grid_scan_analysis_settings +{ +public: + Grid_scan_analysis_settings(); + virtual ~Grid_scan_analysis_settings() = 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 Grid_scan_analysis_settings& rhs) const; + bool operator!=(const Grid_scan_analysis_settings& rhs) const; + + ///////////////////////////////////////////// + /// Grid_scan_analysis_settings members + + /// + /// A raster cell counts as protein above this. The per-image protein score saturates, so this only has to separate \"something diffracted here\" from \"nothing did\". + /// + float getProteinScoreThreshold() const; + void setProteinScoreThreshold(float const value); + /// + /// How many cells above that threshold make a shape rather than a coincidence. Two cells can be the two ends of a single hit lying on a cell boundary; three is the smallest patch that is not. + /// + int64_t getMinBlobCells() const; + void setMinBlobCells(int64_t const value); + /// + /// ...unless one cell on its own is decisive. The rule above is about coincidences, and a lone cell scoring near the top of a saturating score is not one - a crystal smaller than the grid step lights exactly one cell, and refusing it would lose precisely the samples a fine raster is run to find. Set well above protein_score_threshold: this admits the obvious case, it does not lower the general threshold by the back door. + /// + float getDecisiveSingleCellScore() const; + void setDecisiveSingleCellScore(float const value); + /// + /// Most crystals reported. A raster over a loop full of shards can label dozens of blobs, and past the first few the list is no longer a ranking anyone acts on. Crystals are sorted by score, so this keeps the best. + /// + int64_t getMaxCrystals() const; + void setMaxCrystals(int64_t const value); + /// + /// Whether each raster cell is indexed as well as scored. On by default: a raster runs at up to 100 Hz, which the FFT indexer keeps up with, and it is additive - blobs are still found on the protein score, so indexing changes nothing about which cells are called crystals and only adds what was found in them. The lattice count per cell is the cheapest multi-lattice or cracked-crystal signal there is, and on a fixed-target serial experiment with a known cell a raster that indexes is most of the measurement. Turn it off for a very large raster where the GPU is the constraint. + /// + bool isIndexing() const; + void setIndexing(bool const value); + + friend void to_json(nlohmann::json& j, const Grid_scan_analysis_settings& o); + friend void from_json(const nlohmann::json& j, Grid_scan_analysis_settings& o); +protected: + float m_Protein_score_threshold; + + int64_t m_Min_blob_cells; + + float m_Decisive_single_cell_score; + + int64_t m_Max_crystals; + + bool m_Indexing; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Grid_scan_analysis_settings_H_ */ diff --git a/broker/gen/model/Grid_scan_crystal.cpp b/broker/gen/model/Grid_scan_crystal.cpp new file mode 100644 index 000000000..de4c81924 --- /dev/null +++ b/broker/gen/model/Grid_scan_crystal.cpp @@ -0,0 +1,380 @@ +/** +* 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.167 +* 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 "Grid_scan_crystal.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Grid_scan_crystal::Grid_scan_crystal() +{ + m_Nx = 0.0f; + m_Ny = 0.0f; + m_X_um = 0.0f; + m_X_umIsSet = false; + m_Y_um = 0.0f; + m_Y_umIsSet = false; + m_Image_number = 0L; + m_Image_numberIsSet = false; + m_Major_um = 0.0f; + m_Major_umIsSet = false; + m_Minor_um = 0.0f; + m_Minor_umIsSet = false; + m_Angle_deg = 0.0f; + m_Angle_degIsSet = false; + m_Score = 0.0f; + m_Ice_score = 0.0f; + m_Ice_scoreIsSet = false; + m_Res_A = 0.0f; + m_Res_AIsSet = false; + m_N_images = 0L; + m_N_imagesIsSet = false; + +} + +void Grid_scan_crystal::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Grid_scan_crystal::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Grid_scan_crystal::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan_crystal" : pathPrefix; + + + return success; +} + +bool Grid_scan_crystal::operator==(const Grid_scan_crystal& rhs) const +{ + return + + + (getNx() == rhs.getNx()) + && + + (getNy() == rhs.getNy()) + && + + + ((!xUmIsSet() && !rhs.xUmIsSet()) || (xUmIsSet() && rhs.xUmIsSet() && getXUm() == rhs.getXUm())) && + + + ((!yUmIsSet() && !rhs.yUmIsSet()) || (yUmIsSet() && rhs.yUmIsSet() && getYUm() == rhs.getYUm())) && + + + ((!imageNumberIsSet() && !rhs.imageNumberIsSet()) || (imageNumberIsSet() && rhs.imageNumberIsSet() && getImageNumber() == rhs.getImageNumber())) && + + + ((!majorUmIsSet() && !rhs.majorUmIsSet()) || (majorUmIsSet() && rhs.majorUmIsSet() && getMajorUm() == rhs.getMajorUm())) && + + + ((!minorUmIsSet() && !rhs.minorUmIsSet()) || (minorUmIsSet() && rhs.minorUmIsSet() && getMinorUm() == rhs.getMinorUm())) && + + + ((!angleDegIsSet() && !rhs.angleDegIsSet()) || (angleDegIsSet() && rhs.angleDegIsSet() && getAngleDeg() == rhs.getAngleDeg())) && + + (getScore() == rhs.getScore()) + && + + + ((!iceScoreIsSet() && !rhs.iceScoreIsSet()) || (iceScoreIsSet() && rhs.iceScoreIsSet() && getIceScore() == rhs.getIceScore())) && + + + ((!resAIsSet() && !rhs.resAIsSet()) || (resAIsSet() && rhs.resAIsSet() && getResA() == rhs.getResA())) && + + + ((!nImagesIsSet() && !rhs.nImagesIsSet()) || (nImagesIsSet() && rhs.nImagesIsSet() && getNImages() == rhs.getNImages())) + + ; +} + +bool Grid_scan_crystal::operator!=(const Grid_scan_crystal& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Grid_scan_crystal& o) +{ + j = nlohmann::json::object(); + j["nx"] = o.m_Nx; + j["ny"] = o.m_Ny; + if(o.xUmIsSet()) + j["x_um"] = o.m_X_um; + if(o.yUmIsSet()) + j["y_um"] = o.m_Y_um; + if(o.imageNumberIsSet()) + j["image_number"] = o.m_Image_number; + if(o.majorUmIsSet()) + j["major_um"] = o.m_Major_um; + if(o.minorUmIsSet()) + j["minor_um"] = o.m_Minor_um; + if(o.angleDegIsSet()) + j["angle_deg"] = o.m_Angle_deg; + j["score"] = o.m_Score; + if(o.iceScoreIsSet()) + j["ice_score"] = o.m_Ice_score; + if(o.resAIsSet()) + j["res_A"] = o.m_Res_A; + if(o.nImagesIsSet()) + j["n_images"] = o.m_N_images; + +} + +void from_json(const nlohmann::json& j, Grid_scan_crystal& o) +{ + j.at("nx").get_to(o.m_Nx); + j.at("ny").get_to(o.m_Ny); + if(j.find("x_um") != j.end()) + { + j.at("x_um").get_to(o.m_X_um); + o.m_X_umIsSet = true; + } + if(j.find("y_um") != j.end()) + { + j.at("y_um").get_to(o.m_Y_um); + o.m_Y_umIsSet = true; + } + if(j.find("image_number") != j.end()) + { + j.at("image_number").get_to(o.m_Image_number); + o.m_Image_numberIsSet = true; + } + if(j.find("major_um") != j.end()) + { + j.at("major_um").get_to(o.m_Major_um); + o.m_Major_umIsSet = true; + } + if(j.find("minor_um") != j.end()) + { + j.at("minor_um").get_to(o.m_Minor_um); + o.m_Minor_umIsSet = true; + } + if(j.find("angle_deg") != j.end()) + { + j.at("angle_deg").get_to(o.m_Angle_deg); + o.m_Angle_degIsSet = true; + } + j.at("score").get_to(o.m_Score); + if(j.find("ice_score") != j.end()) + { + j.at("ice_score").get_to(o.m_Ice_score); + o.m_Ice_scoreIsSet = true; + } + if(j.find("res_A") != j.end()) + { + j.at("res_A").get_to(o.m_Res_A); + o.m_Res_AIsSet = true; + } + if(j.find("n_images") != j.end()) + { + j.at("n_images").get_to(o.m_N_images); + o.m_N_imagesIsSet = true; + } + +} + +float Grid_scan_crystal::getNx() const +{ + return m_Nx; +} +void Grid_scan_crystal::setNx(float const value) +{ + m_Nx = value; +} +float Grid_scan_crystal::getNy() const +{ + return m_Ny; +} +void Grid_scan_crystal::setNy(float const value) +{ + m_Ny = value; +} +float Grid_scan_crystal::getXUm() const +{ + return m_X_um; +} +void Grid_scan_crystal::setXUm(float const value) +{ + m_X_um = value; + m_X_umIsSet = true; +} +bool Grid_scan_crystal::xUmIsSet() const +{ + return m_X_umIsSet; +} +void Grid_scan_crystal::unsetX_um() +{ + m_X_umIsSet = false; +} +float Grid_scan_crystal::getYUm() const +{ + return m_Y_um; +} +void Grid_scan_crystal::setYUm(float const value) +{ + m_Y_um = value; + m_Y_umIsSet = true; +} +bool Grid_scan_crystal::yUmIsSet() const +{ + return m_Y_umIsSet; +} +void Grid_scan_crystal::unsetY_um() +{ + m_Y_umIsSet = false; +} +int64_t Grid_scan_crystal::getImageNumber() const +{ + return m_Image_number; +} +void Grid_scan_crystal::setImageNumber(int64_t const value) +{ + m_Image_number = value; + m_Image_numberIsSet = true; +} +bool Grid_scan_crystal::imageNumberIsSet() const +{ + return m_Image_numberIsSet; +} +void Grid_scan_crystal::unsetImage_number() +{ + m_Image_numberIsSet = false; +} +float Grid_scan_crystal::getMajorUm() const +{ + return m_Major_um; +} +void Grid_scan_crystal::setMajorUm(float const value) +{ + m_Major_um = value; + m_Major_umIsSet = true; +} +bool Grid_scan_crystal::majorUmIsSet() const +{ + return m_Major_umIsSet; +} +void Grid_scan_crystal::unsetMajor_um() +{ + m_Major_umIsSet = false; +} +float Grid_scan_crystal::getMinorUm() const +{ + return m_Minor_um; +} +void Grid_scan_crystal::setMinorUm(float const value) +{ + m_Minor_um = value; + m_Minor_umIsSet = true; +} +bool Grid_scan_crystal::minorUmIsSet() const +{ + return m_Minor_umIsSet; +} +void Grid_scan_crystal::unsetMinor_um() +{ + m_Minor_umIsSet = false; +} +float Grid_scan_crystal::getAngleDeg() const +{ + return m_Angle_deg; +} +void Grid_scan_crystal::setAngleDeg(float const value) +{ + m_Angle_deg = value; + m_Angle_degIsSet = true; +} +bool Grid_scan_crystal::angleDegIsSet() const +{ + return m_Angle_degIsSet; +} +void Grid_scan_crystal::unsetAngle_deg() +{ + m_Angle_degIsSet = false; +} +float Grid_scan_crystal::getScore() const +{ + return m_Score; +} +void Grid_scan_crystal::setScore(float const value) +{ + m_Score = value; +} +float Grid_scan_crystal::getIceScore() const +{ + return m_Ice_score; +} +void Grid_scan_crystal::setIceScore(float const value) +{ + m_Ice_score = value; + m_Ice_scoreIsSet = true; +} +bool Grid_scan_crystal::iceScoreIsSet() const +{ + return m_Ice_scoreIsSet; +} +void Grid_scan_crystal::unsetIce_score() +{ + m_Ice_scoreIsSet = false; +} +float Grid_scan_crystal::getResA() const +{ + return m_Res_A; +} +void Grid_scan_crystal::setResA(float const value) +{ + m_Res_A = value; + m_Res_AIsSet = true; +} +bool Grid_scan_crystal::resAIsSet() const +{ + return m_Res_AIsSet; +} +void Grid_scan_crystal::unsetRes_A() +{ + m_Res_AIsSet = false; +} +int64_t Grid_scan_crystal::getNImages() const +{ + return m_N_images; +} +void Grid_scan_crystal::setNImages(int64_t const value) +{ + m_N_images = value; + m_N_imagesIsSet = true; +} +bool Grid_scan_crystal::nImagesIsSet() const +{ + return m_N_imagesIsSet; +} +void Grid_scan_crystal::unsetN_images() +{ + m_N_imagesIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Grid_scan_crystal.h b/broker/gen/model/Grid_scan_crystal.h new file mode 100644 index 000000000..56dbb19db --- /dev/null +++ b/broker/gen/model/Grid_scan_crystal.h @@ -0,0 +1,171 @@ +/** +* 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.167 +* 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. +*/ +/* + * Grid_scan_crystal.h + * + * One crystal found in a grid scan. + */ + +#ifndef Grid_scan_crystal_H_ +#define Grid_scan_crystal_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// One crystal found in a grid scan. +/// +class Grid_scan_crystal +{ +public: + Grid_scan_crystal(); + virtual ~Grid_scan_crystal() = 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 Grid_scan_crystal& rhs) const; + bool operator!=(const Grid_scan_crystal& rhs) const; + + ///////////////////////////////////////////// + /// Grid_scan_crystal members + + /// + /// Centre, fractional grid coordinate along the fast grid axis + /// + float getNx() const; + void setNx(float const value); + /// + /// Centre, fractional grid coordinate along the slow grid axis + /// + float getNy() const; + void setNy(float const value); + /// + /// Centre, signed offset along the fast grid axis, in micrometres + /// + float getXUm() const; + void setXUm(float const value); + bool xUmIsSet() const; + void unsetX_um(); + /// + /// Centre, signed offset along the slow grid axis, in micrometres + /// + float getYUm() const; + void setYUm(float const value); + bool yUmIsSet() const; + void unsetY_um(); + /// + /// The grid point at the centre, as an image ordinal + /// + int64_t getImageNumber() const; + void setImageNumber(int64_t const value); + bool imageNumberIsSet() const; + void unsetImage_number(); + /// + /// Extent along the crystal's major principal axis, in micrometres + /// + float getMajorUm() const; + void setMajorUm(float const value); + bool majorUmIsSet() const; + void unsetMajor_um(); + /// + /// Extent along its minor principal axis, in micrometres + /// + float getMinorUm() const; + void setMinorUm(float const value); + bool minorUmIsSet() const; + void unsetMinor_um(); + /// + /// Direction of the major axis from the +x grid axis, counter-clockwise, in degrees. This is an AXIS, not a direction: it lives in [0, 180) and wraps, so 179 and 0 are adjacent. Averaging two of these arithmetically across the wrap turns two nearly parallel needles into a right angle - combine them on the doubled angle (mean of 2*theta, halved), or not at all. + /// + float getAngleDeg() const; + void setAngleDeg(float const value); + bool angleDegIsSet() const; + void unsetAngle_deg(); + /// + /// Diffraction score the crystal was ranked on + /// + float getScore() const; + void setScore(float const value); + /// + /// Ice-ring score over the crystal's grid points + /// + float getIceScore() const; + void setIceScore(float const value); + bool iceScoreIsSet() const; + void unsetIce_score(); + /// + /// Resolution estimate over the crystal's grid points, in Angstrom + /// + float getResA() const; + void setResA(float const value); + bool resAIsSet() const; + void unsetRes_A(); + /// + /// Grid points that fell in this crystal + /// + int64_t getNImages() const; + void setNImages(int64_t const value); + bool nImagesIsSet() const; + void unsetN_images(); + + friend void to_json(nlohmann::json& j, const Grid_scan_crystal& o); + friend void from_json(const nlohmann::json& j, Grid_scan_crystal& o); +protected: + float m_Nx; + + float m_Ny; + + float m_X_um; + bool m_X_umIsSet; + float m_Y_um; + bool m_Y_umIsSet; + int64_t m_Image_number; + bool m_Image_numberIsSet; + float m_Major_um; + bool m_Major_umIsSet; + float m_Minor_um; + bool m_Minor_umIsSet; + float m_Angle_deg; + bool m_Angle_degIsSet; + float m_Score; + + float m_Ice_score; + bool m_Ice_scoreIsSet; + float m_Res_A; + bool m_Res_AIsSet; + int64_t m_N_images; + bool m_N_imagesIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Grid_scan_crystal_H_ */ diff --git a/broker/gen/model/Grid_scan_result.cpp b/broker/gen/model/Grid_scan_result.cpp new file mode 100644 index 000000000..968a1b5e8 --- /dev/null +++ b/broker/gen/model/Grid_scan_result.cpp @@ -0,0 +1,169 @@ +/** +* 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.167 +* 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 "Grid_scan_result.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Grid_scan_result::Grid_scan_result() +{ + m_Beam_size_x_um = 0.0f; + m_Beam_size_x_umIsSet = false; + m_Beam_size_y_um = 0.0f; + m_Beam_size_y_umIsSet = false; + +} + +void Grid_scan_result::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Grid_scan_result::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Grid_scan_result::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan_result" : pathPrefix; + + + + /* Crystals */ { + const std::vector& value = m_Crystals; + const std::string currentValuePath = _pathPrefix + ".crystals"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const org::openapitools::server::model::Grid_scan_crystal& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + success = value.validate(msg, currentValuePath + ".crystals") && success; + + i++; + } + } + + } + + return success; +} + +bool Grid_scan_result::operator==(const Grid_scan_result& rhs) const +{ + return + + + (getCrystals() == rhs.getCrystals()) + && + + + ((!beamSizeXUmIsSet() && !rhs.beamSizeXUmIsSet()) || (beamSizeXUmIsSet() && rhs.beamSizeXUmIsSet() && getBeamSizeXUm() == rhs.getBeamSizeXUm())) && + + + ((!beamSizeYUmIsSet() && !rhs.beamSizeYUmIsSet()) || (beamSizeYUmIsSet() && rhs.beamSizeYUmIsSet() && getBeamSizeYUm() == rhs.getBeamSizeYUm())) + + ; +} + +bool Grid_scan_result::operator!=(const Grid_scan_result& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Grid_scan_result& o) +{ + j = nlohmann::json::object(); + j["crystals"] = o.m_Crystals; + if(o.beamSizeXUmIsSet()) + j["beam_size_x_um"] = o.m_Beam_size_x_um; + if(o.beamSizeYUmIsSet()) + j["beam_size_y_um"] = o.m_Beam_size_y_um; + +} + +void from_json(const nlohmann::json& j, Grid_scan_result& o) +{ + j.at("crystals").get_to(o.m_Crystals); + if(j.find("beam_size_x_um") != j.end()) + { + j.at("beam_size_x_um").get_to(o.m_Beam_size_x_um); + o.m_Beam_size_x_umIsSet = true; + } + if(j.find("beam_size_y_um") != j.end()) + { + j.at("beam_size_y_um").get_to(o.m_Beam_size_y_um); + o.m_Beam_size_y_umIsSet = true; + } + +} + +std::vector Grid_scan_result::getCrystals() const +{ + return m_Crystals; +} +void Grid_scan_result::setCrystals(std::vector const& value) +{ + m_Crystals = value; +} +float Grid_scan_result::getBeamSizeXUm() const +{ + return m_Beam_size_x_um; +} +void Grid_scan_result::setBeamSizeXUm(float const value) +{ + m_Beam_size_x_um = value; + m_Beam_size_x_umIsSet = true; +} +bool Grid_scan_result::beamSizeXUmIsSet() const +{ + return m_Beam_size_x_umIsSet; +} +void Grid_scan_result::unsetBeam_size_x_um() +{ + m_Beam_size_x_umIsSet = false; +} +float Grid_scan_result::getBeamSizeYUm() const +{ + return m_Beam_size_y_um; +} +void Grid_scan_result::setBeamSizeYUm(float const value) +{ + m_Beam_size_y_um = value; + m_Beam_size_y_umIsSet = true; +} +bool Grid_scan_result::beamSizeYUmIsSet() const +{ + return m_Beam_size_y_umIsSet; +} +void Grid_scan_result::unsetBeam_size_y_um() +{ + m_Beam_size_y_umIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Grid_scan_result.h b/broker/gen/model/Grid_scan_result.h new file mode 100644 index 000000000..9032ba924 --- /dev/null +++ b/broker/gen/model/Grid_scan_result.h @@ -0,0 +1,96 @@ +/** +* 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.167 +* 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. +*/ +/* + * Grid_scan_result.h + * + * What a grid scan found. The list is sorted by score, best first, and may hold any number of crystals - a consumer must not assume at most one. + */ + +#ifndef Grid_scan_result_H_ +#define Grid_scan_result_H_ + + +#include "Grid_scan_crystal.h" +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// What a grid scan found. The list is sorted by score, best first, and may hold any number of crystals - a consumer must not assume at most one. +/// +class Grid_scan_result +{ +public: + Grid_scan_result(); + virtual ~Grid_scan_result() = 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 Grid_scan_result& rhs) const; + bool operator!=(const Grid_scan_result& rhs) const; + + ///////////////////////////////////////////// + /// Grid_scan_result members + + /// + /// + /// + std::vector getCrystals() const; + void setCrystals(std::vector const& value); + /// + /// The beam the crystal extents were measured with, along the fast grid axis. Those extents still contain it, so this says what a consumer has to take back out. + /// + float getBeamSizeXUm() const; + void setBeamSizeXUm(float const value); + bool beamSizeXUmIsSet() const; + void unsetBeam_size_x_um(); + /// + /// The same along the slow grid axis + /// + float getBeamSizeYUm() const; + void setBeamSizeYUm(float const value); + bool beamSizeYUmIsSet() const; + void unsetBeam_size_y_um(); + + friend void to_json(nlohmann::json& j, const Grid_scan_result& o); + friend void from_json(const nlohmann::json& j, Grid_scan_result& o); +protected: + std::vector m_Crystals; + + float m_Beam_size_x_um; + bool m_Beam_size_x_umIsSet; + float m_Beam_size_y_um; + bool m_Beam_size_y_umIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Grid_scan_result_H_ */ diff --git a/broker/gen/model/Jfjoch_settings.cpp b/broker/gen/model/Jfjoch_settings.cpp index 8cd7dbf59..7cc52880d 100644 --- a/broker/gen/model/Jfjoch_settings.cpp +++ b/broker/gen/model/Jfjoch_settings.cpp @@ -28,6 +28,9 @@ Jfjoch_settings::Jfjoch_settings() m_File_writerIsSet = false; m_IndexingIsSet = false; m_Bragg_integrationIsSet = false; + m_AnalysisIsSet = false; + m_Grid_scan_analysisIsSet = false; + m_Calibration_settingsIsSet = false; m_Detector_settingsIsSet = false; m_Azim_intIsSet = false; m_Image_formatIsSet = false; @@ -108,7 +111,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr } } - + if (imageBufferMiBIsSet()) { const int32_t& value = m_Image_buffer_MiB; @@ -175,6 +178,15 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const ((!braggIntegrationIsSet() && !rhs.braggIntegrationIsSet()) || (braggIntegrationIsSet() && rhs.braggIntegrationIsSet() && getBraggIntegration() == rhs.getBraggIntegration())) && + ((!analysisIsSet() && !rhs.analysisIsSet()) || (analysisIsSet() && rhs.analysisIsSet() && getAnalysis() == rhs.getAnalysis())) && + + + ((!gridScanAnalysisIsSet() && !rhs.gridScanAnalysisIsSet()) || (gridScanAnalysisIsSet() && rhs.gridScanAnalysisIsSet() && getGridScanAnalysis() == rhs.getGridScanAnalysis())) && + + + ((!calibrationSettingsIsSet() && !rhs.calibrationSettingsIsSet()) || (calibrationSettingsIsSet() && rhs.calibrationSettingsIsSet() && getCalibrationSettings() == rhs.getCalibrationSettings())) && + + ((!detectorSettingsIsSet() && !rhs.detectorSettingsIsSet()) || (detectorSettingsIsSet() && rhs.detectorSettingsIsSet() && getDetectorSettings() == rhs.getDetectorSettings())) && @@ -239,6 +251,12 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o) j["indexing"] = o.m_Indexing; if(o.braggIntegrationIsSet()) j["bragg_integration"] = o.m_Bragg_integration; + if(o.analysisIsSet()) + j["analysis"] = o.m_Analysis; + if(o.gridScanAnalysisIsSet()) + j["grid_scan_analysis"] = o.m_Grid_scan_analysis; + if(o.calibrationSettingsIsSet()) + j["calibration_settings"] = o.m_Calibration_settings; if(o.detectorSettingsIsSet()) j["detector_settings"] = o.m_Detector_settings; if(o.azimIntIsSet()) @@ -304,6 +322,21 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o) j.at("bragg_integration").get_to(o.m_Bragg_integration); o.m_Bragg_integrationIsSet = true; } + if(j.find("analysis") != j.end()) + { + j.at("analysis").get_to(o.m_Analysis); + o.m_AnalysisIsSet = true; + } + if(j.find("grid_scan_analysis") != j.end()) + { + j.at("grid_scan_analysis").get_to(o.m_Grid_scan_analysis); + o.m_Grid_scan_analysisIsSet = true; + } + if(j.find("calibration_settings") != j.end()) + { + j.at("calibration_settings").get_to(o.m_Calibration_settings); + o.m_Calibration_settingsIsSet = true; + } if(j.find("detector_settings") != j.end()) { j.at("detector_settings").get_to(o.m_Detector_settings); @@ -491,6 +524,57 @@ void Jfjoch_settings::unsetBragg_integration() { m_Bragg_integrationIsSet = false; } +org::openapitools::server::model::Analysis_settings Jfjoch_settings::getAnalysis() const +{ + return m_Analysis; +} +void Jfjoch_settings::setAnalysis(org::openapitools::server::model::Analysis_settings const& value) +{ + m_Analysis = value; + m_AnalysisIsSet = true; +} +bool Jfjoch_settings::analysisIsSet() const +{ + return m_AnalysisIsSet; +} +void Jfjoch_settings::unsetAnalysis() +{ + m_AnalysisIsSet = false; +} +org::openapitools::server::model::Grid_scan_analysis_settings Jfjoch_settings::getGridScanAnalysis() const +{ + return m_Grid_scan_analysis; +} +void Jfjoch_settings::setGridScanAnalysis(org::openapitools::server::model::Grid_scan_analysis_settings const& value) +{ + m_Grid_scan_analysis = value; + m_Grid_scan_analysisIsSet = true; +} +bool Jfjoch_settings::gridScanAnalysisIsSet() const +{ + return m_Grid_scan_analysisIsSet; +} +void Jfjoch_settings::unsetGrid_scan_analysis() +{ + m_Grid_scan_analysisIsSet = false; +} +org::openapitools::server::model::Calibration_settings Jfjoch_settings::getCalibrationSettings() const +{ + return m_Calibration_settings; +} +void Jfjoch_settings::setCalibrationSettings(org::openapitools::server::model::Calibration_settings const& value) +{ + m_Calibration_settings = value; + m_Calibration_settingsIsSet = true; +} +bool Jfjoch_settings::calibrationSettingsIsSet() const +{ + return m_Calibration_settingsIsSet; +} +void Jfjoch_settings::unsetCalibration_settings() +{ + m_Calibration_settingsIsSet = false; +} org::openapitools::server::model::Detector_settings Jfjoch_settings::getDetectorSettings() const { return m_Detector_settings; diff --git a/broker/gen/model/Jfjoch_settings.h b/broker/gen/model/Jfjoch_settings.h index 0a8cb53b3..35da62f56 100644 --- a/broker/gen/model/Jfjoch_settings.h +++ b/broker/gen/model/Jfjoch_settings.h @@ -32,11 +32,14 @@ #include "Zeromq_metadata_settings.h" #include "Detector_settings.h" #include +#include "Analysis_settings.h" #include "Indexing_settings.h" #include "Detector.h" #include "Image_pusher_type.h" +#include "Grid_scan_analysis_settings.h" #include "Zeromq_settings.h" #include "Instrument_metadata.h" +#include "Calibration_settings.h" #include namespace org::openapitools::server::model @@ -132,6 +135,27 @@ public: /// /// /// + org::openapitools::server::model::Analysis_settings getAnalysis() const; + void setAnalysis(org::openapitools::server::model::Analysis_settings const& value); + bool analysisIsSet() const; + void unsetAnalysis(); + /// + /// + /// + org::openapitools::server::model::Grid_scan_analysis_settings getGridScanAnalysis() const; + void setGridScanAnalysis(org::openapitools::server::model::Grid_scan_analysis_settings const& value); + bool gridScanAnalysisIsSet() const; + void unsetGrid_scan_analysis(); + /// + /// + /// + org::openapitools::server::model::Calibration_settings getCalibrationSettings() const; + void setCalibrationSettings(org::openapitools::server::model::Calibration_settings const& value); + bool calibrationSettingsIsSet() const; + void unsetCalibration_settings(); + /// + /// + /// org::openapitools::server::model::Detector_settings getDetectorSettings() const; void setDetectorSettings(org::openapitools::server::model::Detector_settings const& value); bool detectorSettingsIsSet() const; @@ -236,6 +260,12 @@ protected: bool m_IndexingIsSet; org::openapitools::server::model::Bragg_integration_settings m_Bragg_integration; bool m_Bragg_integrationIsSet; + org::openapitools::server::model::Analysis_settings m_Analysis; + bool m_AnalysisIsSet; + org::openapitools::server::model::Grid_scan_analysis_settings m_Grid_scan_analysis; + bool m_Grid_scan_analysisIsSet; + org::openapitools::server::model::Calibration_settings m_Calibration_settings; + bool m_Calibration_settingsIsSet; org::openapitools::server::model::Detector_settings m_Detector_settings; bool m_Detector_settingsIsSet; org::openapitools::server::model::Azim_int_settings m_Azim_int; diff --git a/broker/gen/model/Jfjoch_statistics.cpp b/broker/gen/model/Jfjoch_statistics.cpp index 81ed4c3c9..309e85fc3 100644 --- a/broker/gen/model/Jfjoch_statistics.cpp +++ b/broker/gen/model/Jfjoch_statistics.cpp @@ -41,6 +41,9 @@ Jfjoch_statistics::Jfjoch_statistics() m_BufferIsSet = false; m_IndexingIsSet = false; m_Bragg_integrationIsSet = false; + m_AnalysisIsSet = false; + m_Grid_scan_analysisIsSet = false; + m_Calibration_settingsIsSet = false; m_Image_pusherIsSet = false; } @@ -106,7 +109,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path } } - + return success; } @@ -176,6 +179,15 @@ bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const ((!braggIntegrationIsSet() && !rhs.braggIntegrationIsSet()) || (braggIntegrationIsSet() && rhs.braggIntegrationIsSet() && getBraggIntegration() == rhs.getBraggIntegration())) && + ((!analysisIsSet() && !rhs.analysisIsSet()) || (analysisIsSet() && rhs.analysisIsSet() && getAnalysis() == rhs.getAnalysis())) && + + + ((!gridScanAnalysisIsSet() && !rhs.gridScanAnalysisIsSet()) || (gridScanAnalysisIsSet() && rhs.gridScanAnalysisIsSet() && getGridScanAnalysis() == rhs.getGridScanAnalysis())) && + + + ((!calibrationSettingsIsSet() && !rhs.calibrationSettingsIsSet()) || (calibrationSettingsIsSet() && rhs.calibrationSettingsIsSet() && getCalibrationSettings() == rhs.getCalibrationSettings())) && + + ((!imagePusherIsSet() && !rhs.imagePusherIsSet()) || (imagePusherIsSet() && rhs.imagePusherIsSet() && getImagePusher() == rhs.getImagePusher())) ; @@ -229,6 +241,12 @@ void to_json(nlohmann::json& j, const Jfjoch_statistics& o) j["indexing"] = o.m_Indexing; if(o.braggIntegrationIsSet()) j["bragg_integration"] = o.m_Bragg_integration; + if(o.analysisIsSet()) + j["analysis"] = o.m_Analysis; + if(o.gridScanAnalysisIsSet()) + j["grid_scan_analysis"] = o.m_Grid_scan_analysis; + if(o.calibrationSettingsIsSet()) + j["calibration_settings"] = o.m_Calibration_settings; if(o.imagePusherIsSet()) j["image_pusher"] = o.m_Image_pusher; @@ -336,6 +354,21 @@ void from_json(const nlohmann::json& j, Jfjoch_statistics& o) j.at("bragg_integration").get_to(o.m_Bragg_integration); o.m_Bragg_integrationIsSet = true; } + if(j.find("analysis") != j.end()) + { + j.at("analysis").get_to(o.m_Analysis); + o.m_AnalysisIsSet = true; + } + if(j.find("grid_scan_analysis") != j.end()) + { + j.at("grid_scan_analysis").get_to(o.m_Grid_scan_analysis); + o.m_Grid_scan_analysisIsSet = true; + } + if(j.find("calibration_settings") != j.end()) + { + j.at("calibration_settings").get_to(o.m_Calibration_settings); + o.m_Calibration_settingsIsSet = true; + } if(j.find("image_pusher") != j.end()) { j.at("image_pusher").get_to(o.m_Image_pusher); @@ -684,6 +717,57 @@ void Jfjoch_statistics::unsetBragg_integration() { m_Bragg_integrationIsSet = false; } +org::openapitools::server::model::Analysis_settings Jfjoch_statistics::getAnalysis() const +{ + return m_Analysis; +} +void Jfjoch_statistics::setAnalysis(org::openapitools::server::model::Analysis_settings const& value) +{ + m_Analysis = value; + m_AnalysisIsSet = true; +} +bool Jfjoch_statistics::analysisIsSet() const +{ + return m_AnalysisIsSet; +} +void Jfjoch_statistics::unsetAnalysis() +{ + m_AnalysisIsSet = false; +} +org::openapitools::server::model::Grid_scan_analysis_settings Jfjoch_statistics::getGridScanAnalysis() const +{ + return m_Grid_scan_analysis; +} +void Jfjoch_statistics::setGridScanAnalysis(org::openapitools::server::model::Grid_scan_analysis_settings const& value) +{ + m_Grid_scan_analysis = value; + m_Grid_scan_analysisIsSet = true; +} +bool Jfjoch_statistics::gridScanAnalysisIsSet() const +{ + return m_Grid_scan_analysisIsSet; +} +void Jfjoch_statistics::unsetGrid_scan_analysis() +{ + m_Grid_scan_analysisIsSet = false; +} +org::openapitools::server::model::Calibration_settings Jfjoch_statistics::getCalibrationSettings() const +{ + return m_Calibration_settings; +} +void Jfjoch_statistics::setCalibrationSettings(org::openapitools::server::model::Calibration_settings const& value) +{ + m_Calibration_settings = value; + m_Calibration_settingsIsSet = true; +} +bool Jfjoch_statistics::calibrationSettingsIsSet() const +{ + return m_Calibration_settingsIsSet; +} +void Jfjoch_statistics::unsetCalibration_settings() +{ + m_Calibration_settingsIsSet = false; +} org::openapitools::server::model::Image_pusher_status Jfjoch_statistics::getImagePusher() const { return m_Image_pusher; diff --git a/broker/gen/model/Jfjoch_statistics.h b/broker/gen/model/Jfjoch_statistics.h index 7c28ea24e..6df5f2701 100644 --- a/broker/gen/model/Jfjoch_statistics.h +++ b/broker/gen/model/Jfjoch_statistics.h @@ -19,28 +19,31 @@ #define Jfjoch_statistics_H_ -#include "Calibration_statistics_inner.h" -#include "Broker_status.h" #include "Pixel_mask_statistics.h" #include "Measurement_statistics.h" -#include "Spot_finding_settings.h" #include "Zeromq_preview_settings.h" -#include "Detector_list.h" -#include "Dark_mask_settings.h" -#include "File_writer_settings.h" #include "Bragg_integration_settings.h" #include "Azim_int_settings.h" #include "Image_format_settings.h" #include "Zeromq_metadata_settings.h" +#include "Analysis_settings.h" +#include "Indexing_settings.h" +#include "Calibration_statistics_inner.h" +#include "Broker_status.h" +#include "Spot_finding_settings.h" +#include "Detector_list.h" +#include "Dark_mask_settings.h" +#include "File_writer_settings.h" #include "Detector_settings.h" #include -#include "Indexing_settings.h" #include "Detector_status.h" #include "Image_pusher_status.h" #include "Roi_definitions.h" #include "Fpga_status_inner.h" #include "Image_buffer_status.h" +#include "Grid_scan_analysis_settings.h" #include "Instrument_metadata.h" +#include "Calibration_settings.h" #include namespace org::openapitools::server::model @@ -222,6 +225,27 @@ public: /// /// /// + org::openapitools::server::model::Analysis_settings getAnalysis() const; + void setAnalysis(org::openapitools::server::model::Analysis_settings const& value); + bool analysisIsSet() const; + void unsetAnalysis(); + /// + /// + /// + org::openapitools::server::model::Grid_scan_analysis_settings getGridScanAnalysis() const; + void setGridScanAnalysis(org::openapitools::server::model::Grid_scan_analysis_settings const& value); + bool gridScanAnalysisIsSet() const; + void unsetGrid_scan_analysis(); + /// + /// + /// + org::openapitools::server::model::Calibration_settings getCalibrationSettings() const; + void setCalibrationSettings(org::openapitools::server::model::Calibration_settings const& value); + bool calibrationSettingsIsSet() const; + void unsetCalibration_settings(); + /// + /// + /// org::openapitools::server::model::Image_pusher_status getImagePusher() const; void setImagePusher(org::openapitools::server::model::Image_pusher_status const& value); bool imagePusherIsSet() const; @@ -270,6 +294,12 @@ protected: bool m_IndexingIsSet; org::openapitools::server::model::Bragg_integration_settings m_Bragg_integration; bool m_Bragg_integrationIsSet; + org::openapitools::server::model::Analysis_settings m_Analysis; + bool m_AnalysisIsSet; + org::openapitools::server::model::Grid_scan_analysis_settings m_Grid_scan_analysis; + bool m_Grid_scan_analysisIsSet; + org::openapitools::server::model::Calibration_settings m_Calibration_settings; + bool m_Calibration_settingsIsSet; org::openapitools::server::model::Image_pusher_status m_Image_pusher; bool m_Image_pusherIsSet; diff --git a/broker/gen/model/Scan_result.cpp b/broker/gen/model/Scan_result.cpp index 13bf9e9c5..9f6e2b06e 100644 --- a/broker/gen/model/Scan_result.cpp +++ b/broker/gen/model/Scan_result.cpp @@ -27,6 +27,8 @@ Scan_result::Scan_result() m_Rotation_crystal_latticeIsSet = false; m_Rotation_bravais = ""; m_Rotation_bravaisIsSet = false; + m_GridIsSet = false; + m_CalibrationIsSet = false; } @@ -80,7 +82,7 @@ bool Scan_result::validate(std::stringstream& msg, const std::string& pathPrefix } } - + /* Images */ { const std::vector& value = m_Images; @@ -122,6 +124,12 @@ bool Scan_result::operator==(const Scan_result& rhs) const ((!rotationBravaisIsSet() && !rhs.rotationBravaisIsSet()) || (rotationBravaisIsSet() && rhs.rotationBravaisIsSet() && getRotationBravais() == rhs.getRotationBravais())) && + + ((!gridIsSet() && !rhs.gridIsSet()) || (gridIsSet() && rhs.gridIsSet() && getGrid() == rhs.getGrid())) && + + + ((!calibrationIsSet() && !rhs.calibrationIsSet()) || (calibrationIsSet() && rhs.calibrationIsSet() && getCalibration() == rhs.getCalibration())) && + (getImages() == rhs.getImages()) @@ -144,6 +152,10 @@ void to_json(nlohmann::json& j, const Scan_result& o) j["rotation_crystal_lattice"] = o.m_Rotation_crystal_lattice; if(o.rotationBravaisIsSet()) j["rotation_bravais"] = o.m_Rotation_bravais; + if(o.gridIsSet()) + j["grid"] = o.m_Grid; + if(o.calibrationIsSet()) + j["calibration"] = o.m_Calibration; j["images"] = o.m_Images; } @@ -170,6 +182,16 @@ void from_json(const nlohmann::json& j, Scan_result& o) j.at("rotation_bravais").get_to(o.m_Rotation_bravais); o.m_Rotation_bravaisIsSet = true; } + if(j.find("grid") != j.end()) + { + j.at("grid").get_to(o.m_Grid); + o.m_GridIsSet = true; + } + if(j.find("calibration") != j.end()) + { + j.at("calibration").get_to(o.m_Calibration); + o.m_CalibrationIsSet = true; + } j.at("images").get_to(o.m_Images); } @@ -242,6 +264,40 @@ void Scan_result::unsetRotation_bravais() { m_Rotation_bravaisIsSet = false; } +org::openapitools::server::model::Grid_scan_result Scan_result::getGrid() const +{ + return m_Grid; +} +void Scan_result::setGrid(org::openapitools::server::model::Grid_scan_result const& value) +{ + m_Grid = value; + m_GridIsSet = true; +} +bool Scan_result::gridIsSet() const +{ + return m_GridIsSet; +} +void Scan_result::unsetGrid() +{ + m_GridIsSet = false; +} +org::openapitools::server::model::Powder_calibration_output Scan_result::getCalibration() const +{ + return m_Calibration; +} +void Scan_result::setCalibration(org::openapitools::server::model::Powder_calibration_output const& value) +{ + m_Calibration = value; + m_CalibrationIsSet = true; +} +bool Scan_result::calibrationIsSet() const +{ + return m_CalibrationIsSet; +} +void Scan_result::unsetCalibration() +{ + m_CalibrationIsSet = false; +} std::vector Scan_result::getImages() const { return m_Images; diff --git a/broker/gen/model/Scan_result.h b/broker/gen/model/Scan_result.h index 2b2dc832d..e38509364 100644 --- a/broker/gen/model/Scan_result.h +++ b/broker/gen/model/Scan_result.h @@ -20,8 +20,10 @@ #include "Scan_result_images_inner.h" +#include "Powder_calibration_output.h" #include "Unit_cell.h" #include +#include "Grid_scan_result.h" #include #include @@ -92,6 +94,20 @@ public: /// /// /// + org::openapitools::server::model::Grid_scan_result getGrid() const; + void setGrid(org::openapitools::server::model::Grid_scan_result const& value); + bool gridIsSet() const; + void unsetGrid(); + /// + /// + /// + org::openapitools::server::model::Powder_calibration_output getCalibration() const; + void setCalibration(org::openapitools::server::model::Powder_calibration_output const& value); + bool calibrationIsSet() const; + void unsetCalibration(); + /// + /// + /// std::vector getImages() const; void setImages(std::vector const& value); @@ -106,6 +122,10 @@ protected: bool m_Rotation_crystal_latticeIsSet; std::string m_Rotation_bravais; bool m_Rotation_bravaisIsSet; + org::openapitools::server::model::Grid_scan_result m_Grid; + bool m_GridIsSet; + org::openapitools::server::model::Powder_calibration_output m_Calibration; + bool m_CalibrationIsSet; std::vector m_Images; diff --git a/broker/gen/model/Spot_finding_settings.h b/broker/gen/model/Spot_finding_settings.h index bbcf3ff64..8f6721239 100644 --- a/broker/gen/model/Spot_finding_settings.h +++ b/broker/gen/model/Spot_finding_settings.h @@ -58,7 +58,7 @@ public: /// Spot_finding_settings members /// - /// 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. + /// 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. DEPRECATED - use the analysis mode instead (/config/analysis). The mode takes precedence: a mode that analyses no spots (None, Azint, PowderCalibration) switches spot finding off whatever this says, and under a mode that does find spots this remains a finer control that can still turn it off. It is kept while callers move over. /// bool isEnable() const; void setEnable(bool const value); diff --git a/broker/redoc-static.html b/broker/redoc-static.html index 7606a9b23..e32fdfaaf 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -55,6 +55,9 @@ data-styled.g14[id="sc-jlZhew"]{content:"kbdRLs,"}/*!sc*/ .hWEnWx{height:1.5em;width:1.5em;min-width:1.5em;vertical-align:middle;float:left;-webkit-transition:-webkit-transform 0.2s ease-out;-webkit-transition:transform 0.2s ease-out;transition:transform 0.2s ease-out;-webkit-transform:rotateZ(-90deg);-ms-transform:rotateZ(-90deg);transform:rotateZ(-90deg);}/*!sc*/ .hWEnWx polygon{fill:#1d8127;}/*!sc*/ data-styled.g15[id="sc-cwHptR"]{content:"cSkZlF,iVFMLx,ivsSRP,hWEnWx,"}/*!sc*/ +.gWyYnj{display:inline-block;padding:2px 8px;margin:0;background-color:#ffa500;color:#ffffff;font-size:13px;vertical-align:middle;line-height:1.6;border-radius:4px;font-weight:600;font-size:12px;}/*!sc*/ +.gWyYnj + span[type]{margin-left:4px;}/*!sc*/ +data-styled.g16[id="sc-jEACwC"]{content:"gWyYnj,"}/*!sc*/ .hZbWKe{border-left:1px solid #7c7cbb;box-sizing:border-box;position:relative;padding:10px 10px 10px 0;}/*!sc*/ @media screen and (max-width:50rem){.hZbWKe{display:block;overflow:hidden;}}/*!sc*/ tr:first-of-type > .sc-dLMFU,tr.last > .hZbWKe{border-left-width:0;background-position:top left;background-repeat:no-repeat;background-size:1px 100%;}/*!sc*/ @@ -367,7 +370,7 @@ data-styled.g138[id="sc-dxcDKg"]{content:"eajCCh,"}/*!sc*/ -

Get Bragg integration configuration

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "integration_model": "ProfileGaussian",
  • "max_hkl": 100
}

Change file writer settings

This can only be done when detector is Idle, Error or Inactive states.

+
http://localhost:5232/config/bragg_integration

Response samples

Content type
application/json
{
  • "integration_model": "ProfileGaussian",
  • "max_hkl": 100
}

Change analysis settings

This can only be done when detector is Idle, Error or Inactive states. +The mode is persistent - it is not reset by a data collection.

+
Request Body schema: application/json
mode
required
string (analysis_mode)
Default: "MXStills"
Enum: "None" "MXStills" "Azint" "Grid" "PowderCalibration"

What analysis jfjoch_broker runs over the images. One setting replaces the several independent +switches - spot finding on/off in two places, indexing on/off, rotation on/off - that used to be +composed at each site into an answer nobody had written down. +None - images are received, written and streamed; nothing is analysed. +MXStills - spot finding, per-image indexing, refinement and integration. The default, and what + an out-of-the-box broker has always done. +Azint - azimuthal integration only; no spots are found. +Grid - grid scan: per-image scoring and crystal selection. +PowderCalibration - detector geometry from a calibrant's powder rings. Forces azimuthal + integration onto the CPU, since the FPGA core cannot hold enough bins for the sectored + profile a ring fit needs; a calibration exposure is a few images at a few Hz, so the cost + does not matter.

+

Rotation MX analysis is deliberately absent: jfjoch_broker has no rotation analysis path, so +this API cannot express it. Rotation data is collected here and processed offline with rugnux.

+

Responses

Request samples

Content type
application/json
{
  • "mode": "None"
}

Response samples

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

Get analysis configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "mode": "None"
}

Change grid scan analysis settings

This can only be done when detector is Idle, Error or Inactive states. +Persistent - not reset by a data collection.

+
Request Body schema: application/json
protein_score_threshold
required
number <float> [ 0 .. 1 ]
Default: 0.5

A raster cell counts as protein above this. The per-image protein score saturates, so this +only has to separate "something diffracted here" from "nothing did".

+
min_blob_cells
required
integer <int64> >= 1
Default: 3

How many cells above that threshold make a shape rather than a coincidence. Two cells can +be the two ends of a single hit lying on a cell boundary; three is the smallest patch that +is not.

+
decisive_single_cell_score
required
number <float> [ 0 .. 1 ]
Default: 0.9

...unless one cell on its own is decisive. The rule above is about coincidences, and a +lone cell scoring near the top of a saturating score is not one - a crystal smaller than +the grid step lights exactly one cell, and refusing it would lose precisely the samples a +fine raster is run to find. Set well above protein_score_threshold: this admits the +obvious case, it does not lower the general threshold by the back door.

+
max_crystals
required
integer <int64> >= 1
Default: 10

Most crystals reported. A raster over a loop full of shards can label dozens of blobs, and +past the first few the list is no longer a ranking anyone acts on. Crystals are sorted by +score, so this keeps the best.

+
indexing
required
boolean
Default: true

Whether each raster cell is indexed as well as scored. On by default: a raster runs at up +to 100 Hz, which the FFT indexer keeps up with, and it is additive - blobs are still found +on the protein score, so indexing changes nothing about which cells are called crystals +and only adds what was found in them. The lattice count per cell is the cheapest +multi-lattice or cracked-crystal signal there is, and on a fixed-target serial experiment +with a known cell a raster that indexes is most of the measurement. Turn it off for a very +large raster where the GPU is the constraint.

+

Responses

Request samples

Content type
application/json
{
  • "protein_score_threshold": 0.5,
  • "min_blob_cells": 3,
  • "decisive_single_cell_score": 0.9,
  • "max_crystals": 10,
  • "indexing": true
}

Response samples

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

Get grid scan analysis configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "protein_score_threshold": 0.5,
  • "min_blob_cells": 3,
  • "decisive_single_cell_score": 0.9,
  • "max_crystals": 10,
  • "indexing": true
}

Change powder calibration settings

This can only be done when detector is Idle, Error or Inactive states. +Persistent - not reset by a data collection.

+
Request Body schema: application/json
calibrant
string

Which calibrant's ring d-spacings the geometry is fitted against. Empty selects the +processing program's own default rather than meaning "no calibrant".

+
method
required
string (calibration_method)
Default: "Rings"
Enum: "Rings" "Spots"

How the powder rings the detector geometry is fitted to are measured. +Rings - the run-summed (q x azimuth) azimuthal profile: the ring measured at every azimuth. +Spots - the pooled per-image spot lists: the ring sampled wherever the spot finder bit.

+

Responses

Request samples

Content type
application/json
{
  • "calibrant": "string",
  • "method": "Rings"
}

Response samples

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

Get powder calibration configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "calibrant": "string",
  • "method": "Rings"
}

Change file writer settings

This can only be done when detector is Idle, Error or Inactive states.

Request Body schema: application/json
overwrite
boolean
Default: false

Inform jfjoch_write to overwrite existing files. Otherwise files would be saved with .h5.{timestamp}.tmp suffix.

format
string (file_writer_format)
Default: "NXmxVDS"
Enum: "NXmxOnlyData" "NXmxLegacy" "NXmxVDS" "NXmxIntegrated" "CBF" "TIFF" "NoFileWritten"

NoFileWritten - no files are written at all NXmxOnlyData - only data files are written, no master file @@ -661,10 +734,10 @@ TIFF - DEPRECATED, no longer supported; kept for back compatibility only. Reques

Request samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "NXmxOnlyData"
}

Response samples

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

Get file writer settings

Can be done anytime

+
http://localhost:5232/config/file_writer

Request samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "NXmxOnlyData"
}

Response samples

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

Get file writer settings

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "NXmxOnlyData"
}

Change instrument metadata

This can only be done when detector is Idle, Error or Inactive states.

+
http://localhost:5232/config/file_writer

Response samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "NXmxOnlyData"
}

Change instrument metadata

This can only be done when detector is Idle, Error or Inactive states.

Request Body schema: application/json
source_name
required
string
source_type
string
Default: ""

Type of radiation source. NXmx gives a fixed dictionary, though Jungfraujoch is not enforcing compliance. https://manual.nexusformat.org/classes/base_classes/NXsource.html#nxsource NXsource allows the following:

@@ -687,10 +760,10 @@ Metal Jet X-ray

Request samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Response samples

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

Get instrument metadata

Can be done anytime

+
http://localhost:5232/config/instrument

Request samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Response samples

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

Get instrument metadata

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Change image output format

This can only be done when detector is Idle, Error or Inactive states.

+
http://localhost:5232/config/instrument

Response samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Change image output format

This can only be done when detector is Idle, Error or Inactive states.

Request Body schema: application/json
summation
required
boolean

Enable summation of images to a given image_time If disabled images are saved according to original detector speed, but image count is adjusted

geometry_transform
required
boolean

Place module read-out into their location on composed detector and extend multipixels

@@ -712,20 +785,24 @@ This should be turned off for cases, where detector is operated at room temperat

Request samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Response samples

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

Get image output format

Can be done anytime

+
http://localhost:5232/config/image_format

Request samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Response samples

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

Get image output format

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Configure format for raw data collection

This can only be done when detector is Idle, Error or Inactive states.

+
http://localhost:5232/config/image_format

Response samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Configure format for raw data collection

This can only be done when detector is Idle, Error or Inactive states.

Responses

Response samples

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

Configure format for data collection with full conversion

This can only be done when detector is Idle, Error or Inactive states.

+
http://localhost:5232/config/image_format/raw

Response samples

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

Configure format for data collection with full conversion

This can only be done when detector is Idle, Error or Inactive states.

Responses

Response samples

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

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. +

http://localhost:5232/config/image_format/conversion

Response samples

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

Configure spot finding

Can be done anytime, also while data collection is running

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

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.

+

DEPRECATED - use the analysis mode instead (/config/analysis). The mode takes precedence: a +mode that analyses no spots (None, Azint, PowderCalibration) switches spot finding off +whatever this says, and under a mode that does find spots this remains a finer control that +can still turn it off. It is kept while callers move over.

indexing
required
boolean
Default: true

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

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
number <float>

High resolution limit for spot finding [Angstrom]. Optional: if omitted, spot finding extends as far as the detector reaches, i.e. the detection is not clipped in resolution.

@@ -751,10 +828,10 @@ About 100 suits a multi-megapixel detector. Ignored unless adaptive_threshold is

Responses

Request samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "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,
  • "high_resolution_limit_for_spot_count_low_res": 2,
  • "quick_integration": false,
  • "ice_ring_width_q_recipA": 0.03,
  • "high_res_gap_Q_recipA": 1.5,
  • "adaptive_threshold": false,
  • "false_pixels_per_frame": 100
}

Get data processing configuration

Can be done anytime

+
http://localhost:5232/config/spot_finding

Request samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "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,
  • "high_resolution_limit_for_spot_count_low_res": 2,
  • "quick_integration": false,
  • "ice_ring_width_q_recipA": 0.03,
  • "high_res_gap_Q_recipA": 1.5,
  • "adaptive_threshold": false,
  • "false_pixels_per_frame": 100
}

Get data processing configuration

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "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,
  • "high_resolution_limit_for_spot_count_low_res": 2,
  • "quick_integration": false,
  • "ice_ring_width_q_recipA": 0.03,
  • "high_res_gap_Q_recipA": 1.5,
  • "adaptive_threshold": false,
  • "false_pixels_per_frame": 100
}

Configure azimuthal integration

Can be done when detector is Inactive or Idle

+
http://localhost:5232/config/spot_finding

Response samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "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,
  • "high_resolution_limit_for_spot_count_low_res": 2,
  • "quick_integration": false,
  • "ice_ring_width_q_recipA": 0.03,
  • "high_res_gap_Q_recipA": 1.5,
  • "adaptive_threshold": false,
  • "false_pixels_per_frame": 100
}

Configure azimuthal integration

Can be done when detector is Inactive or Idle

Request Body schema: application/json
polarization_corr
required
boolean
Default: true

Apply polarization correction for azimuthal integration (polarization factor must be configured in dataset settings)

solid_angle_corr
required
boolean
Default: true

Apply solid angle correction for azimuthal integration

high_q_recipA
number <float> [ 0.00002 .. 10 ]

Upper q limit of the azimuthal integration [1/Angstrom]. Optional: if omitted, the integration @@ -768,10 +845,10 @@ of the azimuthal integration results.

Request samples

Content type
application/json
{
  • "polarization_corr": true,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.00002,
  • "low_q_recipA": 0.00001,
  • "q_spacing": 0.00001,
  • "azimuthal_bins": 1,
  • "force_cpu": false
}

Response samples

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

Get azimuthal integration configuration

Can be done anytime

+
http://localhost:5232/config/azim_int

Request samples

Content type
application/json
{
  • "polarization_corr": true,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.00002,
  • "low_q_recipA": 0.00001,
  • "q_spacing": 0.00001,
  • "azimuthal_bins": 1,
  • "force_cpu": false
}

Response samples

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

Get azimuthal integration configuration

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "polarization_corr": true,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.00002,
  • "low_q_recipA": 0.00001,
  • "q_spacing": 0.00001,
  • "azimuthal_bins": 1,
  • "force_cpu": false
}

Load binary image for internal FPGA generator

Load image for internal FPGA generator. This can only happen in Idle state of the detector. +

http://localhost:5232/config/azim_int

Response samples

Content type
application/json
{
  • "polarization_corr": true,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.00002,
  • "low_q_recipA": 0.00001,
  • "q_spacing": 0.00001,
  • "azimuthal_bins": 1,
  • "force_cpu": false
}

Load binary image for internal FPGA generator

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

@@ -792,10 +869,10 @@ Changing detector will set detector to Inactive state and will requ

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

+
http://localhost:5232/config/select_detector

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
}

Set ZeroMQ preview settings

Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. +

http://localhost:5232/config/select_detector

Response samples

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

Set ZeroMQ preview settings

Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. Options set with this PUT request have no effect on HTTP based preview.

@@ -811,9 +888,9 @@ Address follows ZeroMQ convention for sockets - in practice ipc://

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

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

Get ZeroMQ preview settings

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

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

Get ZeroMQ preview settings

Responses

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Set ZeroMQ metadata settings

Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. +

http://localhost:5232/config/zeromq_preview

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Set ZeroMQ metadata settings

Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request.

Request Body schema: application/json
enabled
required
boolean
Default: true

ZeroMQ metadata socket is enabled.

@@ -826,9 +903,9 @@ Address follows ZeroMQ convention for sockets - in practice ipc://

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

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

Get ZeroMQ metadata socket settings

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

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

Get ZeroMQ metadata socket settings

Responses

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Set configuration for dark data collection to calculate mask

This is only possible when operating DECTRIS detectors at the moment; it will be also available for PSI EIGER at some point. +

http://localhost:5232/config/zeromq_metadata

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Set configuration for dark data collection to calculate mask

This is only possible when operating DECTRIS detectors at the moment; it will be also available for PSI EIGER at some point. This can only be done when detector is Idle, Error or Inactive states.

Request Body schema: application/json
detector_threshold_keV
required
number <float> [ 2.5 .. 100 ]
Default: 3.5

Energy threshold for dark image collection

frame_time_us
required
integer <int64> [ 500 .. 100000 ]
Default: 10000

Time between frames for dark image collection

@@ -839,48 +916,48 @@ This can only be done when detector is Idle, Error or

Request samples

Content type
application/json
{
  • "detector_threshold_keV": 3.5,
  • "frame_time_us": 10000,
  • "number_of_frames": 1000,
  • "max_allowed_pixel_count": 1,
  • "max_frames_with_signal": 10
}

Response samples

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

Get settings for dark data collection to calculate mask

Responses

Request samples

Content type
application/json
{
  • "detector_threshold_keV": 3.5,
  • "frame_time_us": 10000,
  • "number_of_frames": 1000,
  • "max_allowed_pixel_count": 1,
  • "max_frames_with_signal": 10
}

Response samples

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

Get settings for dark data collection to calculate mask

Responses

Response samples

Content type
application/json
{
  • "detector_threshold_keV": 3.5,
  • "frame_time_us": 10000,
  • "number_of_frames": 1000,
  • "max_allowed_pixel_count": 1,
  • "max_frames_with_signal": 10
}

Get Jungfraujoch status

Status of the data acquisition

+
http://localhost:5232/config/dark_mask

Response samples

Content type
application/json
{
  • "detector_threshold_keV": 3.5,
  • "frame_time_us": 10000,
  • "number_of_frames": 1000,
  • "max_allowed_pixel_count": 1,
  • "max_frames_with_signal": 10
}

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"
}

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

+
http://localhost:5232/fpga_status

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

Response samples

Content type
application/json
[
  • 0
]

Return XFEL event codes for the current data acquisition

Return array of XFEL event codes

+
http://localhost:5232/xfel/pulse_id

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 status of image pusher

Responses

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,
  • "images_written": 0,
  • "images_write_error": 0,
  • "writer_fifo_utilization": [
    ]
}

Get detector status

Status of the JUNGFRAU detector

+
http://localhost:5232/image_pusher/status

Response samples

Content type
application/json
{
  • "pusher_type": "ZeroMQ",
  • "addr": [
    ],
  • "connected_writers": 0,
  • "images_written": 0,
  • "images_write_error": 0,
  • "writer_fifo_utilization": [
    ]
}

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

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

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": {
    },
  • "bragg_integration": {
    },
  • "image_pusher": {
    }
}

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": {
    },
  • "bragg_integration": {
    },
  • "analysis": {
    },
  • "grid_scan_analysis": {
    },
  • "calibration_settings": {
    },
  • "image_pusher": {
    }
}

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

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

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

Generate 1D plot from Jungfraujoch

query Parameters
binning
integer
Default: 1

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

-
type
required
string
Enum: "bkg_estimate" "spindle_blind_fraction" "azint" "azint_1d" "spot_count" "spot_count_low_res" "spot_count_indexed" "spot_count_ice" "indexing_rate" "indexing_lattice_count" "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" "integrated_reflections" "image_scale_factor" "image_scale_cc" "compression_ratio" "ice_ring_score"

Type of requested plot

+
type
required
string
Enum: "bkg_estimate" "spindle_blind_fraction" "azint" "azint_1d" "spot_count" "spot_count_low_res" "spot_count_indexed" "spot_count_ice" "indexing_rate" "indexing_lattice_count" "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" "integrated_reflections" "image_scale_factor" "image_scale_cc" "compression_ratio" "ice_ring_ratio" "ice_ring_score" "protein_score" "ice_score"

Type of requested plot

fill
number <float>

Fill value for elements that were missed during data collection

experimental_coord
boolean
Default: false

If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value @@ -939,10 +1016,10 @@ For still measurement the number is ignored

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" "spindle_blind_fraction" "azint" "azint_1d" "spot_count" "spot_count_low_res" "spot_count_indexed" "spot_count_ice" "indexing_rate" "indexing_lattice_count" "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" "integrated_reflections" "image_scale_factor" "image_scale_cc" "compression_ratio" "ice_ring_score"

Type of requested plot

+
query Parameters
type
required
string
Enum: "bkg_estimate" "spindle_blind_fraction" "azint" "azint_1d" "spot_count" "spot_count_low_res" "spot_count_indexed" "spot_count_ice" "indexing_rate" "indexing_lattice_count" "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" "integrated_reflections" "image_scale_factor" "image_scale_cc" "compression_ratio" "ice_ring_ratio" "ice_ring_score" "protein_score" "ice_score"

Type of requested plot

roi
string non-empty

Name of ROI for which plot is requested

Responses

Response samples

Content type
application/json
{
  • "file_prefix": "string",
  • "rotation_unit_cell": {
    },
  • "rotation_crystal_lattice": [
    ],
  • "rotation_bravais": "string",
  • "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": [
    ],
  • "rotation_bravais": "string",
  • "grid": {
    },
  • "calibration": {
    },
  • "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

@@ -978,7 +1055,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