From a32c7274a6b42b9b508f41fa24ad47b6e45c38f2 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Thu, 20 Jun 2024 11:26:40 +0200 Subject: [PATCH] Release 1.0.0_rc.9 --- VERSION | 2 +- broker/JFJochBrokerHttp.cpp | 31 +- broker/JFJochBrokerParser.cpp | 14 +- broker/JFJochStateMachine.cpp | 11 +- broker/JFJochStateMachine.h | 3 + broker/gen/model/Dataset_settings.cpp | 166 +- broker/gen/model/Dataset_settings.h | 52 +- broker/gen/model/Measurement_statistics.cpp | 60 +- broker/gen/model/Measurement_statistics.h | 18 + broker/gen/model/Rotation_axis.cpp | 43 + broker/gen/model/Rotation_axis.h | 10 + broker/gen/model/Spot_finding_settings.cpp | 2 +- broker/jfjoch_api.yaml | 42 +- broker/jfjoch_broker.cpp | 6 +- broker/redoc-static.html | 1401 +++++++++-------- common/DatasetSettings.cpp | 61 +- common/DatasetSettings.h | 23 +- common/Definitions.h | 6 +- common/DiffractionExperiment.cpp | 83 +- common/DiffractionExperiment.h | 26 +- frame_serialize/CBORStream2Deserializer.cpp | 31 +- frame_serialize/CBORStream2Serializer.cpp | 23 +- frame_serialize/JFJochMessages.h | 9 +- frame_serialize/README.md | 170 +- frontend_ui/src/App.tsx | 5 +- .../src/components/BkgEstimatePlot.tsx | 25 - .../src/components/DataProcessingPlots.tsx | 14 +- .../src/components/DetectorSettings.tsx | 4 +- frontend_ui/src/components/DetectorStatus.tsx | 28 +- .../src/components/MeasurementStatistics.tsx | 21 +- .../src/openapi/models/dataset_settings.ts | 24 +- .../src/openapi/models/detector_status.ts | 4 +- .../openapi/models/measurement_statistics.ts | 10 + .../src/openapi/models/rotation_axis.ts | 4 + receiver/JFJochReceiver.cpp | 8 +- tests/CBORTest.cpp | 22 +- tests/DiffractionExperimentTest.cpp | 80 +- tests/HDF5WritingTest.cpp | 22 +- writer/CMakeLists.txt | 3 - writer/HDF5DataFile.cpp | 17 +- writer/HDF5DataFile.h | 5 +- writer/HDF5NXmx.cpp | 15 +- writer/HDF5Sum.cpp | 91 -- writer/HDF5Writer.cpp | 17 +- 44 files changed, 1524 insertions(+), 1188 deletions(-) delete mode 100644 frontend_ui/src/components/BkgEstimatePlot.tsx delete mode 100644 writer/HDF5Sum.cpp diff --git a/VERSION b/VERSION index ec704b82..346566be 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0_rc.8 +1.0.0_rc.9 diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index b9fbf82f..b3e43168 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -52,6 +52,7 @@ inline org::openapitools::server::model::Measurement_statistics Convert(const Me if (!input.file_prefix.empty()) ret.setFilePrefix(input.file_prefix); + ret.setExperimentGroup(input.experiment_group); ret.setImagesExpected(input.images_expected); ret.setImagesCollected(input.images_collected); ret.setImagesSent(input.images_sent); @@ -75,7 +76,7 @@ inline org::openapitools::server::model::Measurement_statistics Convert(const Me if (input.bkg_estimate) ret.setBkgEstimate(input.bkg_estimate.value()); ret.setUnitCell(input.unit_cell); - + ret.setRunNumber(input.run_number); return ret; } @@ -192,10 +193,10 @@ inline org::openapitools::server::model::Detector_status Convert(const DetectorS output.setHighVoltageV(input.high_voltage_V); switch (input.power_state) { case DetectorPowerState::ON: - output.setPowerchip("On"); + output.setPowerchip("PowerOn"); break; case DetectorPowerState::OFF: - output.setPowerchip("Off"); + output.setPowerchip("PowerOff"); break; case DetectorPowerState::PARTIAL: output.setPowerchip("Partial"); @@ -336,6 +337,10 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s ret.ImagesPerTrigger(input.getImagesPerTrigger()); ret.NumTriggers(input.getNtrigger()); + if (input.runNumberIsSet()) + ret.RunNumber(input.getRunNumber()); + ret.ExperimentGroup(input.getExperimentGroup()); + if (!input.fpgaOutputIsSet()) ret.FPGAOutputMode(FPGAPixelOutput::Auto); else { @@ -358,9 +363,8 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s ret.BeamX_pxl(input.getBeamXPxl()); ret.BeamY_pxl(input.getBeamYPxl()); ret.DetectorDistance_mm(input.getDetectorDistanceMm()); - ret.PhotonEnergy_keV(input.getPhotonEnergyKeV()); - - ret.PhotonEnergyMultiplayer(input.getPhotonEnergyMultiplier()); + ret.PhotonEnergy_keV(input.getIncidentEnergyKeV()); + ret.PhotonEnergyMultiplayer(input.getEnergyMultiplier()); ret.FilePrefix(input.getFilePrefix()); @@ -395,12 +399,15 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s if (input.transmissionIsSet()) ret.AttenuatorTransmission(input.getTransmission()); - if (input.omegaIsSet()) { - ret.OmegaStep(input.getOmega().getStep()); - ret.OmegaStart(input.getOmega().getStart()); - if (input.getOmega().getVector().size() == 3) { - auto v = input.getOmega().getVector(); - ret.OmegaAxis(Coord(v[0], v[1], v[2])); + if (input.goniometerIsSet()) { + ret.Goniometer(GoniometerAxis{ + .name = input.getGoniometer().getName(), + .increment = input.getGoniometer().getStep(), + .start = input.getGoniometer().getStart() + }); + if (input.getGoniometer().getVector().size() == 3) { + auto v = input.getGoniometer().getVector(); + ret.RotationAxis(Coord(v[0], v[1], v[2])); } } diff --git a/broker/JFJochBrokerParser.cpp b/broker/JFJochBrokerParser.cpp index 96138912..01bd9916 100644 --- a/broker/JFJochBrokerParser.cpp +++ b/broker/JFJochBrokerParser.cpp @@ -304,19 +304,21 @@ void ParseFacilityConfiguration(const nlohmann::json &input, const std::string& auto j = input[tag]; experiment.SourceName(GET_STR(j, "source_name")); experiment.SourceNameShort(GET_STR(j, "source_name_short")); + experiment.SourceType(GET_STR(j, "source_type", "")); + experiment.InstrumentName(GET_STR(j, "instrument_name")); experiment.InstrumentNameShort(GET_STR(j, "instrument_name_short")); experiment.PulsedSource(GET_BOOL(j, "pulsed_source", false)); - if (j.contains("omega_axis")) { - if (j["omega_axis"].is_array() && (j["omega_axis"].size() == 3)) - experiment.DefaultOmegaAxis(Coord(j["omega_axis"][0].get(), - j["omega_axis"][1].get(), - j["omega_axis"][2].get())); + if (j.contains("rotation_axis")) { + if (j["rotation_axis"].is_array() && (j["rotation_axis"].size() == 3)) + experiment.DefaultRotationAxis(Coord(j["rotation_axis"][0].get(), + j["rotation_axis"][1].get(), + j["rotation_axis"][2].get())); else throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, - "omega_axis must be float array of 3"); + "rotation_axis must be float array of 3"); } if (j.contains("pedestal_g0_frames")) diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index ef0e22ca..688686d6 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -324,7 +324,7 @@ void JFJochStateMachine::Start(const DatasetSettings& settings) { else experiment.StorageCellStart(0); - experiment.IncrementSeriesID(); + experiment.IncrementRunNumber(); try { state = JFJochState::Busy; @@ -401,6 +401,9 @@ void JFJochStateMachine::SetFullMeasurementOutput(const JFJochServicesOutput &ou MeasurementStatistics tmp{}; // reset last measurement statistics tmp.file_prefix = experiment.GetFilePrefix(); + tmp.run_number = experiment.GetRunNumber(); + tmp.experiment_group = experiment.GetExperimentGroup(); + tmp.detector_width = experiment.GetXPixelsNum(); tmp.detector_height = experiment.GetYPixelsNum(); tmp.detector_pixel_depth = experiment.GetPixelDepth(); @@ -427,6 +430,9 @@ void JFJochStateMachine::ClearAndSetMeasurementStatistics() { MeasurementStatistics tmp{}; tmp.file_prefix = experiment.GetFilePrefix(); + tmp.run_number = experiment.GetRunNumber(); + tmp.experiment_group = experiment.GetExperimentGroup(); + tmp.detector_height = experiment.GetXPixelsNum(); tmp.detector_width = experiment.GetYPixelsNum(); tmp.detector_pixel_depth = experiment.GetPixelDepth(); @@ -448,6 +454,9 @@ std::optional JFJochStateMachine::GetMeasurementStatistic MeasurementStatistics tmp; tmp.file_prefix = experiment.GetFilePrefix(); + tmp.run_number = experiment.GetRunNumber(); + tmp.experiment_group = experiment.GetExperimentGroup(); + tmp.detector_width = experiment.GetXPixelsNum(); tmp.detector_height = experiment.GetYPixelsNum(); tmp.detector_pixel_depth = experiment.GetPixelDepth(); diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index 3d5132d1..3d00e3d3 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -37,6 +37,9 @@ struct DetectorList { struct MeasurementStatistics { std::string file_prefix; + std::string experiment_group; + int64_t run_number; + int64_t images_expected; int64_t images_collected; int64_t images_sent; diff --git a/broker/gen/model/Dataset_settings.cpp b/broker/gen/model/Dataset_settings.cpp index aa9bc642..fcfa8562 100644 --- a/broker/gen/model/Dataset_settings.cpp +++ b/broker/gen/model/Dataset_settings.cpp @@ -30,7 +30,7 @@ Dataset_settings::Dataset_settings() m_Beam_x_pxl = 0.0f; m_Beam_y_pxl = 0.0f; m_Detector_distance_mm = 0.0f; - m_Photon_energy_keV = 0.0f; + m_Incident_energy_keV = 0.0f; m_File_prefix = ""; m_File_prefixIsSet = false; m_Images_per_file = 1000L; @@ -46,15 +46,19 @@ Dataset_settings::Dataset_settings() m_Total_fluxIsSet = false; m_Transmission = 0.0f; m_TransmissionIsSet = false; - m_OmegaIsSet = false; + m_GoniometerIsSet = false; m_Header_appendix = ""; m_Header_appendixIsSet = false; m_Image_appendix = ""; m_Image_appendixIsSet = false; - m_Photon_energy_multiplier = 1.0f; - m_Photon_energy_multiplierIsSet = false; + m_Energy_multiplier = 1.0f; + m_Energy_multiplierIsSet = false; m_Data_reduction_factor_serialmx = 1.0f; m_Data_reduction_factor_serialmxIsSet = false; + m_Run_number = 0L; + m_Run_numberIsSet = false; + m_Experiment_group = ""; + m_Experiment_groupIsSet = false; m_Unit_cellIsSet = false; } @@ -141,9 +145,9 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP } - /* Photon_energy_keV */ { - const float& value = m_Photon_energy_keV; - const std::string currentValuePath = _pathPrefix + ".photonEnergyKeV"; + /* Incident_energy_keV */ { + const float& value = m_Incident_energy_keV; + const std::string currentValuePath = _pathPrefix + ".incidentEnergyKeV"; if (value < static_cast(0)) @@ -206,10 +210,10 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP } - if (photonEnergyMultiplierIsSet()) + if (energyMultiplierIsSet()) { - const float& value = m_Photon_energy_multiplier; - const std::string currentValuePath = _pathPrefix + ".photonEnergyMultiplier"; + const float& value = m_Energy_multiplier; + const std::string currentValuePath = _pathPrefix + ".energyMultiplier"; if (value < static_cast(0.015625)) @@ -243,7 +247,21 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP } } + + if (runNumberIsSet()) + { + const int64_t& value = m_Run_number; + const std::string currentValuePath = _pathPrefix + ".runNumber"; + + if (value < 0ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + + } + return success; } @@ -270,7 +288,7 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const (getDetectorDistanceMm() == rhs.getDetectorDistanceMm()) && - (getPhotonEnergyKeV() == rhs.getPhotonEnergyKeV()) + (getIncidentEnergyKeV() == rhs.getIncidentEnergyKeV()) && @@ -298,7 +316,7 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const ((!transmissionIsSet() && !rhs.transmissionIsSet()) || (transmissionIsSet() && rhs.transmissionIsSet() && getTransmission() == rhs.getTransmission())) && - ((!omegaIsSet() && !rhs.omegaIsSet()) || (omegaIsSet() && rhs.omegaIsSet() && getOmega() == rhs.getOmega())) && + ((!goniometerIsSet() && !rhs.goniometerIsSet()) || (goniometerIsSet() && rhs.goniometerIsSet() && getGoniometer() == rhs.getGoniometer())) && ((!headerAppendixIsSet() && !rhs.headerAppendixIsSet()) || (headerAppendixIsSet() && rhs.headerAppendixIsSet() && getHeaderAppendix() == rhs.getHeaderAppendix())) && @@ -307,12 +325,18 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const ((!imageAppendixIsSet() && !rhs.imageAppendixIsSet()) || (imageAppendixIsSet() && rhs.imageAppendixIsSet() && getImageAppendix() == rhs.getImageAppendix())) && - ((!photonEnergyMultiplierIsSet() && !rhs.photonEnergyMultiplierIsSet()) || (photonEnergyMultiplierIsSet() && rhs.photonEnergyMultiplierIsSet() && getPhotonEnergyMultiplier() == rhs.getPhotonEnergyMultiplier())) && + ((!energyMultiplierIsSet() && !rhs.energyMultiplierIsSet()) || (energyMultiplierIsSet() && rhs.energyMultiplierIsSet() && getEnergyMultiplier() == rhs.getEnergyMultiplier())) && ((!dataReductionFactorSerialmxIsSet() && !rhs.dataReductionFactorSerialmxIsSet()) || (dataReductionFactorSerialmxIsSet() && rhs.dataReductionFactorSerialmxIsSet() && getDataReductionFactorSerialmx() == rhs.getDataReductionFactorSerialmx())) && + ((!runNumberIsSet() && !rhs.runNumberIsSet()) || (runNumberIsSet() && rhs.runNumberIsSet() && getRunNumber() == rhs.getRunNumber())) && + + + ((!experimentGroupIsSet() && !rhs.experimentGroupIsSet()) || (experimentGroupIsSet() && rhs.experimentGroupIsSet() && getExperimentGroup() == rhs.getExperimentGroup())) && + + ((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell())) ; @@ -335,7 +359,7 @@ void to_json(nlohmann::json& j, const Dataset_settings& o) j["beam_x_pxl"] = o.m_Beam_x_pxl; j["beam_y_pxl"] = o.m_Beam_y_pxl; j["detector_distance_mm"] = o.m_Detector_distance_mm; - j["photon_energy_keV"] = o.m_Photon_energy_keV; + j["incident_energy_keV"] = o.m_Incident_energy_keV; if(o.filePrefixIsSet()) j["file_prefix"] = o.m_File_prefix; if(o.imagesPerFileIsSet()) @@ -351,16 +375,20 @@ void to_json(nlohmann::json& j, const Dataset_settings& o) j["total_flux"] = o.m_Total_flux; if(o.transmissionIsSet()) j["transmission"] = o.m_Transmission; - if(o.omegaIsSet()) - j["omega"] = o.m_Omega; + if(o.goniometerIsSet()) + j["goniometer"] = o.m_Goniometer; if(o.headerAppendixIsSet()) j["header_appendix"] = o.m_Header_appendix; if(o.imageAppendixIsSet()) j["image_appendix"] = o.m_Image_appendix; - if(o.photonEnergyMultiplierIsSet()) - j["photon_energy_multiplier"] = o.m_Photon_energy_multiplier; + if(o.energyMultiplierIsSet()) + j["energy_multiplier"] = o.m_Energy_multiplier; if(o.dataReductionFactorSerialmxIsSet()) j["data_reduction_factor_serialmx"] = o.m_Data_reduction_factor_serialmx; + if(o.runNumberIsSet()) + j["run_number"] = o.m_Run_number; + if(o.experimentGroupIsSet()) + j["experiment_group"] = o.m_Experiment_group; if(o.unitCellIsSet()) j["unit_cell"] = o.m_Unit_cell; @@ -386,7 +414,7 @@ void from_json(const nlohmann::json& j, Dataset_settings& o) j.at("beam_x_pxl").get_to(o.m_Beam_x_pxl); j.at("beam_y_pxl").get_to(o.m_Beam_y_pxl); j.at("detector_distance_mm").get_to(o.m_Detector_distance_mm); - j.at("photon_energy_keV").get_to(o.m_Photon_energy_keV); + j.at("incident_energy_keV").get_to(o.m_Incident_energy_keV); if(j.find("file_prefix") != j.end()) { j.at("file_prefix").get_to(o.m_File_prefix); @@ -423,10 +451,10 @@ void from_json(const nlohmann::json& j, Dataset_settings& o) j.at("transmission").get_to(o.m_Transmission); o.m_TransmissionIsSet = true; } - if(j.find("omega") != j.end()) + if(j.find("goniometer") != j.end()) { - j.at("omega").get_to(o.m_Omega); - o.m_OmegaIsSet = true; + j.at("goniometer").get_to(o.m_Goniometer); + o.m_GoniometerIsSet = true; } if(j.find("header_appendix") != j.end()) { @@ -438,16 +466,26 @@ void from_json(const nlohmann::json& j, Dataset_settings& o) j.at("image_appendix").get_to(o.m_Image_appendix); o.m_Image_appendixIsSet = true; } - if(j.find("photon_energy_multiplier") != j.end()) + if(j.find("energy_multiplier") != j.end()) { - j.at("photon_energy_multiplier").get_to(o.m_Photon_energy_multiplier); - o.m_Photon_energy_multiplierIsSet = true; + j.at("energy_multiplier").get_to(o.m_Energy_multiplier); + o.m_Energy_multiplierIsSet = true; } if(j.find("data_reduction_factor_serialmx") != j.end()) { j.at("data_reduction_factor_serialmx").get_to(o.m_Data_reduction_factor_serialmx); o.m_Data_reduction_factor_serialmxIsSet = true; } + if(j.find("run_number") != j.end()) + { + j.at("run_number").get_to(o.m_Run_number); + o.m_Run_numberIsSet = true; + } + if(j.find("experiment_group") != j.end()) + { + j.at("experiment_group").get_to(o.m_Experiment_group); + o.m_Experiment_groupIsSet = true; + } if(j.find("unit_cell") != j.end()) { j.at("unit_cell").get_to(o.m_Unit_cell); @@ -531,13 +569,13 @@ void Dataset_settings::setDetectorDistanceMm(float const value) { m_Detector_distance_mm = value; } -float Dataset_settings::getPhotonEnergyKeV() const +float Dataset_settings::getIncidentEnergyKeV() const { - return m_Photon_energy_keV; + return m_Incident_energy_keV; } -void Dataset_settings::setPhotonEnergyKeV(float const value) +void Dataset_settings::setIncidentEnergyKeV(float const value) { - m_Photon_energy_keV = value; + m_Incident_energy_keV = value; } std::string Dataset_settings::getFilePrefix() const { @@ -666,22 +704,22 @@ void Dataset_settings::unsetTransmission() { m_TransmissionIsSet = false; } -org::openapitools::server::model::Rotation_axis Dataset_settings::getOmega() const +org::openapitools::server::model::Rotation_axis Dataset_settings::getGoniometer() const { - return m_Omega; + return m_Goniometer; } -void Dataset_settings::setOmega(org::openapitools::server::model::Rotation_axis const& value) +void Dataset_settings::setGoniometer(org::openapitools::server::model::Rotation_axis const& value) { - m_Omega = value; - m_OmegaIsSet = true; + m_Goniometer = value; + m_GoniometerIsSet = true; } -bool Dataset_settings::omegaIsSet() const +bool Dataset_settings::goniometerIsSet() const { - return m_OmegaIsSet; + return m_GoniometerIsSet; } -void Dataset_settings::unsetOmega() +void Dataset_settings::unsetGoniometer() { - m_OmegaIsSet = false; + m_GoniometerIsSet = false; } std::string Dataset_settings::getHeaderAppendix() const { @@ -717,22 +755,22 @@ void Dataset_settings::unsetImage_appendix() { m_Image_appendixIsSet = false; } -float Dataset_settings::getPhotonEnergyMultiplier() const +float Dataset_settings::getEnergyMultiplier() const { - return m_Photon_energy_multiplier; + return m_Energy_multiplier; } -void Dataset_settings::setPhotonEnergyMultiplier(float const value) +void Dataset_settings::setEnergyMultiplier(float const value) { - m_Photon_energy_multiplier = value; - m_Photon_energy_multiplierIsSet = true; + m_Energy_multiplier = value; + m_Energy_multiplierIsSet = true; } -bool Dataset_settings::photonEnergyMultiplierIsSet() const +bool Dataset_settings::energyMultiplierIsSet() const { - return m_Photon_energy_multiplierIsSet; + return m_Energy_multiplierIsSet; } -void Dataset_settings::unsetPhoton_energy_multiplier() +void Dataset_settings::unsetEnergy_multiplier() { - m_Photon_energy_multiplierIsSet = false; + m_Energy_multiplierIsSet = false; } float Dataset_settings::getDataReductionFactorSerialmx() const { @@ -751,6 +789,40 @@ void Dataset_settings::unsetData_reduction_factor_serialmx() { m_Data_reduction_factor_serialmxIsSet = false; } +int64_t Dataset_settings::getRunNumber() const +{ + return m_Run_number; +} +void Dataset_settings::setRunNumber(int64_t const value) +{ + m_Run_number = value; + m_Run_numberIsSet = true; +} +bool Dataset_settings::runNumberIsSet() const +{ + return m_Run_numberIsSet; +} +void Dataset_settings::unsetRun_number() +{ + m_Run_numberIsSet = false; +} +std::string Dataset_settings::getExperimentGroup() const +{ + return m_Experiment_group; +} +void Dataset_settings::setExperimentGroup(std::string const& value) +{ + m_Experiment_group = value; + m_Experiment_groupIsSet = true; +} +bool Dataset_settings::experimentGroupIsSet() const +{ + return m_Experiment_groupIsSet; +} +void Dataset_settings::unsetExperiment_group() +{ + m_Experiment_groupIsSet = false; +} org::openapitools::server::model::Dataset_settings_unit_cell Dataset_settings::getUnitCell() const { return m_Unit_cell; diff --git a/broker/gen/model/Dataset_settings.h b/broker/gen/model/Dataset_settings.h index 4b44157d..54979f2f 100644 --- a/broker/gen/model/Dataset_settings.h +++ b/broker/gen/model/Dataset_settings.h @@ -97,10 +97,10 @@ public: float getDetectorDistanceMm() const; void setDetectorDistanceMm(float const value); /// - /// Used to calculate /entry/beam/incident_wavelength in NXmx Incident photon energy in keV + /// Used to calculate /entry/beam/incident_wavelength in NXmx Incident particle (photon, electron) energy in keV /// - float getPhotonEnergyKeV() const; - void setPhotonEnergyKeV(float const value); + float getIncidentEnergyKeV() const; + void setIncidentEnergyKeV(float const value); /// /// Prefix for filenames. If left empty, no file will be saved. /// @@ -158,10 +158,10 @@ public: /// /// /// - org::openapitools::server::model::Rotation_axis getOmega() const; - void setOmega(org::openapitools::server::model::Rotation_axis const& value); - bool omegaIsSet() const; - void unsetOmega(); + org::openapitools::server::model::Rotation_axis getGoniometer() const; + void setGoniometer(org::openapitools::server::model::Rotation_axis const& value); + bool goniometerIsSet() const; + void unsetGoniometer(); /// /// Header appendix, added as user_data to start message /// @@ -177,12 +177,12 @@ public: bool imageAppendixIsSet() const; void unsetImage_appendix(); /// - /// For JUNGFRAU conversion it is possible to multiply energy by a given factor to get fractional/multiplied photon counts + /// For JUNGFRAU conversion it is possible to multiply incident energy by a given factor to get fractional/multiplied particle counts /// - float getPhotonEnergyMultiplier() const; - void setPhotonEnergyMultiplier(float const value); - bool photonEnergyMultiplierIsSet() const; - void unsetPhoton_energy_multiplier(); + float getEnergyMultiplier() const; + void setEnergyMultiplier(float const value); + bool energyMultiplierIsSet() const; + void unsetEnergy_multiplier(); /// /// Rate at which non-indexed images are accepted to be forwarded to writer. Value of 1.0 (default) means that all images are written. Values below zero mean that non-indexed images will be accepted with a given probability. /// @@ -191,6 +191,20 @@ public: bool dataReductionFactorSerialmxIsSet() const; void unsetData_reduction_factor_serialmx(); /// + /// Number of run within an experimental session. Transferred over CBOR stream as \"series ID\", though not saved in HDF5 file. It is highly recommended to keep this number unique for each data collection during experimental series. If not provided, the number will be automatically incremented. + /// + int64_t getRunNumber() const; + void setRunNumber(int64_t const value); + bool runNumberIsSet() const; + void unsetRun_number(); + /// + /// Name of group owning the data (e.g. p-group or proposal number). Transferred over CBOR stream, though not saved in HDF5 file. + /// + std::string getExperimentGroup() const; + void setExperimentGroup(std::string const& value); + bool experimentGroupIsSet() const; + void unsetExperiment_group(); + /// /// /// org::openapitools::server::model::Dataset_settings_unit_cell getUnitCell() const; @@ -213,7 +227,7 @@ protected: float m_Detector_distance_mm; - float m_Photon_energy_keV; + float m_Incident_energy_keV; std::string m_File_prefix; bool m_File_prefixIsSet; @@ -231,16 +245,20 @@ protected: bool m_Total_fluxIsSet; float m_Transmission; bool m_TransmissionIsSet; - org::openapitools::server::model::Rotation_axis m_Omega; - bool m_OmegaIsSet; + org::openapitools::server::model::Rotation_axis m_Goniometer; + bool m_GoniometerIsSet; std::string m_Header_appendix; bool m_Header_appendixIsSet; std::string m_Image_appendix; bool m_Image_appendixIsSet; - float m_Photon_energy_multiplier; - bool m_Photon_energy_multiplierIsSet; + float m_Energy_multiplier; + bool m_Energy_multiplierIsSet; float m_Data_reduction_factor_serialmx; bool m_Data_reduction_factor_serialmxIsSet; + int64_t m_Run_number; + bool m_Run_numberIsSet; + std::string m_Experiment_group; + bool m_Experiment_groupIsSet; org::openapitools::server::model::Dataset_settings_unit_cell m_Unit_cell; bool m_Unit_cellIsSet; diff --git a/broker/gen/model/Measurement_statistics.cpp b/broker/gen/model/Measurement_statistics.cpp index cb04c716..8a9b986a 100644 --- a/broker/gen/model/Measurement_statistics.cpp +++ b/broker/gen/model/Measurement_statistics.cpp @@ -23,6 +23,10 @@ Measurement_statistics::Measurement_statistics() { m_File_prefix = ""; m_File_prefixIsSet = false; + m_Run_number = 0L; + m_Run_numberIsSet = false; + m_Experiment_group = ""; + m_Experiment_groupIsSet = false; m_Images_expected = 0L; m_Images_expectedIsSet = false; m_Images_collected = 0L; @@ -75,7 +79,7 @@ bool Measurement_statistics::validate(std::stringstream& msg, const std::string& bool success = true; const std::string _pathPrefix = pathPrefix.empty() ? "Measurement_statistics" : pathPrefix; - + if (collectionEfficiencyIsSet()) { const float& value = m_Collection_efficiency; @@ -121,6 +125,12 @@ bool Measurement_statistics::operator==(const Measurement_statistics& rhs) const ((!filePrefixIsSet() && !rhs.filePrefixIsSet()) || (filePrefixIsSet() && rhs.filePrefixIsSet() && getFilePrefix() == rhs.getFilePrefix())) && + ((!runNumberIsSet() && !rhs.runNumberIsSet()) || (runNumberIsSet() && rhs.runNumberIsSet() && getRunNumber() == rhs.getRunNumber())) && + + + ((!experimentGroupIsSet() && !rhs.experimentGroupIsSet()) || (experimentGroupIsSet() && rhs.experimentGroupIsSet() && getExperimentGroup() == rhs.getExperimentGroup())) && + + ((!imagesExpectedIsSet() && !rhs.imagesExpectedIsSet()) || (imagesExpectedIsSet() && rhs.imagesExpectedIsSet() && getImagesExpected() == rhs.getImagesExpected())) && @@ -178,6 +188,10 @@ void to_json(nlohmann::json& j, const Measurement_statistics& o) j = nlohmann::json(); if(o.filePrefixIsSet()) j["file_prefix"] = o.m_File_prefix; + if(o.runNumberIsSet()) + j["run_number"] = o.m_Run_number; + if(o.experimentGroupIsSet()) + j["experiment_group"] = o.m_Experiment_group; if(o.imagesExpectedIsSet()) j["images_expected"] = o.m_Images_expected; if(o.imagesCollectedIsSet()) @@ -218,6 +232,16 @@ void from_json(const nlohmann::json& j, Measurement_statistics& o) j.at("file_prefix").get_to(o.m_File_prefix); o.m_File_prefixIsSet = true; } + if(j.find("run_number") != j.end()) + { + j.at("run_number").get_to(o.m_Run_number); + o.m_Run_numberIsSet = true; + } + if(j.find("experiment_group") != j.end()) + { + j.at("experiment_group").get_to(o.m_Experiment_group); + o.m_Experiment_groupIsSet = true; + } if(j.find("images_expected") != j.end()) { j.at("images_expected").get_to(o.m_Images_expected); @@ -313,6 +337,40 @@ void Measurement_statistics::unsetFile_prefix() { m_File_prefixIsSet = false; } +int64_t Measurement_statistics::getRunNumber() const +{ + return m_Run_number; +} +void Measurement_statistics::setRunNumber(int64_t const value) +{ + m_Run_number = value; + m_Run_numberIsSet = true; +} +bool Measurement_statistics::runNumberIsSet() const +{ + return m_Run_numberIsSet; +} +void Measurement_statistics::unsetRun_number() +{ + m_Run_numberIsSet = false; +} +std::string Measurement_statistics::getExperimentGroup() const +{ + return m_Experiment_group; +} +void Measurement_statistics::setExperimentGroup(std::string const& value) +{ + m_Experiment_group = value; + m_Experiment_groupIsSet = true; +} +bool Measurement_statistics::experimentGroupIsSet() const +{ + return m_Experiment_groupIsSet; +} +void Measurement_statistics::unsetExperiment_group() +{ + m_Experiment_groupIsSet = false; +} int64_t Measurement_statistics::getImagesExpected() const { return m_Images_expected; diff --git a/broker/gen/model/Measurement_statistics.h b/broker/gen/model/Measurement_statistics.h index 278b9fba..1dcf1f72 100644 --- a/broker/gen/model/Measurement_statistics.h +++ b/broker/gen/model/Measurement_statistics.h @@ -66,6 +66,20 @@ public: bool filePrefixIsSet() const; void unsetFile_prefix(); /// + /// Number of data collection run. This can be either automatically incremented or provided externally for each data collection. + /// + int64_t getRunNumber() const; + void setRunNumber(int64_t const value); + bool runNumberIsSet() const; + void unsetRun_number(); + /// + /// Name of group owning the data (e.g. p-group or proposal number). + /// + std::string getExperimentGroup() const; + void setExperimentGroup(std::string const& value); + bool experimentGroupIsSet() const; + void unsetExperiment_group(); + /// /// /// int64_t getImagesExpected() const; @@ -176,6 +190,10 @@ public: protected: std::string m_File_prefix; bool m_File_prefixIsSet; + int64_t m_Run_number; + bool m_Run_numberIsSet; + std::string m_Experiment_group; + bool m_Experiment_groupIsSet; int64_t m_Images_expected; bool m_Images_expectedIsSet; int64_t m_Images_collected; diff --git a/broker/gen/model/Rotation_axis.cpp b/broker/gen/model/Rotation_axis.cpp index b7e4feb6..45150ddf 100644 --- a/broker/gen/model/Rotation_axis.cpp +++ b/broker/gen/model/Rotation_axis.cpp @@ -21,6 +21,8 @@ namespace org::openapitools::server::model Rotation_axis::Rotation_axis() { + m_Name = "omega"; + m_NameIsSet = false; m_Step = 0.0f; m_Start = 0.0f; m_StartIsSet = false; @@ -47,6 +49,20 @@ bool Rotation_axis::validate(std::stringstream& msg, const std::string& pathPref bool success = true; const std::string _pathPrefix = pathPrefix.empty() ? "Rotation_axis" : pathPrefix; + + if (nameIsSet()) + { + const std::string& value = m_Name; + const std::string currentValuePath = _pathPrefix + ".name"; + + + if (value.length() < 1) + { + success = false; + msg << currentValuePath << ": must be at least 1 characters long;"; + } + + } if (vectorIsSet()) { @@ -87,6 +103,9 @@ bool Rotation_axis::operator==(const Rotation_axis& rhs) const return + + ((!nameIsSet() && !rhs.nameIsSet()) || (nameIsSet() && rhs.nameIsSet() && getName() == rhs.getName())) && + (getStep() == rhs.getStep()) && @@ -107,6 +126,8 @@ bool Rotation_axis::operator!=(const Rotation_axis& rhs) const void to_json(nlohmann::json& j, const Rotation_axis& o) { j = nlohmann::json(); + if(o.nameIsSet()) + j["name"] = o.m_Name; j["step"] = o.m_Step; if(o.startIsSet()) j["start"] = o.m_Start; @@ -117,6 +138,11 @@ void to_json(nlohmann::json& j, const Rotation_axis& o) void from_json(const nlohmann::json& j, Rotation_axis& o) { + if(j.find("name") != j.end()) + { + j.at("name").get_to(o.m_Name); + o.m_NameIsSet = true; + } j.at("step").get_to(o.m_Step); if(j.find("start") != j.end()) { @@ -131,6 +157,23 @@ void from_json(const nlohmann::json& j, Rotation_axis& o) } +std::string Rotation_axis::getName() const +{ + return m_Name; +} +void Rotation_axis::setName(std::string const& value) +{ + m_Name = value; + m_NameIsSet = true; +} +bool Rotation_axis::nameIsSet() const +{ + return m_NameIsSet; +} +void Rotation_axis::unsetName() +{ + m_NameIsSet = false; +} float Rotation_axis::getStep() const { return m_Step; diff --git a/broker/gen/model/Rotation_axis.h b/broker/gen/model/Rotation_axis.h index 0abca528..548cce22 100644 --- a/broker/gen/model/Rotation_axis.h +++ b/broker/gen/model/Rotation_axis.h @@ -19,6 +19,7 @@ #define Rotation_axis_H_ +#include #include #include @@ -58,6 +59,13 @@ public: ///////////////////////////////////////////// /// Rotation_axis members + /// + /// Name of rotation axis (e.g., omega, phi) + /// + std::string getName() const; + void setName(std::string const& value); + bool nameIsSet() const; + void unsetName(); /// /// Angle step in degrees /// @@ -81,6 +89,8 @@ public: friend void to_json(nlohmann::json& j, const Rotation_axis& o); friend void from_json(const nlohmann::json& j, Rotation_axis& o); protected: + std::string m_Name; + bool m_NameIsSet; float m_Step; float m_Start; diff --git a/broker/gen/model/Spot_finding_settings.cpp b/broker/gen/model/Spot_finding_settings.cpp index 98083b07..8b147dc3 100644 --- a/broker/gen/model/Spot_finding_settings.cpp +++ b/broker/gen/model/Spot_finding_settings.cpp @@ -25,7 +25,7 @@ Spot_finding_settings::Spot_finding_settings() m_Indexing = true; m_Filter_powder_rings = false; m_Filter_powder_ringsIsSet = false; - m_Min_spot_count_powder_ring = 20L; + m_Min_spot_count_powder_ring = 0L; m_Min_spot_count_powder_ringIsSet = false; m_Signal_to_noise_threshold = 0.0f; m_Photon_count_threshold = 0L; diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 51fba6e0..cf59eddd 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -11,6 +11,11 @@ components: required: - step properties: + name: + type: string + default: omega + minLength: 1 + description: Name of rotation axis (e.g., omega, phi) step: type: number format: float @@ -37,7 +42,7 @@ components: - beam_x_pxl - beam_y_pxl - detector_distance_mm - - photon_energy_keV + - incident_energy_keV - sample_name properties: images_per_trigger: @@ -86,13 +91,13 @@ components: description: /entry/detector/distance in NXmx Detector distance [mm] - photon_energy_keV: + incident_energy_keV: type: number format: float minimum: 0 description: | Used to calculate /entry/beam/incident_wavelength in NXmx - Incident photon energy in keV + Incident particle (photon, electron) energy in keV file_prefix: type: string default: "" @@ -148,7 +153,7 @@ components: description: | /entry/instrument/attenuator/attenuator_transmission Transmission of attenuator (filter) [no units] - omega: + goniometer: $ref: "#/components/schemas/rotation_axis" header_appendix: type: string @@ -156,13 +161,13 @@ components: image_appendix: type: string description: Image appendix, added as user_data to image message - photon_energy_multiplier: + energy_multiplier: type: number format: float default: 1.0 minimum: 0.015625 maximum: 4.0 - description: For JUNGFRAU conversion it is possible to multiply energy by a given factor to get fractional/multiplied photon counts + description: For JUNGFRAU conversion it is possible to multiply incident energy by a given factor to get fractional/multiplied particle counts data_reduction_factor_serialmx: type: number format: float @@ -173,6 +178,20 @@ components: Rate at which non-indexed images are accepted to be forwarded to writer. Value of 1.0 (default) means that all images are written. Values below zero mean that non-indexed images will be accepted with a given probability. + run_number: + type: integer + format: int64 + minimum: 0 + description: | + Number of run within an experimental session. + Transferred over CBOR stream as "series ID", though not saved in HDF5 file. + It is highly recommended to keep this number unique for each data collection during experimental series. + If not provided, the number will be automatically incremented. + experiment_group: + type: string + description: | + Name of group owning the data (e.g. p-group or proposal number). + Transferred over CBOR stream, though not saved in HDF5 file. unit_cell: type: object description: Units of angstrom and degree @@ -235,7 +254,7 @@ components: powerchip: type: string description: Power on of ASICs - enum: ["On", "Off", "Partial"] + enum: ["PowerOn", "PowerOff", "Partial"] server_version: type: string description: Detector server (on read-out boards) version @@ -459,6 +478,15 @@ components: properties: file_prefix: type: string + run_number: + type: integer + format: int64 + description: | + Number of data collection run. This can be either automatically incremented or provided externally for each data collection. + experiment_group: + type: string + description: | + Name of group owning the data (e.g. p-group or proposal number). images_expected: type: integer format: int64 diff --git a/broker/jfjoch_broker.cpp b/broker/jfjoch_broker.cpp index ebaca167..270335dd 100644 --- a/broker/jfjoch_broker.cpp +++ b/broker/jfjoch_broker.cpp @@ -115,9 +115,9 @@ int main (int argc, char **argv) { logger.Info("Source {} Instrument {} Default rotation axis {:.2f},{:.2f},{:.2f}", experiment.GetSourceName(), experiment.GetInstrumentName(), - experiment.GetDefaultOmegaAxis().x, - experiment.GetDefaultOmegaAxis().y, - experiment.GetDefaultOmegaAxis().z); + experiment.GetDefaultRotationAxis().x, + experiment.GetDefaultRotationAxis().y, + experiment.GetDefaultRotationAxis().z); Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(http_port)); diff --git a/broker/redoc-static.html b/broker/redoc-static.html index bbd2b6ba..9d84de26 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -12,336 +12,337 @@ margin: 0; } - -

Jungfraujoch (1.0.1)

Download OpenAPI specification:Download

Jungfraujoch Broker Web API

-

Initialize detector and data acquisition

Jungfraujoch (1.0.1)

Download OpenAPI specification:Download

Jungfraujoch Broker Web API

+

Initialize detector and data acquisition

Should be used in two cases:

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

Should be used in two cases:

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

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

-

Responses

Response samples

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

Collect dark current for the detector

Responses

Response samples

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

Collect dark current for the detector

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

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

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

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

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

-

Responses

Response samples

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

Start detector

Responses

Response samples

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

Start detector

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

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

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

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

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

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

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

-
summation
integer <int64> [ 1 .. 256 ]
Default: 1
ntrigger
integer <int64> >= 1
Default: 1

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

+
summation
integer <int64> [ 1 .. 256 ]
Default: 1

FPGA frame summation. For summation above two 32-bit pixel format will be used, unless explicitly specified. +" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

FPGA frame summation. For summation above two 32-bit pixel format will be used, unless explicitly specified. Frame summation factor applies only to conversion mode (assumed as 1 for raw data). In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells (assumed as 1).

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

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

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

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

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

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

-
detector_distance_mm
required
number <float> >= 0

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

-
photon_energy_keV
required
number <float> >= 0

Used to calculate /entry/beam/incident_wavelength in NXmx -Incident photon energy in keV

-
file_prefix
string
Default: ""

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

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

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

-
space_group_number
integer <int64> [ 0 .. 194 ]
Default: 0
sample_name
required
string
detector_distance_mm
required
number <float> >= 0

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

+
incident_energy_keV
required
number <float> >= 0

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

+
file_prefix
string
Default: ""

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

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

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

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

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

/entry/sample/name in NXmx Sample name

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

FPGA output data type

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

FPGA output data type

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

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

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

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

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

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

-
object (rotation_axis)

Definition of a crystal rotation axis

-
header_appendix
string

Header appendix, added as user_data to start message

-
image_appendix
string

Image appendix, added as user_data to image message

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

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

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

Definition of a crystal rotation axis

+
header_appendix
string

Header appendix, added as user_data to start message

+
image_appendix
string

Image appendix, added as user_data to image message

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

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

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

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

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

-
object

Units of angstrom and degree

-

Responses

Request samples

Content type
application/json
{
  • "images_per_trigger": 1,
  • "ntrigger": 1,
  • "summation": 1,
  • "beam_x_pxl": 0.1,
  • "beam_y_pxl": 0.1,
  • "detector_distance_mm": 0.1,
  • "photon_energy_keV": 0.1,
  • "file_prefix": "",
  • "images_per_file": 1000,
  • "space_group_number": 0,
  • "sample_name": "string",
  • "fpga_output": "auto",
  • "compression": "bslz4",
  • "total_flux": 0.1,
  • "transmission": 1,
  • "omega": {
    },
  • "header_appendix": "string",
  • "image_appendix": "string",
  • "photon_energy_multiplier": 1,
  • "data_reduction_factor_serialmx": 1,
  • "unit_cell": {
    }
}

Response samples

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

Wait for acquisition done

run_number
integer <int64> >= 0

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

+
experiment_group
string

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

+
object

Units of angstrom and degree

+

Responses

Request samples

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

Response samples

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

Wait for acquisition done

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

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

To not block web server for a long period of time, the procedure is provided with a timeout of 5 seconds.

-

Responses

Response samples

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

Send soft trigger to the detector

Generate soft trigger

-

Responses

Cancel running data collection

Responses

Response samples

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

Send soft trigger to the detector

Generate soft trigger

+

Responses

Cancel running data collection

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

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

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

-

Responses

Prepare detector to turn off

Responses

Prepare detector to turn off

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

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

-

Responses

Response samples

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

Change detector configuration

Responses

Response samples

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

Change detector configuration

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

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

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

Interval between consecutive frames.

-
count_time_us
integer <int64>

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

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

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

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

Turn off conversion of pixel read-out to photon count

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

Delay between two storage cells [us]

-
detector_trigger_delay_us
number <float>

Delay between TTL trigger and acquisition start [us]

-
fixed_gain_g1
boolean
Default: false

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

-
use_gain_hg0
boolean
Default: false

Use high G0 (for low energy applications)

-

Responses

Request samples

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

Response samples

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

Get detector configuration

Can be done anytime

-

Responses

Response samples

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

Configure spot finding

Can be done anytime, also while data collection is running

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

Interval between consecutive frames.

+
count_time_us
integer <int64>

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

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

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

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

Turn off conversion of pixel read-out to photon count

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

Delay between two storage cells [us]

+
detector_trigger_delay_us
number <float>

Delay between TTL trigger and acquisition start [us]

+
fixed_gain_g1
boolean
Default: false

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

+
use_gain_hg0
boolean
Default: false

Use high G0 (for low energy applications)

+

Responses

Request samples

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

Response samples

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

Get detector configuration

Can be done anytime

+

Responses

Response samples

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

Configure spot finding

Can be done anytime, also while data collection is running

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

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

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

-
indexing
required
boolean
Default: true

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

-
filter_powder_rings
boolean
Default: false

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

-
min_spot_count_powder_ring
integer <int64> >= 5
Default: 20

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

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

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

-

Responses

Request samples

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

Get data processing configuration

Can be done anytime

-

Responses

Response samples

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

Configure radial integration

Can be done when detector is Inactive or Idle

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

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

-
solid_angle_corr
required
boolean
Default: true

Apply solid angle correction for radial integration

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

Responses

Request samples

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

Response samples

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

Get radial integration configuration

Can be done anytime

-

Responses

Response samples

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

Load binary image for internal FPGA generator

indexing
required
boolean
Default: true

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

+
filter_powder_rings
boolean
Default: false

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

+
min_spot_count_powder_ring
integer <int64> >= 5

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

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

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

+

Responses

Request samples

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

Get data processing configuration

Can be done anytime

+

Responses

Response samples

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

Configure radial integration

Can be done when detector is Inactive or Idle

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

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

+
solid_angle_corr
required
boolean
Default: true

Apply solid angle correction for radial integration

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

Responses

Request samples

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

Response samples

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

Get radial integration configuration

Can be done anytime

+

Responses

Response samples

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

Load binary image for internal FPGA generator

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

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

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

Image id to upload

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

Responses

Load TIFF image for internal FPGA generator

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

Image id to upload

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

Responses

Load TIFF image for internal FPGA generator

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

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

-
query Parameters
id
integer [ 0 .. 127 ]

Image ID to upload

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

Responses

Select detector

query Parameters
id
integer [ 0 .. 127 ]

Image ID to upload

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

Responses

Select detector

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

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

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

Responses

Request samples

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

Response samples

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

List available detectors

Configured detectors that can be selected by used

-

Responses

Response samples

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

Get Jungfraujoch status

Status of the data acquisition

-

Responses

Response samples

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

Return XFEL pulse IDs for the current data acquisition

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

-

Responses

Response samples

Content type
application/json
[
  • 0
]

Return XFEL event codes for the current data acquisition

Return array of XFEL event codes

-

Responses

Response samples

Content type
application/json
[
  • 0
]

Get detector status

Status of the JUNGFRAU detector

-

Responses

Response samples

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

Get box ROIs

Responses

Response samples

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

Upload box ROIs

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

Responses

Request samples

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

Response samples

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

Get circular ROI

Responses

Response samples

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

Upload circular ROI

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

Responses

Request samples

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

Response samples

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

Generate background estimate plot

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

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate spot count plot

Number of spots per image; binning is configurable

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate indexing rate plot

Image indexing rate; binning is configurable

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate error pixels plot

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

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate strong pixels plot

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

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate ROI sum plot

Sum of ROI rectangle per image; binning is configurable

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate plot of ROI max count

Max count of ROI per image; binning is configurable

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate plot of ROI valid pixels

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

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate receiver delay plot

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

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate receiver free send buffer plot

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

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate image collection efficiency plot

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

-
query Parameters
binning
integer

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

-

Responses

Response samples

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

Generate indexing rate per file

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

-

Responses

Response samples

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

Generate radial integration profile

Generate average radial integration profile

-

Responses

Response samples

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

Generate radial integration profiles per file

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

-

Responses

Response samples

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

Get data collection statistics

Results of the last data collection

-

Responses

Response samples

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

Get calibration statistics

Statistics are provided for each module/storage cell separately

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get last preview image in JPEG format using custom settings

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

Saturation value to set contrast in the preview image

-
show_spots
boolean
Default: true

Show spot finding results on the image

-
show_roi
boolean
Default: false

Show ROI areas on the image

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

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

-
show_indexed
boolean
Default: false

Preview indexed images only

-
show_user_mask
boolean
Default: false

Show user mask

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

Responses

Request samples

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

Response samples

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

Get last preview image in JPEG format using default settings

Responses

Get last preview image in TIFF format

Responses

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

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

-

Responses

Get mask of the detector

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

Responses

Request samples

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

Response samples

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

List available detectors

Configured detectors that can be selected by used

+

Responses

Response samples

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

Get Jungfraujoch status

Status of the data acquisition

+

Responses

Response samples

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

Return XFEL pulse IDs for the current data acquisition

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

+

Responses

Response samples

Content type
application/json
[
  • 0
]

Return XFEL event codes for the current data acquisition

Return array of XFEL event codes

+

Responses

Response samples

Content type
application/json
[
  • 0
]

Get detector status

Status of the JUNGFRAU detector

+

Responses

Response samples

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

Get box ROIs

Responses

Response samples

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

Upload box ROIs

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

Responses

Request samples

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

Response samples

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

Get circular ROI

Responses

Response samples

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

Upload circular ROI

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

Responses

Request samples

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

Response samples

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

Generate background estimate plot

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

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate spot count plot

Number of spots per image; binning is configurable

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate indexing rate plot

Image indexing rate; binning is configurable

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate error pixels plot

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

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate strong pixels plot

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

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate ROI sum plot

Sum of ROI rectangle per image; binning is configurable

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate plot of ROI max count

Max count of ROI per image; binning is configurable

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate plot of ROI valid pixels

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

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate receiver delay plot

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

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate receiver free send buffer plot

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

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate image collection efficiency plot

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

+
query Parameters
binning
integer

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

+

Responses

Response samples

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

Generate indexing rate per file

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

+

Responses

Response samples

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

Generate radial integration profile

Generate average radial integration profile

+

Responses

Response samples

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

Generate radial integration profiles per file

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

+

Responses

Response samples

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

Get data collection statistics

Results of the last data collection

+

Responses

Response samples

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

Get calibration statistics

Statistics are provided for each module/storage cell separately

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get last preview image in JPEG format using custom settings

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

Saturation value to set contrast in the preview image

+
show_spots
boolean
Default: true

Show spot finding results on the image

+
show_roi
boolean
Default: false

Show ROI areas on the image

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

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

+
show_indexed
boolean
Default: false

Preview indexed images only

+
show_user_mask
boolean
Default: false

Show user mask

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

Responses

Request samples

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

Response samples

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

Get last preview image in JPEG format using default settings

Responses

Get last preview image in TIFF format

Responses

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

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

+

Responses

Get mask of the detector

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

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

-

Responses

Get user mask of the detector

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

-

Responses

Upload user mask of the detector

Responses

Get user mask of the detector

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

+

Responses

Upload user mask of the detector

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

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

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

Responses

Response samples

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

Get pedestal G0 in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

-
sc
integer

Storage cell number

-

Responses

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

Responses

Response samples

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

Get pedestal G0 in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

+
sc
integer

Storage cell number

+

Responses