diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index bf46c6a9..a5f5516b 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -193,6 +193,8 @@ void JFJochBrokerHttp::register_routes(httplib::Server &server) { server.Post("/config/image_format/raw", bind_noarg(&JFJochBrokerHttp::config_image_format_raw_post)); server.Get("/config/indexing", bind_noarg(&JFJochBrokerHttp::config_indexing_get)); server.Put("/config/indexing", bind_json(&JFJochBrokerHttp::config_indexing_put, Indexing_settings{})); + server.Get("/config/bragg_integration", bind_noarg(&JFJochBrokerHttp::config_bragg_integration_get)); + server.Put("/config/bragg_integration", bind_json(&JFJochBrokerHttp::config_bragg_integration_put, Bragg_integration_settings{})); server.Get("/config/instrument", bind_noarg(&JFJochBrokerHttp::config_instrument_get)); server.Put("/config/instrument", bind_json(&JFJochBrokerHttp::config_instrument_put, Instrument_metadata{})); server.Put("/config/internal_generator_image", [this](const httplib::Request &req, httplib::Response &res) { @@ -577,6 +579,7 @@ void JFJochBrokerHttp::statistics_get(httplib::Response &response) { statistics.setAzInt(Convert(state_machine.GetRadialIntegrationSettings())); statistics.setBuffer(Convert(state_machine.GetImageBufferStatus())); statistics.setIndexing(Convert(state_machine.GetIndexingSettings())); + statistics.setBraggIntegration(Convert(state_machine.GetBraggIntegrationSettings())); statistics.setDarkMask(Convert(state_machine.GetDarkMaskSettings())); statistics.setImagePusher(Convert(state_machine.GetImagePusherStatus())); @@ -809,6 +812,16 @@ void JFJochBrokerHttp::config_indexing_put(const Indexing_settings &indexingSett response.status = 200; } +void JFJochBrokerHttp::config_bragg_integration_get(httplib::Response &response) { + ProcessOutput(Convert(state_machine.GetBraggIntegrationSettings()), response); +} + +void JFJochBrokerHttp::config_bragg_integration_put(const Bragg_integration_settings &braggIntegrationSettings, + httplib::Response &response) { + state_machine.SetBraggIntegrationSettings(Convert(braggIntegrationSettings)); + response.status = 200; +} + void JFJochBrokerHttp::result_scan_get(httplib::Response &response) { auto ret = state_machine.GetScanResult(); if (ret.has_value()) diff --git a/broker/JFJochBrokerHttp.h b/broker/JFJochBrokerHttp.h index d69c55e6..329798c7 100644 --- a/broker/JFJochBrokerHttp.h +++ b/broker/JFJochBrokerHttp.h @@ -17,6 +17,7 @@ #include "OpenAPIConvert.h" #include "gen/model/Azim_int_settings.h" +#include "gen/model/Bragg_integration_settings.h" #include "gen/model/Broker_status.h" #include "gen/model/Dark_mask_settings.h" #include "gen/model/Dataset_settings.h" @@ -176,6 +177,9 @@ class JFJochBrokerHttp { void config_indexing_get(httplib::Response &response); void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings, httplib::Response &response); + void config_bragg_integration_get(httplib::Response &response); + void config_bragg_integration_put(const org::openapitools::server::model::Bragg_integration_settings &braggIntegrationSettings, + httplib::Response &response); void config_dark_mask_get(httplib::Response &response); void config_dark_mask_put(const org::openapitools::server::model::Dark_mask_settings &darkMaskSettings, diff --git a/broker/JFJochBrokerParser.cpp b/broker/JFJochBrokerParser.cpp index 662cc9c7..1a322e56 100644 --- a/broker/JFJochBrokerParser.cpp +++ b/broker/JFJochBrokerParser.cpp @@ -177,6 +177,9 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s if (j.indexingIsSet()) experiment.ImportIndexingSettings(Convert(j.getIndexing())); + if (j.braggIntegrationIsSet()) + experiment.ImportBraggIntegrationSettings(Convert(j.getBraggIntegration())); + if (j.darkMaskIsSet()) experiment.ImportDarkMaskSettings(Convert(j.getDarkMask())); } diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index 00eae79d..1343bbfb 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -1059,6 +1059,21 @@ void JFJochStateMachine::SetIndexingSettings(const IndexingSettings &input) { } } +BraggIntegrationSettings JFJochStateMachine::GetBraggIntegrationSettings() const { + std::unique_lock ul(experiment_indexing_settings_mutex); + return experiment.GetBraggIntegrationSettings(); +} + +void JFJochStateMachine::SetBraggIntegrationSettings(const BraggIntegrationSettings &input) { + std::unique_lock ul(m); + if (IsRunning()) + throw WrongDAQStateException("Cannot change Bragg integration settings during data collection"); + // The analysis engines read the integrator mode off the experiment when they are built at the start + // of the next run, so importing it here is all that is needed. + std::unique_lock ul2(experiment_indexing_settings_mutex); + experiment.ImportBraggIntegrationSettings(input); +} + std::optional JFJochStateMachine::GetScanResult() const { std::unique_lock ul(m); if (IsRunning()) diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index aff240c6..97c681c1 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -232,6 +232,9 @@ public: void SetIndexingSettings(const IndexingSettings &input); IndexingSettings GetIndexingSettings() const; + + void SetBraggIntegrationSettings(const BraggIntegrationSettings &input); + BraggIntegrationSettings GetBraggIntegrationSettings() const; PixelMaskStatistics GetPixelMaskStatistics() const; void GetStartMessageFromBuffer(std::vector &v); diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index 3ee02ad4..be884867 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -1050,6 +1050,42 @@ org::openapitools::server::model::Indexing_settings Convert(const IndexingSettin return ret; } +BraggIntegrationSettings Convert(const org::openapitools::server::model::Bragg_integration_settings &input) { + BraggIntegrationSettings ret; + switch (input.getIntegrationModel().getValue()) { + case org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEGAUSSIAN: + ret.Integrator(IntegratorMode::ProfileGaussian); + break; + case org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEEMPIRICAL: + ret.Integrator(IntegratorMode::ProfileEmpirical); + break; + case org::openapitools::server::model::Integration_model::eIntegration_model::BOXSUM: + ret.Integrator(IntegratorMode::BoxSum); + break; + default: + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown integration model"); + } + return ret; +} + +org::openapitools::server::model::Bragg_integration_settings Convert(const BraggIntegrationSettings &input) { + org::openapitools::server::model::Bragg_integration_settings ret; + org::openapitools::server::model::Integration_model tmp; + switch (input.GetIntegrator()) { + case IntegratorMode::ProfileGaussian: + tmp.setValue(org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEGAUSSIAN); + break; + case IntegratorMode::ProfileEmpirical: + tmp.setValue(org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEEMPIRICAL); + break; + case IntegratorMode::BoxSum: + tmp.setValue(org::openapitools::server::model::Integration_model::eIntegration_model::BOXSUM); + break; + } + ret.setIntegrationModel(tmp); + return ret; +} + org::openapitools::server::model::Scan_result Convert(const ScanResult& input) { org::openapitools::server::model::Scan_result ret; ret.setFilePrefix(input.file_prefix); diff --git a/broker/OpenAPIConvert.h b/broker/OpenAPIConvert.h index 6337f84a..fd36ea1d 100644 --- a/broker/OpenAPIConvert.h +++ b/broker/OpenAPIConvert.h @@ -28,6 +28,7 @@ #include "gen/model/Rotation_axis.h" #include "gen/model/Grid_scan.h" #include "gen/model/Indexing_settings.h" +#include "gen/model/Bragg_integration_settings.h" #include "gen/model/Scan_result.h" #include "../common/JFJochMessages.h" @@ -47,6 +48,9 @@ org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindin IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input); org::openapitools::server::model::Indexing_settings Convert(const IndexingSettings &input); +BraggIntegrationSettings Convert(const org::openapitools::server::model::Bragg_integration_settings &input); +org::openapitools::server::model::Bragg_integration_settings Convert(const BraggIntegrationSettings &input); + org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input); DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input); diff --git a/broker/gen/model/Bragg_integration_settings.cpp b/broker/gen/model/Bragg_integration_settings.cpp new file mode 100644 index 00000000..cfe8091b --- /dev/null +++ b/broker/gen/model/Bragg_integration_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.156 +* 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 "Bragg_integration_settings.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Bragg_integration_settings::Bragg_integration_settings() +{ + +} + +void Bragg_integration_settings::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Bragg_integration_settings::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Bragg_integration_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Bragg_integration_settings" : pathPrefix; + + + return success; +} + +bool Bragg_integration_settings::operator==(const Bragg_integration_settings& rhs) const +{ + return + + + (getIntegrationModel() == rhs.getIntegrationModel()) + + + ; +} + +bool Bragg_integration_settings::operator!=(const Bragg_integration_settings& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Bragg_integration_settings& o) +{ + j = nlohmann::json::object(); + j["integration_model"] = o.m_Integration_model; + +} + +void from_json(const nlohmann::json& j, Bragg_integration_settings& o) +{ + j.at("integration_model").get_to(o.m_Integration_model); + +} + +org::openapitools::server::model::Integration_model Bragg_integration_settings::getIntegrationModel() const +{ + return m_Integration_model; +} +void Bragg_integration_settings::setIntegrationModel(org::openapitools::server::model::Integration_model const& value) +{ + m_Integration_model = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Bragg_integration_settings.h b/broker/gen/model/Bragg_integration_settings.h new file mode 100644 index 00000000..16ac2e3a --- /dev/null +++ b/broker/gen/model/Bragg_integration_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.156 +* 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. +*/ +/* + * Bragg_integration_settings.h + * + * Settings for Bragg spot integration + */ + +#ifndef Bragg_integration_settings_H_ +#define Bragg_integration_settings_H_ + + +#include "Integration_model.h" +#include + +namespace org::openapitools::server::model +{ + +/// +/// Settings for Bragg spot integration +/// +class Bragg_integration_settings +{ +public: + Bragg_integration_settings(); + virtual ~Bragg_integration_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 Bragg_integration_settings& rhs) const; + bool operator!=(const Bragg_integration_settings& rhs) const; + + ///////////////////////////////////////////// + /// Bragg_integration_settings members + + /// + /// + /// + org::openapitools::server::model::Integration_model getIntegrationModel() const; + void setIntegrationModel(org::openapitools::server::model::Integration_model const& value); + + friend void to_json(nlohmann::json& j, const Bragg_integration_settings& o); + friend void from_json(const nlohmann::json& j, Bragg_integration_settings& o); +protected: + org::openapitools::server::model::Integration_model m_Integration_model; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Bragg_integration_settings_H_ */ diff --git a/broker/gen/model/Integration_model.cpp b/broker/gen/model/Integration_model.cpp new file mode 100644 index 00000000..ed89275d --- /dev/null +++ b/broker/gen/model/Integration_model.cpp @@ -0,0 +1,122 @@ +/** +* 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.156 +* 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 "Integration_model.h" +#include "Helpers.h" +#include +#include + +namespace org::openapitools::server::model +{ + +Integration_model::Integration_model() +{ + +} + +void Integration_model::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Integration_model::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Integration_model::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Integration_model" : pathPrefix; + + + if (m_value == Integration_model::eIntegration_model::INVALID_VALUE_OPENAPI_GENERATED) + { + success = false; + msg << _pathPrefix << ": has no value;"; + } + + return success; +} + +bool Integration_model::operator==(const Integration_model& rhs) const +{ + return + getValue() == rhs.getValue() + + ; +} + +bool Integration_model::operator!=(const Integration_model& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Integration_model& o) +{ + j = nlohmann::json::object(); + + switch (o.getValue()) + { + case Integration_model::eIntegration_model::INVALID_VALUE_OPENAPI_GENERATED: + j = "INVALID_VALUE_OPENAPI_GENERATED"; + break; + case Integration_model::eIntegration_model::PROFILEGAUSSIAN: + j = "ProfileGaussian"; + break; + case Integration_model::eIntegration_model::PROFILEEMPIRICAL: + j = "ProfileEmpirical"; + break; + case Integration_model::eIntegration_model::BOXSUM: + j = "BoxSum"; + break; + } +} + +void from_json(const nlohmann::json& j, Integration_model& o) +{ + + auto s = j.get(); + if (s == "ProfileGaussian") { + o.setValue(Integration_model::eIntegration_model::PROFILEGAUSSIAN); + } + else if (s == "ProfileEmpirical") { + o.setValue(Integration_model::eIntegration_model::PROFILEEMPIRICAL); + } + else if (s == "BoxSum") { + o.setValue(Integration_model::eIntegration_model::BOXSUM); + } else { + std::stringstream ss; + ss << "Unexpected value " << s << " in json" + << " cannot be converted to enum of type" + << " Integration_model::eIntegration_model"; + throw std::invalid_argument(ss.str()); + } + +} + +Integration_model::eIntegration_model Integration_model::getValue() const +{ + return m_value; +} +void Integration_model::setValue(Integration_model::eIntegration_model value) +{ + m_value = value; +} + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Integration_model.h b/broker/gen/model/Integration_model.h new file mode 100644 index 00000000..b7329330 --- /dev/null +++ b/broker/gen/model/Integration_model.h @@ -0,0 +1,80 @@ +/** +* 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.156 +* 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. +*/ +/* + * Integration_model.h + * + * Bragg spot integration model. ProfileGaussian - profile fit with a measured-width Gaussian (Kabsch-style), the default; more accurate intensities than box summation. ProfileEmpirical - profile fit with a per-resolution-shell empirical profile learned from strong spots. BoxSum - classical uniform box summation minus a ring-mean background; the simpler, faster fallback. + */ + +#ifndef Integration_model_H_ +#define Integration_model_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// Bragg spot integration model. ProfileGaussian - profile fit with a measured-width Gaussian (Kabsch-style), the default; more accurate intensities than box summation. ProfileEmpirical - profile fit with a per-resolution-shell empirical profile learned from strong spots. BoxSum - classical uniform box summation minus a ring-mean background; the simpler, faster fallback. +/// +class Integration_model +{ +public: + Integration_model(); + virtual ~Integration_model() = default; + + enum class eIntegration_model { + // To have a valid default value. + // Avoiding name clashes with user defined + // enum values + INVALID_VALUE_OPENAPI_GENERATED = 0, + PROFILEGAUSSIAN, + PROFILEEMPIRICAL, + BOXSUM + }; + + /// + /// 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 Integration_model& rhs) const; + bool operator!=(const Integration_model& rhs) const; + + ///////////////////////////////////////////// + /// Integration_model members + + Integration_model::eIntegration_model getValue() const; + void setValue(Integration_model::eIntegration_model value); + + friend void to_json(nlohmann::json& j, const Integration_model& o); + friend void from_json(const nlohmann::json& j, Integration_model& o); +protected: + Integration_model::eIntegration_model m_value = Integration_model::eIntegration_model::INVALID_VALUE_OPENAPI_GENERATED; +}; + +} // namespace org::openapitools::server::model + +#endif /* Integration_model_H_ */ diff --git a/broker/gen/model/Jfjoch_settings.cpp b/broker/gen/model/Jfjoch_settings.cpp index f5006d72..1439555a 100644 --- a/broker/gen/model/Jfjoch_settings.cpp +++ b/broker/gen/model/Jfjoch_settings.cpp @@ -27,6 +27,7 @@ Jfjoch_settings::Jfjoch_settings() m_InstrumentIsSet = false; m_File_writerIsSet = false; m_IndexingIsSet = false; + m_Bragg_integrationIsSet = false; m_Detector_settingsIsSet = false; m_Azim_intIsSet = false; m_Image_formatIsSet = false; @@ -107,7 +108,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr } } - + if (imageBufferMiBIsSet()) { const int32_t& value = m_Image_buffer_MiB; @@ -171,6 +172,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const ((!indexingIsSet() && !rhs.indexingIsSet()) || (indexingIsSet() && rhs.indexingIsSet() && getIndexing() == rhs.getIndexing())) && + ((!braggIntegrationIsSet() && !rhs.braggIntegrationIsSet()) || (braggIntegrationIsSet() && rhs.braggIntegrationIsSet() && getBraggIntegration() == rhs.getBraggIntegration())) && + + ((!detectorSettingsIsSet() && !rhs.detectorSettingsIsSet()) || (detectorSettingsIsSet() && rhs.detectorSettingsIsSet() && getDetectorSettings() == rhs.getDetectorSettings())) && @@ -233,6 +237,8 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o) j["detector"] = o.m_Detector; if(o.indexingIsSet()) j["indexing"] = o.m_Indexing; + if(o.braggIntegrationIsSet()) + j["bragg_integration"] = o.m_Bragg_integration; if(o.detectorSettingsIsSet()) j["detector_settings"] = o.m_Detector_settings; if(o.azimIntIsSet()) @@ -293,6 +299,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o) j.at("indexing").get_to(o.m_Indexing); o.m_IndexingIsSet = true; } + if(j.find("bragg_integration") != j.end()) + { + j.at("bragg_integration").get_to(o.m_Bragg_integration); + o.m_Bragg_integrationIsSet = true; + } if(j.find("detector_settings") != j.end()) { j.at("detector_settings").get_to(o.m_Detector_settings); @@ -463,6 +474,23 @@ void Jfjoch_settings::unsetIndexing() { m_IndexingIsSet = false; } +org::openapitools::server::model::Bragg_integration_settings Jfjoch_settings::getBraggIntegration() const +{ + return m_Bragg_integration; +} +void Jfjoch_settings::setBraggIntegration(org::openapitools::server::model::Bragg_integration_settings const& value) +{ + m_Bragg_integration = value; + m_Bragg_integrationIsSet = true; +} +bool Jfjoch_settings::braggIntegrationIsSet() const +{ + return m_Bragg_integrationIsSet; +} +void Jfjoch_settings::unsetBragg_integration() +{ + m_Bragg_integrationIsSet = 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 9029779f..3afaa370 100644 --- a/broker/gen/model/Jfjoch_settings.h +++ b/broker/gen/model/Jfjoch_settings.h @@ -26,6 +26,7 @@ #include "Pcie_devices_inner.h" #include #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" @@ -124,6 +125,13 @@ public: /// /// /// + org::openapitools::server::model::Bragg_integration_settings getBraggIntegration() const; + void setBraggIntegration(org::openapitools::server::model::Bragg_integration_settings const& value); + bool braggIntegrationIsSet() const; + void unsetBragg_integration(); + /// + /// + /// org::openapitools::server::model::Detector_settings getDetectorSettings() const; void setDetectorSettings(org::openapitools::server::model::Detector_settings const& value); bool detectorSettingsIsSet() const; @@ -226,6 +234,8 @@ protected: org::openapitools::server::model::Indexing_settings m_Indexing; bool m_IndexingIsSet; + org::openapitools::server::model::Bragg_integration_settings m_Bragg_integration; + bool m_Bragg_integrationIsSet; 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 f948e266..68fbe6d6 100644 --- a/broker/gen/model/Jfjoch_statistics.cpp +++ b/broker/gen/model/Jfjoch_statistics.cpp @@ -40,6 +40,7 @@ Jfjoch_statistics::Jfjoch_statistics() m_Az_intIsSet = false; m_BufferIsSet = false; m_IndexingIsSet = false; + m_Bragg_integrationIsSet = false; m_Image_pusherIsSet = false; } @@ -105,7 +106,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path } } - + return success; } @@ -172,6 +173,9 @@ bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const ((!indexingIsSet() && !rhs.indexingIsSet()) || (indexingIsSet() && rhs.indexingIsSet() && getIndexing() == rhs.getIndexing())) && + ((!braggIntegrationIsSet() && !rhs.braggIntegrationIsSet()) || (braggIntegrationIsSet() && rhs.braggIntegrationIsSet() && getBraggIntegration() == rhs.getBraggIntegration())) && + + ((!imagePusherIsSet() && !rhs.imagePusherIsSet()) || (imagePusherIsSet() && rhs.imagePusherIsSet() && getImagePusher() == rhs.getImagePusher())) ; @@ -223,6 +227,8 @@ void to_json(nlohmann::json& j, const Jfjoch_statistics& o) j["buffer"] = o.m_Buffer; if(o.indexingIsSet()) j["indexing"] = o.m_Indexing; + if(o.braggIntegrationIsSet()) + j["bragg_integration"] = o.m_Bragg_integration; if(o.imagePusherIsSet()) j["image_pusher"] = o.m_Image_pusher; @@ -325,6 +331,11 @@ void from_json(const nlohmann::json& j, Jfjoch_statistics& o) j.at("indexing").get_to(o.m_Indexing); o.m_IndexingIsSet = true; } + if(j.find("bragg_integration") != j.end()) + { + j.at("bragg_integration").get_to(o.m_Bragg_integration); + o.m_Bragg_integrationIsSet = true; + } if(j.find("image_pusher") != j.end()) { j.at("image_pusher").get_to(o.m_Image_pusher); @@ -656,6 +667,23 @@ void Jfjoch_statistics::unsetIndexing() { m_IndexingIsSet = false; } +org::openapitools::server::model::Bragg_integration_settings Jfjoch_statistics::getBraggIntegration() const +{ + return m_Bragg_integration; +} +void Jfjoch_statistics::setBraggIntegration(org::openapitools::server::model::Bragg_integration_settings const& value) +{ + m_Bragg_integration = value; + m_Bragg_integrationIsSet = true; +} +bool Jfjoch_statistics::braggIntegrationIsSet() const +{ + return m_Bragg_integrationIsSet; +} +void Jfjoch_statistics::unsetBragg_integration() +{ + m_Bragg_integrationIsSet = 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 b83d724a..798a41aa 100644 --- a/broker/gen/model/Jfjoch_statistics.h +++ b/broker/gen/model/Jfjoch_statistics.h @@ -28,6 +28,7 @@ #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" @@ -214,6 +215,13 @@ public: /// /// /// + org::openapitools::server::model::Bragg_integration_settings getBraggIntegration() const; + void setBraggIntegration(org::openapitools::server::model::Bragg_integration_settings const& value); + bool braggIntegrationIsSet() const; + void unsetBragg_integration(); + /// + /// + /// org::openapitools::server::model::Image_pusher_status getImagePusher() const; void setImagePusher(org::openapitools::server::model::Image_pusher_status const& value); bool imagePusherIsSet() const; @@ -260,6 +268,8 @@ protected: bool m_BufferIsSet; org::openapitools::server::model::Indexing_settings m_Indexing; bool m_IndexingIsSet; + org::openapitools::server::model::Bragg_integration_settings m_Bragg_integration; + bool m_Bragg_integrationIsSet; org::openapitools::server::model::Image_pusher_status m_Image_pusher; bool m_Image_pusherIsSet; diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index cd5b48fb..e5532ba1 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -340,6 +340,19 @@ components: - "BeamCenter" - "OrientationOnly" - "None" + integration_model: + type: string + description: | + Bragg spot integration model. + ProfileGaussian - profile fit with a measured-width Gaussian (Kabsch-style), the default; more + accurate intensities than box summation. + ProfileEmpirical - profile fit with a per-resolution-shell empirical profile learned from strong spots. + BoxSum - classical uniform box summation minus a ring-mean background; the simpler, faster fallback. + enum: + - "ProfileGaussian" + - "ProfileEmpirical" + - "BoxSum" + default: "ProfileGaussian" dataset_settings: type: object required: @@ -1714,6 +1727,8 @@ components: $ref: '#/components/schemas/image_buffer_status' indexing: $ref: '#/components/schemas/indexing_settings' + bragg_integration: + $ref: '#/components/schemas/bragg_integration_settings' image_pusher: $ref: '#/components/schemas/image_pusher_status' error_message: @@ -2313,6 +2328,14 @@ components: type: string example: 10.1.1.7 description: IPv4 address of the block device + bragg_integration_settings: + type: object + description: "Settings for Bragg spot integration" + required: + - integration_model + properties: + integration_model: + $ref: '#/components/schemas/integration_model' jfjoch_settings: type: object required: @@ -2340,6 +2363,8 @@ components: $ref: '#/components/schemas/detector' indexing: $ref: '#/components/schemas/indexing_settings' + bragg_integration: + $ref: '#/components/schemas/bragg_integration_settings' detector_settings: $ref: '#/components/schemas/detector_settings' azim_int: @@ -2679,6 +2704,42 @@ paths: application/json: schema: $ref: '#/components/schemas/indexing_settings' + /config/bragg_integration: + put: + summary: Change Bragg integration settings + description: | + This can only be done when detector is `Idle`, `Error` or `Inactive` states. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/bragg_integration_settings' + responses: + "200": + description: Everything OK + "400": + description: Input parsing or validation error + content: + text/plain: + schema: + type: string + description: Exception error + "500": + description: Error within Jungfraujoch code - see output message. + content: + application/json: + schema: + $ref: '#/components/schemas/error_message' + get: + summary: Get Bragg integration configuration + description: Can be done anytime + responses: + "200": + description: Everything OK + content: + application/json: + schema: + $ref: '#/components/schemas/bragg_integration_settings' /config/file_writer: put: summary: Change file writer settings diff --git a/broker/redoc-static.html b/broker/redoc-static.html index a65942a3..71316cd2 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -367,7 +367,7 @@ data-styled.g138[id="sc-dxcDKg"]{content:"eajCCh,"}/*!sc*/ -

Collect dark current for the detector

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

+
http://localhost:5232/initialize

Response samples

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

Collect dark current for the detector

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

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

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

Responses

Response samples

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

Start detector

Start data acquisition. +

http://localhost:5232/pedestal

Response samples

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

Start detector

Start data acquisition. Detector must be in Idle state. Default behavior is for the call to block until detector is ready to accept soft/TTL triggers. However, this behavior can be changed by settings async_start to true in the request body, @@ -512,7 +512,7 @@ Assuming that Smargon is used as static positioner and not moving during the sca

Request samples

Content type
application/json
{
  • "images_per_trigger": 1,
  • "ntrigger": 1,
  • "image_time_us": 0,
  • "beam_x_pxl": 0.1,
  • "beam_y_pxl": 0.1,
  • "detector_distance_mm": 0.1,
  • "incident_energy_keV": 0.001,
  • "file_prefix": "",
  • "images_per_file": 1000,
  • "space_group_number": 1,
  • "sample_name": "",
  • "compression": "bslz4",
  • "total_flux": 0.1,
  • "transmission": 1,
  • "goniometer": {
    },
  • "grid_scan": {
    },
  • "header_appendix": null,
  • "image_appendix": null,
  • "data_reduction_factor_serialmx": 1,
  • "pixel_value_low_threshold": 0,
  • "run_number": 0,
  • "run_name": "string",
  • "experiment_group": "string",
  • "poisson_compression": 16,
  • "write_nxmx_hdf5_master": true,
  • "save_calibration": true,
  • "polarization_factor": -1,
  • "ring_current_mA": 0.1,
  • "sample_temperature_K": 0.1,
  • "poni_rot1_rad": 0,
  • "poni_rot2_rad": 0,
  • "poni_rot3_rad": 0,
  • "unit_cell": {
    },
  • "spot_finding": true,
  • "smargon": {
    },
  • "max_spot_count": 250,
  • "detect_ice_rings": true,
  • "async_start": false,
  • "xray_fluorescence_spectrum": {
    }
}

Response samples

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

Wait for acquisition running

Block execution of external script till detector and Jungfraujoch are ready to collect data. +

http://localhost:5232/start

Request samples

Content type
application/json
{
  • "images_per_trigger": 1,
  • "ntrigger": 1,
  • "image_time_us": 0,
  • "beam_x_pxl": 0.1,
  • "beam_y_pxl": 0.1,
  • "detector_distance_mm": 0.1,
  • "incident_energy_keV": 0.001,
  • "file_prefix": "",
  • "images_per_file": 1000,
  • "space_group_number": 1,
  • "sample_name": "",
  • "compression": "bslz4",
  • "total_flux": 0.1,
  • "transmission": 1,
  • "goniometer": {
    },
  • "grid_scan": {
    },
  • "header_appendix": null,
  • "image_appendix": null,
  • "data_reduction_factor_serialmx": 1,
  • "pixel_value_low_threshold": 0,
  • "run_number": 0,
  • "run_name": "string",
  • "experiment_group": "string",
  • "poisson_compression": 16,
  • "write_nxmx_hdf5_master": true,
  • "save_calibration": true,
  • "polarization_factor": -1,
  • "ring_current_mA": 0.1,
  • "sample_temperature_K": 0.1,
  • "poni_rot1_rad": 0,
  • "poni_rot2_rad": 0,
  • "poni_rot3_rad": 0,
  • "unit_cell": {
    },
  • "spot_finding": true,
  • "smargon": {
    },
  • "max_spot_count": 250,
  • "detect_ice_rings": true,
  • "async_start": false,
  • "xray_fluorescence_spectrum": {
    }
}

Response samples

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

Wait for acquisition running

Block execution of external script till detector and Jungfraujoch are ready to collect data. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection.

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

Timeout in seconds (0 == immediate response)

@@ -522,7 +522,7 @@ Extending timeout is possible, but requires to ensure safety that client will no

Response samples

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

Wait for acquisition done

Block execution of external script till initialization, data collection or pedestal is finished. +

http://localhost:5232/wait_until_running

Response samples

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

Wait for acquisition done

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

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

@@ -533,7 +533,7 @@ Extending timeout is possible, but requires to ensure safety that client will no

Response samples

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

Send soft trigger to the detector

Generate soft trigger

+
http://localhost:5232/wait_till_done

Response samples

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

Send soft trigger to the detector

Generate soft trigger

Responses

Cancel running data collection

Command will inform FPGA network card to stop pedestal or data collection at the current stage. @@ -548,7 +548,7 @@ Should be used always before turning off power from the detector.

Responses

Response samples

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

Change detector configuration

Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. +

http://localhost:5232/deactivate

Response samples

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

Change detector configuration

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

@@ -578,10 +578,10 @@ This might lead to increased start time.

Request samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Response samples

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

Get detector configuration

Can be done anytime

+
http://localhost:5232/config/detector

Request samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Response samples

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

Get detector configuration

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Change indexing algorithm settings

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

+
http://localhost:5232/config/detector

Response samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Change indexing algorithm settings

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

Request Body schema: application/json
algorithm
required
string (indexing_algorithm)
Default: "FFBIDX"
Enum: "FFBIDX" "FFT" "FFTW" "Auto" "None"

Selection of an indexing algorithm used by Jungfraujoch

fft_max_unit_cell_A
required
number <float> [ 50 .. 500 ]
Default: 250

Largest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT

fft_min_unit_cell_A
required
number <float> [ 5 .. 40 ]
Default: 10

Smallest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT

@@ -604,10 +604,23 @@ If set to true, the thread pool will block until a thread is available.

Request samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5,
  • "blocking": true
}

Response samples

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

Get indexing configuration

Can be done anytime

+
http://localhost:5232/config/indexing

Request samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5,
  • "blocking": true
}

Response samples

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

Get indexing configuration

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5,
  • "blocking": true
}

Change file writer settings

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

+
http://localhost:5232/config/indexing

Response samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5,
  • "blocking": true
}

Change Bragg integration settings

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

+
Request Body schema: application/json
integration_model
required
string (integration_model)
Default: "ProfileGaussian"
Enum: "ProfileGaussian" "ProfileEmpirical" "BoxSum"

Bragg spot integration model. +ProfileGaussian - profile fit with a measured-width Gaussian (Kabsch-style), the default; more + accurate intensities than box summation. +ProfileEmpirical - profile fit with a per-resolution-shell empirical profile learned from strong spots. +BoxSum - classical uniform box summation minus a ring-mean background; the simpler, faster fallback.

+

Responses

Request samples

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

Response samples

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

Get Bragg integration configuration

Can be done anytime

+

Responses

Response samples

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

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: "NXmxLegacy"
Enum: "NXmxOnlyData" "NXmxLegacy" "NXmxVDS" "NXmxIntegrated" "CBF" "TIFF" "NoFileWritten"

NoFileWritten - no files are written at all NXmxOnlyData - only data files are written, no master file @@ -619,10 +632,10 @@ TIFF - TIFF format (no metadata)

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:

@@ -645,10 +658,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

@@ -670,18 +683,18 @@ 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

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

indexing
required
boolean
Default: true

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

@@ -698,10 +711,10 @@ This option should be turned OFF for small molecule datasets or for crystals wit

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.02,
  • "high_res_gap_Q_recipA": 1.5
}

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.02,
  • "high_res_gap_Q_recipA": 1.5
}

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.02,
  • "high_res_gap_Q_recipA": 1.5
}

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.02,
  • "high_res_gap_Q_recipA": 1.5
}

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
required
number <float> [ 0.00002 .. 10 ]
low_q_recipA
required
number <float> [ 0.00001 .. 10 ]
q_spacing
required
number <float> >= 0.00001
azimuthal_bins
integer <int64> [ 1 .. 512 ]
Default: 1

Numer of azimuthal (phi) bins; 1 = standard 1D azimuthal integration

@@ -712,10 +725,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

@@ -736,10 +749,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.

@@ -755,9 +768,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.

@@ -770,9 +783,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

@@ -783,48 +796,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": {
    },
  • "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": {
    },
  • "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" "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" "image_scale_b" "compression_ratio"

Type of requested plot

+
type
required
string
Enum: "bkg_estimate" "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" "image_scale_b" "compression_ratio" "ice_ring_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 @@ -883,10 +896,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" "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" "image_scale_b" "compression_ratio"

Type of requested plot

+
query Parameters
type
required
string
Enum: "bkg_estimate" "azint" "azint_1d" "spot_count" "spot_count_low_res" "spot_count_indexed" "spot_count_ice" "indexing_rate" "indexing_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" "image_scale_b" "compression_ratio" "ice_ring_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": [
    ],
  • "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",
  • "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

@@ -921,7 +934,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