DectrisSimplonClient: EIGER2 missing min threshold
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "DectrisSimplonClient.h"
|
||||
|
||||
#include "../cmake-build-debug/_deps/fast-indexer-src/indexer/src/ffbidx/log.h"
|
||||
|
||||
std::string to_string(SimplonState state) {
|
||||
switch (state) {
|
||||
case SimplonState::Na: return "Na";
|
||||
@@ -120,7 +122,8 @@ std::string DectrisSimplonClient::GenAddr(DectrisSimplonClient::SimplonModule el
|
||||
}
|
||||
|
||||
SimplonConfig
|
||||
DectrisSimplonClient::GetConfig(DectrisSimplonClient::SimplonModule element, DectrisSimplonClient::SimplonTask task,
|
||||
DectrisSimplonClient::GetConfig(DectrisSimplonClient::SimplonModule element,
|
||||
DectrisSimplonClient::SimplonTask task,
|
||||
const std::string &key) {
|
||||
httplib::Client cli_simple(hostname, port);
|
||||
cli_simple.set_connection_timeout(std::chrono::milliseconds(500));
|
||||
@@ -184,7 +187,11 @@ void DectrisSimplonClient::ReadDetectorConfig(DetectorSetup &setup) {
|
||||
setup.MinFrameTime(std::chrono::microseconds(std::lround(GetDetCfg("frame_time").min.get<float>() * 1e6f)));
|
||||
setup.MinCountTime(std::chrono::microseconds(std::lround(GetDetCfg("count_time").min.get<float>() * 1e6f)));
|
||||
setup.ReadOutTime(std::chrono::microseconds(std::lround(GetDetCfg("detector_readout_time").val.get<float>() * 1e6f)));
|
||||
setup.MinThreshold_keV(GetDetCfg("threshold_energy").min.get<float>() / 1000.0f);
|
||||
nlohmann::json min_threshold_energy = GetDetCfg("threshold_energy").min;
|
||||
if (min_threshold_energy.is_number())
|
||||
setup.MinThreshold_keV(min_threshold_energy.get<float>() / 1000.0f);
|
||||
else
|
||||
setup.MinThreshold_keV(2.7f);
|
||||
|
||||
int64_t width = GetDetCfg("x_pixels_in_detector").val.get<int64_t>();
|
||||
int64_t height = GetDetCfg( "y_pixels_in_detector").val.get<int64_t>();
|
||||
@@ -202,18 +209,7 @@ void DectrisSimplonClient::InitializeDetector(DetectorSetup& setup) {
|
||||
"Initialize unsuccessful");
|
||||
|
||||
SetConfig(SimplonModule::Detector, "roi_mode", setup.GetDECTRISROI());
|
||||
int64_t width = GetDetCfg("x_pixels_in_detector").val.get<int64_t>();
|
||||
int64_t height = GetDetCfg( "y_pixels_in_detector").val.get<int64_t>();
|
||||
|
||||
setup.Geometry(DetectorGeometryFixed(width, height));
|
||||
setup.PixelSize_um(std::round(GetDetCfg( "x_pixel_size").val.get<float>() * 1e6f));
|
||||
setup.SerialNumber(GetDetCfg( "detector_number").val);
|
||||
setup.SensorMaterial(GetDetCfg( "sensor_material").val);
|
||||
setup.SensorThickness_um(std::round(GetDetCfg( "sensor_thickness").val.get<float>() * 1e6f));
|
||||
setup.MinFrameTime(std::chrono::microseconds(std::lround(GetDetCfg("frame_time").min.get<float>() * 1e6f)));
|
||||
setup.MinCountTime(std::chrono::microseconds(std::lround(GetDetCfg("count_time").min.get<float>() * 1e6f)));
|
||||
setup.ReadOutTime(std::chrono::microseconds(std::lround(GetDetCfg("detector_readout_time").val.get<float>() * 1e6f)));
|
||||
setup.MinThreshold_keV(GetDetCfg("threshold_energy").min.get<float>() / 1000.0f);
|
||||
ReadDetectorConfig(setup);
|
||||
}
|
||||
|
||||
void DectrisSimplonClient::TriggerAcquisition() {
|
||||
|
||||
Reference in New Issue
Block a user