v1.0.0-rc.138 (#48)
Build Packages / XDS test (durin plugin) (push) Successful in 8m5s
Build Packages / DIALS test (push) Successful in 12m55s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 14m41s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 16m13s
Build Packages / build:rpm (rocky8) (push) Successful in 18m17s
Build Packages / build:rpm (rocky9) (push) Successful in 19m14s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m59s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m17s
Build Packages / Generate python client (push) Successful in 1m15s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m58s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 14m14s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m9s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 18m21s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m14s
Build Packages / Build documentation (push) Successful in 1m43s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 10m14s
Build Packages / Unit tests (push) Successful in 57m40s
Build Packages / XDS test (durin plugin) (push) Successful in 8m5s
Build Packages / DIALS test (push) Successful in 12m55s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 14m41s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 16m13s
Build Packages / build:rpm (rocky8) (push) Successful in 18m17s
Build Packages / build:rpm (rocky9) (push) Successful in 19m14s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m59s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m17s
Build Packages / Generate python client (push) Successful in 1m15s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m58s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 14m14s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m9s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 18m21s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m14s
Build Packages / Build documentation (push) Successful in 1m43s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 10m14s
Build Packages / Unit tests (push) Successful in 57m40s
This is an UNSTABLE release. The release has significant modifications and bug fixes, if things go wrong, it is better to revert to 1.0.0-rc.132.
jfjoch_broker: Cleanup DECTRIS start-up code to enable a shorter start time
jfjoch_broker: Allow for asynchronous start to allow overlapping detector configuration with other beamline preparations
jfjoch_broker: Goniometer axis name is converted to lowercase
jfjoch_broker: Fix bug, where wrong HTTP error codes were returned
jfjoch_broker: Improve sigma estimation during merging (K. Takaba)
---------
Co-authored-by: takaba_k <kiyofumi.takaba@psi.ch>
Reviewed-on: #48
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #48.
This commit is contained in:
@@ -84,9 +84,14 @@ void DectrisSimplonClient::SetConfig(SimplonModule element, const std::string &k
|
||||
}
|
||||
}
|
||||
|
||||
std::string DectrisSimplonClient::GenAddr(DectrisSimplonClient::SimplonModule element,
|
||||
DectrisSimplonClient::SimplonTask task,
|
||||
const std::string& key) {
|
||||
void DectrisSimplonClient::SetConfigIfDifferent(SimplonModule element, const std::string &key, float value, float tolerance) {
|
||||
auto curr_val = GetConfig(element, key).val.get<float>();
|
||||
|
||||
if (std::abs(curr_val - value) > tolerance)
|
||||
SetConfig(element, key, value);
|
||||
}
|
||||
|
||||
std::string DectrisSimplonClient::GenAddr(SimplonModule element, SimplonTask task, const std::string& key) {
|
||||
std::string addr;
|
||||
switch (element) {
|
||||
case SimplonModule::Detector:
|
||||
@@ -120,9 +125,7 @@ std::string DectrisSimplonClient::GenAddr(DectrisSimplonClient::SimplonModule el
|
||||
}
|
||||
|
||||
SimplonConfig
|
||||
DectrisSimplonClient::GetConfig(DectrisSimplonClient::SimplonModule element,
|
||||
DectrisSimplonClient::SimplonTask task,
|
||||
const std::string &key) {
|
||||
DectrisSimplonClient::GetConfig(SimplonModule element, SimplonTask task, const std::string &key) {
|
||||
httplib::Client cli_simple(hostname, port);
|
||||
cli_simple.set_connection_timeout(std::chrono::milliseconds(500));
|
||||
cli_simple.set_read_timeout(std::chrono::seconds(1));
|
||||
@@ -162,7 +165,7 @@ SimplonConfig DectrisSimplonClient::GetDetCfg(const std::string &key) {
|
||||
return GetConfig(SimplonModule::Detector, key);
|
||||
}
|
||||
|
||||
nlohmann::json DectrisSimplonClient::GetStatus(DectrisSimplonClient::SimplonModule element, const std::string &key) {
|
||||
nlohmann::json DectrisSimplonClient::GetStatus(SimplonModule element, const std::string &key) {
|
||||
return GetConfig(element, SimplonTask::Status, key).val;
|
||||
}
|
||||
|
||||
@@ -207,6 +210,11 @@ void DectrisSimplonClient::InitializeDetector(DetectorSetup& setup) {
|
||||
"Initialize unsuccessful");
|
||||
|
||||
SetConfig(SimplonModule::Detector, "roi_mode", setup.GetDECTRISROI());
|
||||
// Configure streaming, disable file writer and monitor
|
||||
SetConfig(SimplonModule::Stream, "format", "cbor");
|
||||
SetConfig(SimplonModule::Stream, "mode", "enabled");
|
||||
SetConfig(SimplonModule::Filewriter, "mode", "disabled");
|
||||
SetConfig(SimplonModule::Monitor, "mode", "disabled");
|
||||
ReadDetectorConfig(setup);
|
||||
}
|
||||
|
||||
@@ -222,24 +230,34 @@ void DectrisSimplonClient::EndAcquisitionFinished() {
|
||||
SendDetectorCommand(SimplonDetectorCommand::Disarm);
|
||||
}
|
||||
|
||||
void DectrisSimplonClient::StartAcquisition() {
|
||||
void DectrisSimplonClient::StartAcquisition(const DiffractionExperiment& experiment) {
|
||||
// For DECTRIS detectors we assume frame_time == count_time
|
||||
if (experiment.GetFrameCountTimeAuto())
|
||||
SetConfig(SimplonModule::Detector, "count_time", experiment.GetFrameTime().count() / 1e6f);
|
||||
else
|
||||
SetConfig(SimplonModule::Detector, "count_time", experiment.GetFrameCountTime().count() / 1e6f);
|
||||
|
||||
SetConfig(SimplonModule::Detector, "frame_time", experiment.GetFrameTime().count() / 1e6f);
|
||||
SetConfig(SimplonModule::Detector, "nimages", experiment.GetFrameNumPerTrigger());
|
||||
SetConfig(SimplonModule::Detector, "ntrigger", experiment.GetNumTriggers());
|
||||
|
||||
SetConfig(SimplonModule::Detector, "beam_center_x", experiment.GetBeamX_pxl());
|
||||
SetConfig(SimplonModule::Detector, "beam_center_y", experiment.GetBeamY_pxl());
|
||||
SetConfig(SimplonModule::Detector, "detector_distance", experiment.GetDetectorDistance_mm() / 1e3f);
|
||||
|
||||
SendDetectorCommand(SimplonDetectorCommand::Arm);
|
||||
}
|
||||
|
||||
void DectrisSimplonClient::ConfigureDetector(const DiffractionExperiment &experiment) {
|
||||
SetConfig(SimplonModule::Stream, "format", "cbor");
|
||||
SetConfig(SimplonModule::Stream, "mode", "enabled");
|
||||
SetConfig(SimplonModule::Filewriter, "mode", "disabled");
|
||||
SetConfig(SimplonModule::Monitor, "mode", "disabled");
|
||||
|
||||
// TODO: Check if counting_mode retrigger is available
|
||||
if (experiment.GetDetectorMode() == DetectorMode::DarkMask)
|
||||
SetConfig(SimplonModule::Detector, "counting_mode", "normal");
|
||||
else
|
||||
SetConfig(SimplonModule::Detector, "counting_mode", "retrigger");
|
||||
SetConfig(SimplonModule::Detector, "photon_energy", experiment.GetIncidentEnergy_keV() * 1e3f);
|
||||
|
||||
SetConfigIfDifferent(SimplonModule::Detector, "photon_energy", experiment.GetIncidentEnergy_keV() * 1e3f, 0.01f);
|
||||
auto thr = experiment.GetEigerThreshold_keV();
|
||||
SetConfig(SimplonModule::Detector, "threshold_energy", thr * 1e3f);
|
||||
SetConfigIfDifferent(SimplonModule::Detector, "threshold_energy", thr * 1e3f, 0.01);
|
||||
|
||||
switch (experiment.GetDetectorTiming()) {
|
||||
case DetectorTiming::Auto:
|
||||
@@ -256,19 +274,6 @@ void DectrisSimplonClient::ConfigureDetector(const DiffractionExperiment &experi
|
||||
"Burst mode not supported with DECTRIS sytems");
|
||||
}
|
||||
|
||||
// For DECTRIS detectors we assume frame_time == count_time
|
||||
if (experiment.GetFrameCountTimeAuto())
|
||||
SetConfig(SimplonModule::Detector, "count_time", experiment.GetFrameTime().count() / 1e6f);
|
||||
else
|
||||
SetConfig(SimplonModule::Detector, "count_time", experiment.GetFrameCountTime().count() / 1e6f);
|
||||
|
||||
SetConfig(SimplonModule::Detector, "frame_time", experiment.GetFrameTime().count() / 1e6f);
|
||||
SetConfig(SimplonModule::Detector, "nimages", experiment.GetFrameNumPerTrigger());
|
||||
SetConfig(SimplonModule::Detector, "ntrigger", experiment.GetNumTriggers());
|
||||
|
||||
SetConfig(SimplonModule::Detector, "beam_center_x", experiment.GetBeamX_pxl());
|
||||
SetConfig(SimplonModule::Detector, "beam_center_y", experiment.GetBeamY_pxl());
|
||||
SetConfig(SimplonModule::Detector, "detector_distance", experiment.GetDetectorDistance_mm() / 1e3f);
|
||||
SetConfig(SimplonModule::Detector, "trigger_start_delay", experiment.GetDetectorDelay().count() / 1e9);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user