Merge branch '2405-maxiv-day-5' into 'main'
Updates after MAX IV experiment See merge request jungfraujoch/nextgendcu!68
This commit is contained in:
commit
7d9dcf2721
70 files changed
+1530
-334
No files matched your search
@@ -161,6 +161,7 @@ SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_REQUIRES "dkms, gcc, bash, sed")
|
||||
SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_ARCHITECTURE "noarch")
|
||||
SET(CPACK_RPM_DRIVER-DKMS_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh)
|
||||
SET(CPACK_RPM_DRIVER-DKMS_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh)
|
||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src)
|
||||
|
||||
# Set The Vendor Name
|
||||
SET(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "JFJochBrokerHttp.h"
|
||||
#include "gen/model/Error_message.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
|
||||
// From https://en.cppreference.com/w/cpp/string/byte/tolower
|
||||
inline std::string str_tolower(std::string s) {
|
||||
@@ -22,6 +23,10 @@ inline SpotFindingSettings Convert(const org::openapitools::server::model::Spot_
|
||||
ret.enable = input.isEnable();
|
||||
ret.indexing = input.isIndexing();
|
||||
ret.indexing_tolerance = input.getIndexingTolerance();
|
||||
if (input.filterPowderRingsIsSet())
|
||||
ret.filter_spots_powder_ring = input.isFilterPowderRings();
|
||||
if (input.minSpotCountPowderRingIsSet())
|
||||
ret.min_spot_count_powder_ring = input.getMinSpotCountPowderRing();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -36,6 +41,8 @@ inline org::openapitools::server::model::Spot_finding_settings Convert(const Spo
|
||||
ret.setEnable(input.enable);
|
||||
ret.setIndexing(input.indexing);
|
||||
ret.setIndexingTolerance(input.indexing_tolerance);
|
||||
ret.setFilterPowderRings(input.filter_spots_powder_ring);
|
||||
ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -317,6 +324,7 @@ inline PreviewJPEGSettings Convert(const org::openapitools::server::model::Previ
|
||||
ret.saturation_value = input.getSaturation();
|
||||
ret.show_roi = input.isShowRoi();
|
||||
ret.show_indexed = input.isShowIndexed();
|
||||
ret.show_user_mask = input.isShowUserMask();
|
||||
if (input.resolutionRingIsSet())
|
||||
ret.resolution_ring = input.getResolutionRing();
|
||||
return ret;
|
||||
@@ -655,18 +663,33 @@ void JFJochBrokerHttp::preview_image_tiff_get(Pistache::Http::ResponseWriter &re
|
||||
void JFJochBrokerHttp::config_internal_generator_image_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
int64_t image_number = 0;
|
||||
auto number_query = request.query().get("number");
|
||||
auto number_query = request.query().get("id");
|
||||
if (number_query)
|
||||
image_number = std::stoi(number_query.value());
|
||||
|
||||
if ((image_number < 0) || (image_number > 127))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "image_number must be in range 0-127");
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "id must be in range 0-127");
|
||||
|
||||
state_machine.LoadInternalGeneratorImage(request.body().data(), request.body().size(), image_number);
|
||||
logger.Info("Internal generator image #{} loaded", image_number);
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
|
||||
void JFJochBrokerHttp::config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
int64_t image_number = 0;
|
||||
auto number_query = request.query().get("id");
|
||||
if (number_query)
|
||||
image_number = std::stoi(number_query.value());
|
||||
|
||||
if ((image_number < 0) || (image_number > 127))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "id must be in range 0-127");
|
||||
|
||||
state_machine.LoadInternalGeneratorImageTIFF(request.body(), image_number);
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::roi_box_get(Pistache::Http::ResponseWriter &response) {
|
||||
ProcessOutput(Convert(state_machine.GetBoxROI()), response);
|
||||
}
|
||||
@@ -782,3 +805,19 @@ void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional<int32_t> &binni
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
GenericPlot(PlotType::StrongPixels, binning, response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_mask_tiff_get(Pistache::Http::ResponseWriter &response) {
|
||||
std::string s = state_machine.GetFullPixelMaskTIFF();
|
||||
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) {
|
||||
std::string s = state_machine.GetUserPixelMaskTIFF();
|
||||
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_user_mask_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.SetUserPixelMask(request.body());
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
@@ -118,6 +118,16 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
void xfel_event_code_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void xfel_pulse_id_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_user_mask_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void GetStaticFile(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception &ex) const noexcept override;
|
||||
|
||||
|
||||
@@ -5,15 +5,17 @@
|
||||
|
||||
JFJochServices::JFJochServices(Logger &in_logger) : logger(in_logger) {}
|
||||
|
||||
void JFJochServices::Start(const DiffractionExperiment& experiment, const JFCalibration &calibration) {
|
||||
void JFJochServices::Start(const DiffractionExperiment& experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration &calibration) {
|
||||
logger.Info("Measurement start for: {}", experiment.GetFilePrefix());
|
||||
|
||||
if (receiver != nullptr) {
|
||||
logger.Info(" ... receiver start");
|
||||
if (experiment.GetDetectorMode() == DetectorMode::Conversion)
|
||||
receiver->Start(experiment, &calibration);
|
||||
receiver->Start(experiment, pixel_mask, &calibration);
|
||||
else
|
||||
receiver->Start(experiment, nullptr);
|
||||
receiver->Start(experiment, pixel_mask, nullptr);
|
||||
|
||||
if (detector && !experiment.IsUsingInternalPacketGen()) {
|
||||
logger.Info(" ... detector start");
|
||||
|
||||
@@ -23,7 +23,9 @@ public:
|
||||
void On(const DiffractionExperiment& experiment);
|
||||
void Off();
|
||||
void ConfigureDetector(const DiffractionExperiment& experiment);
|
||||
void Start(const DiffractionExperiment& experiment, const JFCalibration &calibration);
|
||||
void Start(const DiffractionExperiment& experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration &calibration);
|
||||
JFJochServicesOutput Stop();
|
||||
void Cancel();
|
||||
void Trigger();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <thread>
|
||||
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "../preview/WriteTIFF.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
|
||||
void ApplyDetectorSettings(DiffractionExperiment& experiment, const DetectorSettings &settings) {
|
||||
auto tmp = experiment;
|
||||
@@ -66,8 +66,10 @@ void ApplyRadialIntegrationSettings(DiffractionExperiment& experiment, const Rad
|
||||
}
|
||||
|
||||
JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_logger)
|
||||
: services(in_services), logger(in_logger),
|
||||
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()) {
|
||||
: services(in_services),
|
||||
logger(in_logger),
|
||||
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()),
|
||||
pixel_mask(experiment) {
|
||||
|
||||
}
|
||||
|
||||
@@ -126,6 +128,7 @@ void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &u
|
||||
}
|
||||
}
|
||||
services.ConfigureDetector(experiment);
|
||||
pixel_mask.LoadDetectorBadPixelMask(calibration->CalculateMask());
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error("Pedestal sequence error {}", e.what());
|
||||
state = JFJochState::Error;
|
||||
@@ -158,7 +161,7 @@ void JFJochStateMachine::TakePedestalInternalG0(std::unique_lock<std::mutex> &ul
|
||||
|
||||
state = JFJochState::Pedestal;
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -197,7 +200,7 @@ void JFJochStateMachine::TakePedestalInternalG1(std::unique_lock<std::mutex> &ul
|
||||
|
||||
state = JFJochState::Pedestal;
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -236,7 +239,7 @@ void JFJochStateMachine::TakePedestalInternalG2(std::unique_lock<std::mutex> &ul
|
||||
|
||||
state = JFJochState::Pedestal;
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -326,7 +329,7 @@ void JFJochStateMachine::Start(const DatasetSettings& settings) {
|
||||
try {
|
||||
state = JFJochState::Busy;
|
||||
services.SetSpotFindingSettings(GetSpotFindingSettings());
|
||||
services.Start(experiment, *calibration);
|
||||
services.Start(experiment, pixel_mask, *calibration);
|
||||
|
||||
state = JFJochState::Measuring;
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::MeasurementThread, this);
|
||||
@@ -562,6 +565,7 @@ void JFJochStateMachine::AddDetectorSetup(const DetectorSetup &setup) {
|
||||
experiment.Detector(setup);
|
||||
gain_calibration = setup.GetGainCalibration();
|
||||
current_detector_setup = 0;
|
||||
pixel_mask = PixelMask(setup);
|
||||
}
|
||||
detector_setup.emplace_back(setup);
|
||||
}
|
||||
@@ -599,6 +603,7 @@ void JFJochStateMachine::SelectDetector(int64_t id) {
|
||||
try {
|
||||
experiment.Detector(detector_setup[id]);
|
||||
gain_calibration = detector_setup[id].GetGainCalibration();
|
||||
pixel_mask = PixelMask(detector_setup[id]);
|
||||
state = JFJochState::Inactive;
|
||||
current_detector_setup = id;
|
||||
} catch (JFJochException &e) {
|
||||
@@ -705,6 +710,21 @@ void JFJochStateMachine::LoadInternalGeneratorImage(const void *data, size_t siz
|
||||
services.LoadInternalGeneratorImage(experiment, image, image_number);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::LoadInternalGeneratorImageTIFF(const std::string &s, uint64_t image_number) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (state != JFJochState::Idle)
|
||||
throw WrongDAQStateException ("Can change internal generator image only when detector in Idle state");
|
||||
|
||||
uint32_t cols, lines;
|
||||
auto v = ReadTIFFFromString16(s, cols, lines);
|
||||
if (((cols == experiment.GetXPixelsNum()) && (lines == experiment.GetYPixelsNum()))
|
||||
|| ((cols == RAW_MODULE_SIZE) && (lines == RAW_MODULE_LINES * experiment.GetModulesNum())))
|
||||
services.LoadInternalGeneratorImage(experiment, v, image_number);
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Image size doesn't match current detector");
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetBoxROI(const std::vector<ROIBox> &input) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
@@ -744,3 +764,33 @@ std::vector<uint64_t> JFJochStateMachine::GetXFELEventCode() const {
|
||||
services.GetXFELEventCode(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string JFJochStateMachine::GetFullPixelMaskTIFF() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
std::vector v = pixel_mask.GetMask(experiment);
|
||||
return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(),
|
||||
sizeof(uint32_t), false);
|
||||
}
|
||||
|
||||
std::string JFJochStateMachine::GetUserPixelMaskTIFF() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
std::vector v = pixel_mask.GetUserMask(experiment);
|
||||
return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(),
|
||||
sizeof(uint32_t), false);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetUserPixelMask(const std::string &s) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (state != JFJochState::Idle)
|
||||
throw WrongDAQStateException ("User mask can be only modified in Idle state");
|
||||
|
||||
try {
|
||||
uint32_t cols, lines;
|
||||
auto v = ReadTIFFFromString32(s, cols, lines);
|
||||
pixel_mask.LoadUserMask(experiment, v);
|
||||
} catch (const JFJochException &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Problem handling user mask " + std::string(e.what()));
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,8 @@ class JFJochStateMachine {
|
||||
volatile JFJochState state = JFJochState::Inactive;
|
||||
volatile bool cancel_sequence = false;
|
||||
std::unique_ptr<JFCalibration> calibration;
|
||||
PixelMask pixel_mask;
|
||||
|
||||
std::vector<JFModuleGainCalibration> gain_calibration;
|
||||
std::vector<DetectorSetup> detector_setup;
|
||||
int64_t current_detector_setup;
|
||||
@@ -172,6 +174,7 @@ public:
|
||||
std::string GetPedestalTIFF(size_t gain_level, size_t sc) const;
|
||||
|
||||
void LoadInternalGeneratorImage(const void *data, size_t size, uint64_t image_number);
|
||||
void LoadInternalGeneratorImageTIFF(const std::string &s, uint64_t image_number);
|
||||
|
||||
// Not thread safe - only for configuration in serial context
|
||||
DiffractionExperiment& NotThreadSafe_Experiment();
|
||||
@@ -187,6 +190,10 @@ public:
|
||||
|
||||
std::vector<uint64_t> GetXFELPulseID() const;
|
||||
std::vector<uint64_t> GetXFELEventCode() const;
|
||||
|
||||
std::string GetFullPixelMaskTIFF() const;
|
||||
std::string GetUserPixelMaskTIFF() const;
|
||||
void SetUserPixelMask(const std::string &v);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -37,12 +37,16 @@ void DefaultApi::setupRoutes() {
|
||||
Routes::Get(*router, base + "/config/detector", Routes::bind(&DefaultApi::config_detector_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/detector", Routes::bind(&DefaultApi::config_detector_put_handler, this));
|
||||
Routes::Put(*router, base + "/config/internal_generator_image", Routes::bind(&DefaultApi::config_internal_generator_image_put_handler, this));
|
||||
Routes::Put(*router, base + "/config/internal_generator_image.tiff", Routes::bind(&DefaultApi::config_internal_generator_image_tiff_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/mask.tiff", Routes::bind(&DefaultApi::config_mask_tiff_get_handler, this));
|
||||
Routes::Get(*router, base + "/config/rad_int", Routes::bind(&DefaultApi::config_rad_int_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/rad_int", Routes::bind(&DefaultApi::config_rad_int_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_put_handler, this));
|
||||
Routes::Post(*router, base + "/deactivate", Routes::bind(&DefaultApi::deactivate_post_handler, this));
|
||||
Routes::Get(*router, base + "/detector/status", Routes::bind(&DefaultApi::detector_status_get_handler, this));
|
||||
Routes::Post(*router, base + "/initialize", Routes::bind(&DefaultApi::initialize_post_handler, this));
|
||||
@@ -192,6 +196,45 @@ void DefaultApi::config_internal_generator_image_put_handler(const Pistache::Res
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
try {
|
||||
this->config_internal_generator_image_tiff_put(request, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_mask_tiff_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_rad_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
@@ -351,6 +394,45 @@ void DefaultApi::config_spot_finding_put_handler(const Pistache::Rest::Request &
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_user_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_user_mask_tiff_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
try {
|
||||
this->config_user_mask_tiff_put(request, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::deactivate_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
@@ -61,12 +61,16 @@ private:
|
||||
void config_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_rad_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_rad_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_spot_finding_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_spot_finding_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void deactivate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void detector_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
@@ -150,6 +154,20 @@ private:
|
||||
/// </remarks>
|
||||
virtual void config_internal_generator_image_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Load TIFF image for internal FPGA generator
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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).
|
||||
/// </remarks>
|
||||
virtual void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get mask of the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Get full pixel mask of the detector See NXmx standard for meaning of pixel values
|
||||
/// </remarks>
|
||||
virtual void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get radial integration configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -195,6 +213,20 @@ private:
|
||||
/// <param name="spotFindingSettings"> (optional)</param>
|
||||
virtual void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get user mask of the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Upload user mask of the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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. 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.
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Prepare detector to turn off
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
|
||||
@@ -26,11 +26,13 @@ Preview_settings::Preview_settings()
|
||||
m_Show_spotsIsSet = false;
|
||||
m_Show_roi = false;
|
||||
m_Show_roiIsSet = false;
|
||||
m_Jpeg_quality = 0L;
|
||||
m_Jpeg_quality = 100L;
|
||||
m_Jpeg_qualityIsSet = false;
|
||||
m_Show_indexed = false;
|
||||
m_Show_indexedIsSet = false;
|
||||
m_Resolution_ring = 0.0f;
|
||||
m_Show_user_mask = false;
|
||||
m_Show_user_maskIsSet = false;
|
||||
m_Resolution_ring = 0.1f;
|
||||
m_Resolution_ringIsSet = false;
|
||||
|
||||
}
|
||||
@@ -92,7 +94,7 @@ bool Preview_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (resolutionRingIsSet())
|
||||
{
|
||||
const float& value = m_Resolution_ring;
|
||||
@@ -136,6 +138,9 @@ bool Preview_settings::operator==(const Preview_settings& rhs) const
|
||||
((!showIndexedIsSet() && !rhs.showIndexedIsSet()) || (showIndexedIsSet() && rhs.showIndexedIsSet() && isShowIndexed() == rhs.isShowIndexed())) &&
|
||||
|
||||
|
||||
((!showUserMaskIsSet() && !rhs.showUserMaskIsSet()) || (showUserMaskIsSet() && rhs.showUserMaskIsSet() && isShowUserMask() == rhs.isShowUserMask())) &&
|
||||
|
||||
|
||||
((!resolutionRingIsSet() && !rhs.resolutionRingIsSet()) || (resolutionRingIsSet() && rhs.resolutionRingIsSet() && getResolutionRing() == rhs.getResolutionRing()))
|
||||
|
||||
;
|
||||
@@ -158,6 +163,8 @@ void to_json(nlohmann::json& j, const Preview_settings& o)
|
||||
j["jpeg_quality"] = o.m_Jpeg_quality;
|
||||
if(o.showIndexedIsSet())
|
||||
j["show_indexed"] = o.m_Show_indexed;
|
||||
if(o.showUserMaskIsSet())
|
||||
j["show_user_mask"] = o.m_Show_user_mask;
|
||||
if(o.resolutionRingIsSet())
|
||||
j["resolution_ring"] = o.m_Resolution_ring;
|
||||
|
||||
@@ -186,6 +193,11 @@ void from_json(const nlohmann::json& j, Preview_settings& o)
|
||||
j.at("show_indexed").get_to(o.m_Show_indexed);
|
||||
o.m_Show_indexedIsSet = true;
|
||||
}
|
||||
if(j.find("show_user_mask") != j.end())
|
||||
{
|
||||
j.at("show_user_mask").get_to(o.m_Show_user_mask);
|
||||
o.m_Show_user_maskIsSet = true;
|
||||
}
|
||||
if(j.find("resolution_ring") != j.end())
|
||||
{
|
||||
j.at("resolution_ring").get_to(o.m_Resolution_ring);
|
||||
@@ -270,6 +282,23 @@ void Preview_settings::unsetShow_indexed()
|
||||
{
|
||||
m_Show_indexedIsSet = false;
|
||||
}
|
||||
bool Preview_settings::isShowUserMask() const
|
||||
{
|
||||
return m_Show_user_mask;
|
||||
}
|
||||
void Preview_settings::setShowUserMask(bool const value)
|
||||
{
|
||||
m_Show_user_mask = value;
|
||||
m_Show_user_maskIsSet = true;
|
||||
}
|
||||
bool Preview_settings::showUserMaskIsSet() const
|
||||
{
|
||||
return m_Show_user_maskIsSet;
|
||||
}
|
||||
void Preview_settings::unsetShow_user_mask()
|
||||
{
|
||||
m_Show_user_maskIsSet = false;
|
||||
}
|
||||
float Preview_settings::getResolutionRing() const
|
||||
{
|
||||
return m_Resolution_ring;
|
||||
|
||||
@@ -91,6 +91,13 @@ public:
|
||||
bool showIndexedIsSet() const;
|
||||
void unsetShow_indexed();
|
||||
/// <summary>
|
||||
/// Show user mask
|
||||
/// </summary>
|
||||
bool isShowUserMask() const;
|
||||
void setShowUserMask(bool const value);
|
||||
bool showUserMaskIsSet() const;
|
||||
void unsetShow_user_mask();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getResolutionRing() const;
|
||||
@@ -111,6 +118,8 @@ protected:
|
||||
bool m_Jpeg_qualityIsSet;
|
||||
bool m_Show_indexed;
|
||||
bool m_Show_indexedIsSet;
|
||||
bool m_Show_user_mask;
|
||||
bool m_Show_user_maskIsSet;
|
||||
float m_Resolution_ring;
|
||||
bool m_Resolution_ringIsSet;
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@ Spot_finding_settings::Spot_finding_settings()
|
||||
{
|
||||
m_Enable = true;
|
||||
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_ringIsSet = false;
|
||||
m_Signal_to_noise_threshold = 0.0f;
|
||||
m_Photon_count_threshold = 0L;
|
||||
m_Min_pix_per_spot = 0L;
|
||||
@@ -52,7 +56,21 @@ bool Spot_finding_settings::validate(std::stringstream& msg, const std::string&
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Spot_finding_settings" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
if (minSpotCountPowderRingIsSet())
|
||||
{
|
||||
const int64_t& value = m_Min_spot_count_powder_ring;
|
||||
const std::string currentValuePath = _pathPrefix + ".minSpotCountPowderRing";
|
||||
|
||||
|
||||
if (value < 5ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 5;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Signal_to_noise_threshold */ {
|
||||
const float& value = m_Signal_to_noise_threshold;
|
||||
@@ -142,6 +160,12 @@ bool Spot_finding_settings::operator==(const Spot_finding_settings& rhs) const
|
||||
(isIndexing() == rhs.isIndexing())
|
||||
&&
|
||||
|
||||
|
||||
((!filterPowderRingsIsSet() && !rhs.filterPowderRingsIsSet()) || (filterPowderRingsIsSet() && rhs.filterPowderRingsIsSet() && isFilterPowderRings() == rhs.isFilterPowderRings())) &&
|
||||
|
||||
|
||||
((!minSpotCountPowderRingIsSet() && !rhs.minSpotCountPowderRingIsSet()) || (minSpotCountPowderRingIsSet() && rhs.minSpotCountPowderRingIsSet() && getMinSpotCountPowderRing() == rhs.getMinSpotCountPowderRing())) &&
|
||||
|
||||
(getSignalToNoiseThreshold() == rhs.getSignalToNoiseThreshold())
|
||||
&&
|
||||
|
||||
@@ -176,6 +200,10 @@ void to_json(nlohmann::json& j, const Spot_finding_settings& o)
|
||||
j = nlohmann::json();
|
||||
j["enable"] = o.m_Enable;
|
||||
j["indexing"] = o.m_Indexing;
|
||||
if(o.filterPowderRingsIsSet())
|
||||
j["filter_powder_rings"] = o.m_Filter_powder_rings;
|
||||
if(o.minSpotCountPowderRingIsSet())
|
||||
j["min_spot_count_powder_ring"] = o.m_Min_spot_count_powder_ring;
|
||||
j["signal_to_noise_threshold"] = o.m_Signal_to_noise_threshold;
|
||||
j["photon_count_threshold"] = o.m_Photon_count_threshold;
|
||||
j["min_pix_per_spot"] = o.m_Min_pix_per_spot;
|
||||
@@ -190,6 +218,16 @@ void from_json(const nlohmann::json& j, Spot_finding_settings& o)
|
||||
{
|
||||
j.at("enable").get_to(o.m_Enable);
|
||||
j.at("indexing").get_to(o.m_Indexing);
|
||||
if(j.find("filter_powder_rings") != j.end())
|
||||
{
|
||||
j.at("filter_powder_rings").get_to(o.m_Filter_powder_rings);
|
||||
o.m_Filter_powder_ringsIsSet = true;
|
||||
}
|
||||
if(j.find("min_spot_count_powder_ring") != j.end())
|
||||
{
|
||||
j.at("min_spot_count_powder_ring").get_to(o.m_Min_spot_count_powder_ring);
|
||||
o.m_Min_spot_count_powder_ringIsSet = true;
|
||||
}
|
||||
j.at("signal_to_noise_threshold").get_to(o.m_Signal_to_noise_threshold);
|
||||
j.at("photon_count_threshold").get_to(o.m_Photon_count_threshold);
|
||||
j.at("min_pix_per_spot").get_to(o.m_Min_pix_per_spot);
|
||||
@@ -216,6 +254,40 @@ void Spot_finding_settings::setIndexing(bool const value)
|
||||
{
|
||||
m_Indexing = value;
|
||||
}
|
||||
bool Spot_finding_settings::isFilterPowderRings() const
|
||||
{
|
||||
return m_Filter_powder_rings;
|
||||
}
|
||||
void Spot_finding_settings::setFilterPowderRings(bool const value)
|
||||
{
|
||||
m_Filter_powder_rings = value;
|
||||
m_Filter_powder_ringsIsSet = true;
|
||||
}
|
||||
bool Spot_finding_settings::filterPowderRingsIsSet() const
|
||||
{
|
||||
return m_Filter_powder_ringsIsSet;
|
||||
}
|
||||
void Spot_finding_settings::unsetFilter_powder_rings()
|
||||
{
|
||||
m_Filter_powder_ringsIsSet = false;
|
||||
}
|
||||
int64_t Spot_finding_settings::getMinSpotCountPowderRing() const
|
||||
{
|
||||
return m_Min_spot_count_powder_ring;
|
||||
}
|
||||
void Spot_finding_settings::setMinSpotCountPowderRing(int64_t const value)
|
||||
{
|
||||
m_Min_spot_count_powder_ring = value;
|
||||
m_Min_spot_count_powder_ringIsSet = true;
|
||||
}
|
||||
bool Spot_finding_settings::minSpotCountPowderRingIsSet() const
|
||||
{
|
||||
return m_Min_spot_count_powder_ringIsSet;
|
||||
}
|
||||
void Spot_finding_settings::unsetMin_spot_count_powder_ring()
|
||||
{
|
||||
m_Min_spot_count_powder_ringIsSet = false;
|
||||
}
|
||||
float Spot_finding_settings::getSignalToNoiseThreshold() const
|
||||
{
|
||||
return m_Signal_to_noise_threshold;
|
||||
|
||||
@@ -58,16 +58,30 @@ public:
|
||||
/// Spot_finding_settings members
|
||||
|
||||
/// <summary>
|
||||
/// Enable spot finding
|
||||
/// 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.
|
||||
/// </summary>
|
||||
bool isEnable() const;
|
||||
void setEnable(bool const value);
|
||||
/// <summary>
|
||||
/// Enable indexing
|
||||
/// Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.
|
||||
/// </summary>
|
||||
bool isIndexing() const;
|
||||
void setIndexing(bool const value);
|
||||
/// <summary>
|
||||
/// Filter spots which form powder rings (e.g., ice rings)
|
||||
/// </summary>
|
||||
bool isFilterPowderRings() const;
|
||||
void setFilterPowderRings(bool const value);
|
||||
bool filterPowderRingsIsSet() const;
|
||||
void unsetFilter_powder_rings();
|
||||
/// <summary>
|
||||
/// Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.
|
||||
/// </summary>
|
||||
int64_t getMinSpotCountPowderRing() const;
|
||||
void setMinSpotCountPowderRing(int64_t const value);
|
||||
bool minSpotCountPowderRingIsSet() const;
|
||||
void unsetMin_spot_count_powder_ring();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getSignalToNoiseThreshold() const;
|
||||
@@ -110,6 +124,10 @@ protected:
|
||||
|
||||
bool m_Indexing;
|
||||
|
||||
bool m_Filter_powder_rings;
|
||||
bool m_Filter_powder_ringsIsSet;
|
||||
int64_t m_Min_spot_count_powder_ring;
|
||||
bool m_Min_spot_count_powder_ringIsSet;
|
||||
float m_Signal_to_noise_threshold;
|
||||
|
||||
int64_t m_Photon_count_threshold;
|
||||
|
||||
+112
-4
@@ -333,11 +333,23 @@ components:
|
||||
enable:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Enable spot finding
|
||||
description: |
|
||||
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:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Enable indexing
|
||||
description: |
|
||||
Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.
|
||||
filter_powder_rings:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Filter spots which form powder rings (e.g., ice rings)
|
||||
min_spot_count_powder_ring:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 5
|
||||
description: Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.
|
||||
signal_to_noise_threshold:
|
||||
type: number
|
||||
format: float
|
||||
@@ -620,14 +632,21 @@ components:
|
||||
type: integer
|
||||
description: "Quality of JPEG image (100 - highest; 0 - lowest)"
|
||||
format: int64
|
||||
default: 100
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
show_indexed:
|
||||
type: boolean
|
||||
description: "Preview indexed images only"
|
||||
default: false
|
||||
show_user_mask:
|
||||
type: boolean
|
||||
description: "Show user mask"
|
||||
default: false
|
||||
resolution_ring:
|
||||
type: number
|
||||
format: float
|
||||
default: 0.1
|
||||
minimum: 0.1
|
||||
maximum: 100.0
|
||||
error_message:
|
||||
@@ -967,9 +986,9 @@ paths:
|
||||
Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates
|
||||
(depending on detector settings).
|
||||
parameters:
|
||||
- name: number
|
||||
- name: id
|
||||
in: query
|
||||
description: Image number to upload
|
||||
description: Image id to upload
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
@@ -992,6 +1011,38 @@ paths:
|
||||
schema:
|
||||
type: string
|
||||
description: Exception error
|
||||
/config/internal_generator_image.tiff:
|
||||
put:
|
||||
summary: Load TIFF image for internal FPGA generator
|
||||
description: |
|
||||
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).
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: Image ID to upload
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 127
|
||||
requestBody:
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
responses:
|
||||
"200":
|
||||
description: Everything OK
|
||||
"400":
|
||||
description: Input parsing or validation error
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Exception error
|
||||
/config/select_detector:
|
||||
put:
|
||||
summary: Select detector
|
||||
@@ -1564,6 +1615,63 @@ paths:
|
||||
format: binary
|
||||
"404":
|
||||
description: No preview image recorded so far
|
||||
/config/mask.tiff:
|
||||
get:
|
||||
summary: Get mask of the detector
|
||||
description: |
|
||||
Get full pixel mask of the detector
|
||||
See NXmx standard for meaning of pixel values
|
||||
responses:
|
||||
"200":
|
||||
description: Pixel mask in TIFF format (4 byte; unsigned)
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
/config/user_mask.tiff:
|
||||
get:
|
||||
summary: Get user mask of the detector
|
||||
description: "Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked"
|
||||
responses:
|
||||
"200":
|
||||
description: User mask in TIFF format (4 byte; unsigned)
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
put:
|
||||
summary: Upload user mask of the detector
|
||||
description: |
|
||||
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.
|
||||
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.
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
responses:
|
||||
"200":
|
||||
description: All good
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
"500":
|
||||
description: Error within Jungfraujoch code - see output message.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/error_message'
|
||||
/preview/pedestal.tiff:
|
||||
get:
|
||||
parameters:
|
||||
|
||||
+66
-16
@@ -341,7 +341,7 @@ data-styled.g137[id="sc-cMdfCE"]{content:"dvQijr,"}/*!sc*/
|
||||
|
||||
<body>
|
||||
|
||||
<div id="redoc"><div class="sc-kUNLVD cSYMrW redoc-wrap"><div class="sc-iqziPC hHYXMN menu-content" style="top:0px;height:calc(100vh - 0px)"><div role="search" class="sc-emwzcK cUtpgV"><svg class="sc-cMdfCE dvQijr search-icon" version="1.1" viewBox="0 0 1000 1000" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><path d="M968.2,849.4L667.3,549c83.9-136.5,66.7-317.4-51.7-435.6C477.1-25,252.5-25,113.9,113.4c-138.5,138.3-138.5,362.6,0,501C219.2,730.1,413.2,743,547.6,666.5l301.9,301.4c43.6,43.6,76.9,14.9,104.2-12.4C981,928.3,1011.8,893,968.2,849.4z M524.5,522c-88.9,88.7-233,88.7-321.8,0c-88.9-88.7-88.9-232.6,0-321.3c88.9-88.7,233-88.7,321.8,0C613.4,289.4,613.4,433.3,524.5,522z"></path></svg><input placeholder="Search..." aria-label="Search" type="text" class="sc-kjKYmT iiRHzu search-input" value=""/></div><div class="sc-kMzELR kIqtpW scrollbar-container undefined"><ul role="menu" class="sc-YltrM fTlmpg"><li tabindex="0" depth="2" data-item-id="/paths/~1initialize/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Initialize detector and data acquisition</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1pedestal/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Collect dark current for the detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1start/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Start detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1wait_till_done/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Wait for acquisition done</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1trigger/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Send soft trigger to the detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1cancel/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Cancel running data collection</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1deactivate/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Prepare detector to turn off</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1detector/put" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="put" class="sc-dmcoYd gxSVta operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Change detector configuration</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1detector/get" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="get" class="sc-dmcoYd gxSVta operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Get detector configuration</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1spot_finding/put" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="put" class="sc-dmcoYd gxSVta operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Configure spot finding</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1spot_finding/get" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="get" class="sc-dmcoYd gxSVta operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Get data processing configuration</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1rad_int/put" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="put" class="sc-dmcoYd gxSVta operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Configure radial integration</span></labelLine truncated
|
||||
<div id="redoc"><div class="sc-kUNLVD cSYMrW redoc-wrap"><div class="sc-iqziPC hHYXMN menu-content" style="top:0px;height:calc(100vh - 0px)"><div role="search" class="sc-emwzcK cUtpgV"><svg class="sc-cMdfCE dvQijr search-icon" version="1.1" viewBox="0 0 1000 1000" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><path d="M968.2,849.4L667.3,549c83.9-136.5,66.7-317.4-51.7-435.6C477.1-25,252.5-25,113.9,113.4c-138.5,138.3-138.5,362.6,0,501C219.2,730.1,413.2,743,547.6,666.5l301.9,301.4c43.6,43.6,76.9,14.9,104.2-12.4C981,928.3,1011.8,893,968.2,849.4z M524.5,522c-88.9,88.7-233,88.7-321.8,0c-88.9-88.7-88.9-232.6,0-321.3c88.9-88.7,233-88.7,321.8,0C613.4,289.4,613.4,433.3,524.5,522z"></path></svg><input placeholder="Search..." aria-label="Search" type="text" class="sc-kjKYmT iiRHzu search-input" value=""/></div><div class="sc-kMzELR kIqtpW scrollbar-container undefined"><ul role="menu" class="sc-YltrM fTlmpg"><li tabindex="0" depth="2" data-item-id="/paths/~1initialize/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Initialize detector and data acquisition</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1pedestal/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Collect dark current for the detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1start/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Start detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1wait_till_done/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Wait for acquisition done</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1trigger/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Send soft trigger to the detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1cancel/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Cancel running data collection</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1deactivate/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Prepare detector to turn off</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1detector/put" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="put" class="sc-dmcoYd gxSVta operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Change detector configuration</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1detector/get" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="get" class="sc-dmcoYd gxSVta operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Get detector configuration</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1spot_finding/put" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="put" class="sc-dmcoYd gxSVta operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Configure spot finding</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1spot_finding/get" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="get" class="sc-dmcoYd gxSVta operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Get data processing configuration</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1rad_int/put" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="put" class="sc-dmcoYd gxSVta operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Configure radial integration</span></labelLine truncated
|
||||
m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
|
||||
-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
|
||||
0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
|
||||
@@ -545,21 +545,27 @@ If detector is in <code>Inactive</code> or <code>Error</code> states, new settin
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Everything OK</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/config/detector</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/detector</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Response samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-16" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-17" tabindex="0" data-rttab="true">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-17" aria-labelledby="react-tabs-16"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"frame_time_us"</span>: <span class="token number">450</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"count_time_us"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"storage_cell_count"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"internal_frame_generator"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"internal_frame_generator_images"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"collect_raw_data"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"pedestal_g0_frames"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"pedestal_g1_frames"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"pedestal_g2_frames"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"storage_cell_delay_us"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"detector_trigger_delay_us"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"fixed_gain_g1"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"use_gain_hg0"</span>: <span class="token boolean">false</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1config~1spot_finding/put" data-section-id="/paths/~1config~1spot_finding/put" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1spot_finding/put" aria-label="/paths/~1config~1spot_finding/put"></a>Configure spot finding<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Can be done anytime, also while data collection is running</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Can be done anytime, also while data collection is running</p>
|
||||
</div></div><h5 class="sc-irLvIq cnGhhy">Request Body schema: <span class="sc-gYrqIg hJSqDi">application/json</span></h5><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><table class="sc-hIPBNq kHkWhD"><tbody><tr class=""><td kind="field" title="enable" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">enable</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">true</span></div> <div><div html="<p>Enable spot finding</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Enable spot finding</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="indexing" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">indexing</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">true</span></div> <div><div html="<p>Enable indexing</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Enable indexing</p>
|
||||
</div></div><h5 class="sc-irLvIq cnGhhy">Request Body schema: <span class="sc-gYrqIg hJSqDi">application/json</span></h5><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><table class="sc-hIPBNq kHkWhD"><tbody><tr class=""><td kind="field" title="enable" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">enable</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">true</span></div> <div><div html="<p>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.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>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.</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="indexing" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">indexing</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">true</span></div> <div><div html="<p>Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="filter_powder_rings" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">filter_powder_rings</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">false</span></div> <div><div html="<p>Filter spots which form powder rings (e.g., ice rings)</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Filter spots which form powder rings (e.g., ice rings)</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="min_spot_count_powder_ring" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">min_spot_count_powder_ring</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->>= 5<!-- --> </span></span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">20</span></div> <div><div html="<p>Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="signal_to_noise_threshold" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">signal_to_noise_threshold</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">number</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->float<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->>= 0<!-- --> </span></span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr><tr class=""><td kind="field" title="photon_count_threshold" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">photon_count_threshold</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->>= 0<!-- --> </span></span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr><tr class=""><td kind="field" title="min_pix_per_spot" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">min_pix_per_spot</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->>= 1<!-- --> </span></span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr><tr class=""><td kind="field" title="max_pix_per_spot" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">max_pix_per_spot</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->>= 1<!-- --> </span></span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr><tr class=""><td kind="field" title="high_resolution_limit" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">high_resolution_limit</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">number</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->float<!-- -->><!-- --> </span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr><tr class=""><td kind="field" title="low_resolution_limit" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">low_resolution_limit</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">number</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->float<!-- -->><!-- --> </span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr><tr class="last "><td kind="field" title="indexing_tolerance" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">indexing_tolerance</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">number</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->float<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0 .. 1 ]<!-- --> </span></span></div> <div><div html="<p>Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted</p>
|
||||
</div></div></div></td></tr></tbody></table><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA iSOCsR" disabled=""><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Everything OK</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Everything OK</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ideQht"><svg class="sc-eTNRI fWTllA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">400<!-- --> </strong><div html="<p>Input parsing or validation error</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Input parsing or validation error</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="put" class="sc-jYnQyy hyHSPQ http-verb put">put</span><span class="sc-fYrVWQ gllLir">/config/spot_finding</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/spot_finding</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Request samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-18" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-19" tabindex="0" data-rttab="true">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-19" aria-labelledby="react-tabs-18"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"enable"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"signal_to_noise_threshold"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"photon_count_threshold"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"min_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"max_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"high_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"low_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing_tolerance"</span>: <span class="token number">1</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1config~1spot_finding/get" data-section-id="/paths/~1config~1spot_finding/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1spot_finding/get" aria-label="/paths/~1config~1spot_finding/get"></a>Get data processing configuration<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Can be done anytime</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="put" class="sc-jYnQyy hyHSPQ http-verb put">put</span><span class="sc-fYrVWQ gllLir">/config/spot_finding</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/spot_finding</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Request samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-18" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-19" tabindex="0" data-rttab="true">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-19" aria-labelledby="react-tabs-18"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"enable"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"filter_powder_rings"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"min_spot_count_powder_ring"</span>: <span class="token number">20</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"signal_to_noise_threshold"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"photon_count_threshold"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"min_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"max_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"high_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"low_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing_tolerance"</span>: <span class="token number">1</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1config~1spot_finding/get" data-section-id="/paths/~1config~1spot_finding/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1spot_finding/get" aria-label="/paths/~1config~1spot_finding/get"></a>Get data processing configuration<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Can be done anytime</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Can be done anytime</p>
|
||||
</div></div><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Everything OK</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Everything OK</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/config/spot_finding</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/spot_finding</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Response samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-20" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-21" tabindex="0" data-rttab="true">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-21" aria-labelledby="react-tabs-20"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"enable"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"signal_to_noise_threshold"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"photon_count_threshold"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"min_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"max_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"high_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"low_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing_tolerance"</span>: <span class="token number">1</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1config~1rad_int/put" data-section-id="/paths/~1config~1rad_int/put" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1rad_int/put" aria-label="/paths/~1config~1rad_int/put"></a>Configure radial integration<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Can be done when detector is Inactive or Idle</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/config/spot_finding</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/spot_finding</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Response samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-20" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-21" tabindex="0" data-rttab="true">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-21" aria-labelledby="react-tabs-20"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"enable"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"filter_powder_rings"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"min_spot_count_powder_ring"</span>: <span class="token number">20</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"signal_to_noise_threshold"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"photon_count_threshold"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"min_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"max_pix_per_spot"</span>: <span class="token number">1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"high_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"low_resolution_limit"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"indexing_tolerance"</span>: <span class="token number">1</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1config~1rad_int/put" data-section-id="/paths/~1config~1rad_int/put" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1rad_int/put" aria-label="/paths/~1config~1rad_int/put"></a>Configure radial integration<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Can be done when detector is Inactive or Idle</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Can be done when detector is Inactive or Idle</p>
|
||||
</div></div><h5 class="sc-irLvIq cnGhhy">Request Body schema: <span class="sc-gYrqIg hJSqDi">application/json</span></h5><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><table class="sc-hIPBNq kHkWhD"><tbody><tr class=""><td kind="field" title="polarization_factor" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">polarization_factor</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">number</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->float<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ -1 .. 1 ]<!-- --> </span></span></div> <div><div html="<p>If polarization factor is provided, than polarization correction is enabled.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>If polarization factor is provided, than polarization correction is enabled.</p>
|
||||
@@ -581,13 +587,25 @@ Requires binary blob with 16-bit integer numbers of size of detector in raw/conv
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>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).</p>
|
||||
</div></div><div><h5 class="sc-irLvIq cnGhhy">query<!-- --> Parameters</h5><table class="sc-hIPBNq kHkWhD"><tbody><tr class="last "><td kind="field" title="number" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">number</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0 .. 127 ]<!-- --> </span></span></div> <div><div html="<p>Image number to upload</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Image number to upload</p>
|
||||
</div></div><div><h5 class="sc-irLvIq cnGhhy">query<!-- --> Parameters</h5><table class="sc-hIPBNq kHkWhD"><tbody><tr class="last "><td kind="field" title="id" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">id</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0 .. 127 ]<!-- --> </span></span></div> <div><div html="<p>Image id to upload</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Image id to upload</p>
|
||||
</div></div></div></td></tr></tbody></table></div><h5 class="sc-irLvIq cnGhhy">Request Body schema: <span class="sc-gYrqIg hJSqDi">application/octet-stream</span></h5><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><div><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">string</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->binary<!-- -->><!-- --> </span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></div><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA iSOCsR" disabled=""><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Everything OK</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Everything OK</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ideQht"><svg class="sc-eTNRI fWTllA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">400<!-- --> </strong><div html="<p>Input parsing or validation error</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Input parsing or validation error</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="put" class="sc-jYnQyy hyHSPQ http-verb put">put</span><span class="sc-fYrVWQ gllLir">/config/internal_generator_image</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/internal_generator_image</div></div></div></div></div></div></div></div><div id="/paths/~1config~1select_detector/put" data-section-id="/paths/~1config~1select_detector/put" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1select_detector/put" aria-label="/paths/~1config~1select_detector/put"></a>Select detector<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Jungfraujoch allows to control multiple detectors and/or region-of-interests.
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="put" class="sc-jYnQyy hyHSPQ http-verb put">put</span><span class="sc-fYrVWQ gllLir">/config/internal_generator_image</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/internal_generator_image</div></div></div></div></div></div></div></div><div id="/paths/~1config~1internal_generator_image.tiff/put" data-section-id="/paths/~1config~1internal_generator_image.tiff/put" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1internal_generator_image.tiff/put" aria-label="/paths/~1config~1internal_generator_image.tiff/put"></a>Load TIFF image for internal FPGA generator<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>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).</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>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).</p>
|
||||
</div></div><div><h5 class="sc-irLvIq cnGhhy">query<!-- --> Parameters</h5><table class="sc-hIPBNq kHkWhD"><tbody><tr class="last "><td kind="field" title="id" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">id</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0 .. 127 ]<!-- --> </span></span></div> <div><div html="<p>Image ID to upload</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Image ID to upload</p>
|
||||
</div></div></div></td></tr></tbody></table></div><h5 class="sc-irLvIq cnGhhy">Request Body schema: <span class="sc-gYrqIg hJSqDi">image/tiff</span></h5><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><div><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">string</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->binary<!-- -->><!-- --> </span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></div><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA iSOCsR" disabled=""><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Everything OK</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Everything OK</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ideQht"><svg class="sc-eTNRI fWTllA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">400<!-- --> </strong><div html="<p>Input parsing or validation error</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Input parsing or validation error</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="put" class="sc-jYnQyy hyHSPQ http-verb put">put</span><span class="sc-fYrVWQ gllLir">/config/internal_generator_image.tiff</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/internal_generator_image.tiff</div></div></div></div></div></div></div></div><div id="/paths/~1config~1select_detector/put" data-section-id="/paths/~1config~1select_detector/put" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1select_detector/put" aria-label="/paths/~1config~1select_detector/put"></a>Select detector<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>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 <code>Inactive</code> state and will require reinitialization.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Jungfraujoch allows to control multiple detectors and/or region-of-interests.
|
||||
@@ -759,11 +777,13 @@ Changing detector will set detector to <code>Inactive</code> state and will requ
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Show spot finding results on the image</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_roi" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">show_roi</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">false</span></div> <div><div html="<p>Show ROI areas on the image</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Show ROI areas on the image</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="jpeg_quality" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">jpeg_quality</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0 .. 100 ]<!-- --> </span></span></div> <div><div html="<p>Quality of JPEG image (100 - highest; 0 - lowest)</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="jpeg_quality" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">jpeg_quality</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0 .. 100 ]<!-- --> </span></span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">100</span></div> <div><div html="<p>Quality of JPEG image (100 - highest; 0 - lowest)</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Quality of JPEG image (100 - highest; 0 - lowest)</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_indexed" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">show_indexed</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div> <div><div html="<p>Preview indexed images only</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_indexed" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">show_indexed</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">false</span></div> <div><div html="<p>Preview indexed images only</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Preview indexed images only</p>
|
||||
</div></div></div></td></tr><tr class="last "><td kind="field" title="resolution_ring" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">resolution_ring</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">number</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->float<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0.1 .. 100 ]<!-- --> </span></span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr></tbody></table><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Preview image</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_user_mask" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">show_user_mask</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">boolean</span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">false</span></div> <div><div html="<p>Show user mask</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Show user mask</p>
|
||||
</div></div></div></td></tr><tr class="last "><td kind="field" title="resolution_ring" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">resolution_ring</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">number</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->float<!-- -->><!-- --> </span><span> <span class="sc-gUjWJS sc-cmfnrN itHPsH iOjfOC"> <!-- -->[ 0.1 .. 100 ]<!-- --> </span></span></div><div><span class="sc-gUjWJS itHPsH"> <!-- -->Default:<!-- --> </span> <span class="sc-gUjWJS sc-ldgOGP itHPsH cRxwgg">0.1</span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></td></tr></tbody></table><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Preview image</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Preview image</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ideQht"><svg class="sc-eTNRI fWTllA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">400<!-- --> </strong><div html="<p>Input parsing or validation error</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Input parsing or validation error</p>
|
||||
@@ -771,7 +791,7 @@ Changing detector will set detector to <code>Inactive</code> state and will requ
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>No preview image recorded so far</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ideQht"><svg class="sc-eTNRI fWTllA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">500<!-- --> </strong><div html="<p>Error within Jungfraujoch code - see output message.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Error within Jungfraujoch code - see output message.</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="post" class="sc-jYnQyy jBKVIL http-verb post">post</span><span class="sc-fYrVWQ gllLir">/preview/image.jpeg</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/preview/image.jpeg</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Request samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-86" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-87" tabindex="0" data-rttab="true">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-87" aria-labelledby="react-tabs-86"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"saturation"</span>: <span class="token number">65535</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"show_spots"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"show_roi"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"jpeg_quality"</span>: <span class="token number">100</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"show_indexed"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"resolution_ring"</span>: <span class="token number">0.1</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Response samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="react-tabs-88" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-89" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-89" aria-labelledby="react-tabs-88"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1preview~1image.jpeg/get" data-section-id="/paths/~1preview~1image.jpeg/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1preview~1image.jpeg/get" aria-label="/paths/~1preview~1image.jpeg/get"></a>Get last preview image in JPEG format using default settings<!-- --> </h2><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.orLine truncated
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="post" class="sc-jYnQyy jBKVIL http-verb post">post</span><span class="sc-fYrVWQ gllLir">/preview/image.jpeg</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/preview/image.jpeg</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Request samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="react-tabs__tab react-tabs__tab--selected" role="tab" id="react-tabs-86" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-87" tabindex="0" data-rttab="true">Payload</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-87" aria-labelledby="react-tabs-86"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"saturation"</span>: <span class="token number">65535</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"show_spots"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"show_roi"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"jpeg_quality"</span>: <span class="token number">100</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"show_indexed"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"show_user_mask"</span>: <span class="token boolean">false</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"resolution_ring"</span>: <span class="token number">0.1</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Response samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="react-tabs-88" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-89" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-89" aria-labelledby="react-tabs-88"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1preview~1image.jpeg/get" data-section-id="/paths/~1preview~1image.jpeg/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1preview~1image.jpeg/get" aria-label="/paths/~1preview~1image.jpeg/get"></a>Get last preview image in JPEG format using default settings<!-- --> </Line truncated
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Preview image</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ifZPCr" disabled=""><strong class="sc-gWQvRS ePkkgX">404<!-- --> </strong><div html="<p>No preview image recorded so far</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>No preview image recorded so far</p>
|
||||
@@ -785,7 +805,37 @@ Changing detector will set detector to <code>Inactive</code> state and will requ
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Preview image</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ifZPCr" disabled=""><strong class="sc-gWQvRS ePkkgX">404<!-- --> </strong><div html="<p>No preview image recorded so far</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>No preview image recorded so far</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/preview/calibration.tiff</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/preview/calibration.tiff</div></div></div></div></div></div></div></div><div id="/paths/~1preview~1pedestal.tiff/get" data-section-id="/paths/~1preview~1pedestal.tiff/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1preview~1pedestal.tiff/get" aria-label="/paths/~1preview~1pedestal.tiff/get"></a>Get pedestal G0 in TIFF format<!-- --> </h2><div><h5 class="sc-irLvIq cnGhhy">query<!-- --> Parameters</h5><table class="sc-hIPBNq kHkWhD"><tbody><tr class=""><td kind="field" title="gain_level" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">gain_level</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span></div> <div><div html="<p>Gain level (0, 1, 2)</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/preview/calibration.tiff</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/preview/calibration.tiff</div></div></div></div></div></div></div></div><div id="/paths/~1config~1mask.tiff/get" data-section-id="/paths/~1config~1mask.tiff/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1mask.tiff/get" aria-label="/paths/~1config~1mask.tiff/get"></a>Get mask of the detector<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Get full pixel mask of the detector
|
||||
See NXmx standard for meaning of pixel values</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Get full pixel mask of the detector
|
||||
See NXmx standard for meaning of pixel values</p>
|
||||
</div></div><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Pixel mask in TIFF format (4 byte; unsigned)</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Pixel mask in TIFF format (4 byte; unsigned)</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/config/mask.tiff</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/mask.tiff</div></div></div></div></div></div></div></div><div id="/paths/~1config~1user_mask.tiff/get" data-section-id="/paths/~1config~1user_mask.tiff/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1user_mask.tiff/get" aria-label="/paths/~1config~1user_mask.tiff/get"></a>Get user mask of the detector<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked</p>
|
||||
</div></div><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>User mask in TIFF format (4 byte; unsigned)</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>User mask in TIFF format (4 byte; unsigned)</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/config/user_mask.tiff</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/user_mask.tiff</div></div></div></div></div></div></div></div><div id="/paths/~1config~1user_mask.tiff/put" data-section-id="/paths/~1config~1user_mask.tiff/put" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1config~1user_mask.tiff/put" aria-label="/paths/~1config~1user_mask.tiff/put"></a>Upload user mask of the detector<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>Should be in <code>Idle</code> 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&#39;t need to be assigned value.
|
||||
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.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Should be in <code>Idle</code> 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.
|
||||
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.</p>
|
||||
</div></div><h5 class="sc-irLvIq cnGhhy">Request Body schema: <span class="sc-gYrqIg hJSqDi">application/octet-stream</span></h5><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><div><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">string</span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP"> <!-- --><<!-- -->binary<!-- -->><!-- --> </span></div> <div><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div></div></div></div><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>All good</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>All good</p>
|
||||
</div></button></div><div><button class="sc-hsaIUA ideQht"><svg class="sc-eTNRI fWTllA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">500<!-- --> </strong><div html="<p>Error within Jungfraujoch code - see output message.</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Error within Jungfraujoch code - see output message.</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="put" class="sc-jYnQyy hyHSPQ http-verb put">put</span><span class="sc-fYrVWQ gllLir">/config/user_mask.tiff</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/config/user_mask.tiff</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Response samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="react-tabs-90" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-91" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-91" aria-labelledby="react-tabs-90"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1preview~1pedestal.tiff/get" data-section-id="/paths/~1preview~1pedestal.tiff/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1preview~1pedestal.tiff/get" aria-label="/paths/~1preview~1pedestal.tiff/get"></a>Get pedestal G0 in TIFF format<!-- --> </h2><div><h5 class="sc-irLvIq cnGhhy">query<!-- --> Parameters</h5><table class="sc-hIPBNq kHkWhD"><tbody><tr class=""><td kind="field" title="gain_level" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">gain_level</span><div class="sc-gUjWJS sc-eKzvBH itHPsH ciWJhv">required</div></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span></div> <div><div html="<p>Gain level (0, 1, 2)</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Gain level (0, 1, 2)</p>
|
||||
</div></div></div></td></tr><tr class="last "><td kind="field" title="sc" class="sc-hABBmJ sc-fHejqy cqoAxn hfWKVF"><span class="sc-ifyrAs hIHfpT"></span><span class="property-name">sc</span></td><td class="sc-blmEgr berbbf"><div><div><span class="sc-gUjWJS sc-kZOsHZ itHPsH iSyacY"></span><span class="sc-gUjWJS sc-iLXxbI itHPsH gfdSsP">integer</span></div> <div><div html="<p>Storage cell number</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"><p>Storage cell number</p>
|
||||
@@ -795,7 +845,7 @@ Changing detector will set detector to <code>Inactive</code> state and will requ
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>No calibration recorded so far</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/preview/pedestal.tiff</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/preview/pedestal.tiff</div></div></div></div></div></div></div></div></div><div class="sc-juusvx bsunyy"></div></div></div>
|
||||
<script>
|
||||
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.3","info":{"title":"Jungfraujoch","description":"Jungfraujoch Broker Web API","version":"1.0.1"},"components":{"schemas":{"rotation_axis":{"description":"Definition of a crystal rotation axis","type":"object","required":["step"],"properties":{"step":{"type":"number","format":"float","example":0.1,"description":"Angle step in degrees"},"start":{"type":"number","format":"float","example":50,"description":"Start angle in degrees","default":0},"vector":{"type":"array","description":"Rotation axis - vector with only zeros means using default value (set in a configuration file)","default":[0,0,0],"items":{"type":"number","format":"float"},"minItems":3,"maxItems":3}}},"dataset_settings":{"type":"object","required":["beam_x_pxl","beam_y_pxl","detector_distance_mm","photon_energy_keV","sample_name"],"properties":{"images_per_trigger":{"type":"integer","format":"int64","minimum":1,"default":1,"description":"For standard synchrotron data collection - this is number of images collected per one TTL trigger\nFor XFEL (pulsed source) - this number is ignored and set to 1\nFor storage cell mode - this number is ignored and set to number of storage cells\n"},"ntrigger":{"type":"integer","format":"int64","default":1,"minimum":1,"description":"Number of TTL trigger that the detector is expected to receive during data collection\n"},"summation":{"type":"integer","format":"int64","minimum":1,"maximum":256,"default":1,"description":"FPGA frame summation. For summation above two 32-bit pixel format will be used, unless explicitly specified.\nFrame summation factor applies only to conversion mode (assumed as 1 for raw data).\nIn XFEL mode: summation happens for frames collected with multiple triggers.\nIgnored for storage cells (assumed as 1).\n"},"beam_x_pxl":{"type":"number","format":"float","description":"/entry/detector/beam_center_x in NXmx\nBeam center in X direction [pixels]\n"},"beam_y_pxl":{"type":"number","format":"float","description":"/entry/detector/beam_center_y in NXmx\nBeam center in X direction [pixels]\n"},"detector_distance_mm":{"type":"number","format":"float","minimum":0,"description":"/entry/detector/distance in NXmx Detector distance [mm]"},"photon_energy_keV":{"type":"number","format":"float","minimum":0,"description":"Used to calculate /entry/beam/incident_wavelength in NXmx\nIncident photon energy in keV\n"},"file_prefix":{"type":"string","default":"","description":"Prefix for filenames. If left empty, no file will be saved."},"images_per_file":{"type":"integer","format":"int64","minimum":0,"default":1000,"description":"Number of files in a single HDF5 data file (0 = write all images to a single data file)."},"space_group_number":{"type":"integer","format":"int64","minimum":0,"default":0,"maximum":194},"sample_name":{"type":"string","description":"/entry/sample/name in NXmx\nSample name\n"},"fpga_output":{"type":"string","enum":["auto","int32","int16","uint32","uint16"],"default":"auto","description":"FPGA output data type"},"compression":{"type":"string","enum":["bslz4","bszstd","bszstd_rle","none"],"default":"bslz4"},"total_flux":{"type":"number","format":"float","description":"/entry/beam/total_flux in NXmx\nFlux incident on beam plane in photons per second. In other words this is the flux integrated over area. [photons/s]\n"},"transmission":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"/entry/instrument/attenuator/attenuator_transmission\nTransmission of attenuator (filter) [no units]\n"},"omega":{"$ref":"#/components/schemas/rotation_axis"},"header_appendix":{"type":"string","description":"Header appendix, added as user_data to start message"},"image_appendix":{"type":"string","description":"Image appendix, added as user_data to image message"},"photon_energy_multiplier":{"type":"number","format":"float","default":1,"minimum":0.015625,"maximum":4,"description":"For JUNGFRAU conversion it is possible to multiply energy by a given factor to get fractional/multiplied photon counts"},"data_reduction_factor_serialmx":{"type":"number","format":"float","default":1,"minimum":0,"maximum":1,"description":"Rate at which non-indexed images are accepted to be forwarded to writer. \nValue of 1.0 (default) means that all images are written.\nValues below zero mean that non-indexed images will be accepted with a given probability.\n"},"unit_cell":{"type":"object","description":"Units of angstrom and degree","required":["a","b","c","alpha","beta","gamma"],"properties":{"a":{"type":"number","format":"float","example":37,"minimum":0},"b":{"type":"number","format":"float","example":37,"minimum":0},"c":{"type":"number","format":"float","example":78,"minimum":0},"alpha":{"type":"number","format":"float","example":90,"minimum":0,"maximum":360},"beta":{"type":"number","format":"float","example":90,"minimum":0,"maximum":360},"gamma":{"type":"number","format":"float","example":90,"minimum":0,"maximum":360}}}}},"Line truncated
|
||||
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.3","info":{"title":"Jungfraujoch","description":"Jungfraujoch Broker Web API","version":"1.0.1"},"components":{"schemas":{"rotation_axis":{"description":"Definition of a crystal rotation axis","type":"object","required":["step"],"properties":{"step":{"type":"number","format":"float","example":0.1,"description":"Angle step in degrees"},"start":{"type":"number","format":"float","example":50,"description":"Start angle in degrees","default":0},"vector":{"type":"array","description":"Rotation axis - vector with only zeros means using default value (set in a configuration file)","default":[0,0,0],"items":{"type":"number","format":"float"},"minItems":3,"maxItems":3}}},"dataset_settings":{"type":"object","required":["beam_x_pxl","beam_y_pxl","detector_distance_mm","photon_energy_keV","sample_name"],"properties":{"images_per_trigger":{"type":"integer","format":"int64","minimum":1,"default":1,"description":"For standard synchrotron data collection - this is number of images collected per one TTL trigger\nFor XFEL (pulsed source) - this number is ignored and set to 1\nFor storage cell mode - this number is ignored and set to number of storage cells\n"},"ntrigger":{"type":"integer","format":"int64","default":1,"minimum":1,"description":"Number of TTL trigger that the detector is expected to receive during data collection\n"},"summation":{"type":"integer","format":"int64","minimum":1,"maximum":256,"default":1,"description":"FPGA frame summation. For summation above two 32-bit pixel format will be used, unless explicitly specified.\nFrame summation factor applies only to conversion mode (assumed as 1 for raw data).\nIn XFEL mode: summation happens for frames collected with multiple triggers.\nIgnored for storage cells (assumed as 1).\n"},"beam_x_pxl":{"type":"number","format":"float","description":"/entry/detector/beam_center_x in NXmx\nBeam center in X direction [pixels]\n"},"beam_y_pxl":{"type":"number","format":"float","description":"/entry/detector/beam_center_y in NXmx\nBeam center in X direction [pixels]\n"},"detector_distance_mm":{"type":"number","format":"float","minimum":0,"description":"/entry/detector/distance in NXmx Detector distance [mm]"},"photon_energy_keV":{"type":"number","format":"float","minimum":0,"description":"Used to calculate /entry/beam/incident_wavelength in NXmx\nIncident photon energy in keV\n"},"file_prefix":{"type":"string","default":"","description":"Prefix for filenames. If left empty, no file will be saved."},"images_per_file":{"type":"integer","format":"int64","minimum":0,"default":1000,"description":"Number of files in a single HDF5 data file (0 = write all images to a single data file)."},"space_group_number":{"type":"integer","format":"int64","minimum":0,"default":0,"maximum":194},"sample_name":{"type":"string","description":"/entry/sample/name in NXmx\nSample name\n"},"fpga_output":{"type":"string","enum":["auto","int32","int16","uint32","uint16"],"default":"auto","description":"FPGA output data type"},"compression":{"type":"string","enum":["bslz4","bszstd","bszstd_rle","none"],"default":"bslz4"},"total_flux":{"type":"number","format":"float","description":"/entry/beam/total_flux in NXmx\nFlux incident on beam plane in photons per second. In other words this is the flux integrated over area. [photons/s]\n"},"transmission":{"type":"number","format":"float","minimum":0,"maximum":1,"description":"/entry/instrument/attenuator/attenuator_transmission\nTransmission of attenuator (filter) [no units]\n"},"omega":{"$ref":"#/components/schemas/rotation_axis"},"header_appendix":{"type":"string","description":"Header appendix, added as user_data to start message"},"image_appendix":{"type":"string","description":"Image appendix, added as user_data to image message"},"photon_energy_multiplier":{"type":"number","format":"float","default":1,"minimum":0.015625,"maximum":4,"description":"For JUNGFRAU conversion it is possible to multiply energy by a given factor to get fractional/multiplied photon counts"},"data_reduction_factor_serialmx":{"type":"number","format":"float","default":1,"minimum":0,"maximum":1,"description":"Rate at which non-indexed images are accepted to be forwarded to writer. \nValue of 1.0 (default) means that all images are written.\nValues below zero mean that non-indexed images will be accepted with a given probability.\n"},"unit_cell":{"type":"object","description":"Units of angstrom and degree","required":["a","b","c","alpha","beta","gamma"],"properties":{"a":{"type":"number","format":"float","example":37,"minimum":0},"b":{"type":"number","format":"float","example":37,"minimum":0},"c":{"type":"number","format":"float","example":78,"minimum":0},"alpha":{"type":"number","format":"float","example":90,"minimum":0,"maximum":360},"beta":{"type":"number","format":"float","example":90,"minimum":0,"maximum":360},"gamma":{"type":"number","format":"float","example":90,"minimum":0,"maximum":360}}}}},"Line truncated
|
||||
|
||||
var container = document.getElementById('redoc');
|
||||
Redoc.hydrate(__redoc_state, container);
|
||||
|
||||
@@ -29,8 +29,6 @@ DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup)
|
||||
internal_fpga_packet_generator = false;
|
||||
internal_fpga_packet_generator_images = 1;
|
||||
|
||||
debug_pixel_mask = false;
|
||||
|
||||
ndatastreams = 1;
|
||||
|
||||
frame_time = std::chrono::microseconds(MIN_FRAME_TIME_HALF_SPEED_IN_US);
|
||||
@@ -684,6 +682,7 @@ void DiffractionExperiment::CheckDataProcessingSettings(const SpotFindingSetting
|
||||
check_min("Spot finding low resolution limit", settings.low_resolution_limit, 1.0);
|
||||
check_max("Spot finding low resolution limit", settings.low_resolution_limit, 50.0);
|
||||
}
|
||||
check_min("min spot count for powder ring detection", settings.min_spot_count_powder_ring, 5);
|
||||
check_min("indexing tolerance", settings.indexing_tolerance, 0.0);
|
||||
check_max("indexing tolerance", settings.indexing_tolerance, 1.0);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ class DiffractionExperiment {
|
||||
std::string instrument_name_short;
|
||||
bool pulsed_source;
|
||||
|
||||
bool debug_pixel_mask;
|
||||
Coord default_omega_axis;
|
||||
|
||||
bool conversion_on_fpga;
|
||||
|
||||
+20
-10
@@ -12,7 +12,7 @@ PixelMask::PixelMask(const DetectorSetup &detector)
|
||||
PixelMask::PixelMask(const DiffractionExperiment& experiment)
|
||||
: PixelMask(experiment.GetDetectorSetup()) {}
|
||||
|
||||
void PixelMask::LoadDetectorBadPixelMask(const std::vector<uint32_t> &input_mask, uint8_t bit) {
|
||||
void PixelMask::LoadMask(const std::vector<uint32_t> &input_mask, uint8_t bit) {
|
||||
if (input_mask.size() != mask.size())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Input match doesn't fit the detector ");
|
||||
@@ -25,7 +25,11 @@ void PixelMask::LoadDetectorBadPixelMask(const std::vector<uint32_t> &input_mask
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment) {
|
||||
void PixelMask::LoadDetectorBadPixelMask(const std::vector<uint32_t> &input_mask) {
|
||||
LoadMask(input_mask, ErrorPixelBit);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment, bool conv) const {
|
||||
std::vector<uint32_t> mask_out = mask;
|
||||
|
||||
// apply edge mask
|
||||
@@ -39,7 +43,7 @@ std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment
|
||||
|| (line == RAW_MODULE_LINES - 1)
|
||||
|| (col == 0)
|
||||
|| (col == RAW_MODULE_COLS - 1))
|
||||
mask_out[pixel] |= (1 << 30);
|
||||
mask_out[pixel] |= (1 << ModuleEdgePixelBit);
|
||||
}
|
||||
|
||||
if (experiment.GetMaskChipEdges()) {
|
||||
@@ -47,33 +51,39 @@ std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment
|
||||
|| (col == 511) || (col == 512)
|
||||
|| (col == 767) || (col == 768)
|
||||
|| (line == 255) || (line== 256))
|
||||
mask_out[pixel] |= (1 << 31);
|
||||
mask_out[pixel] |= (1 << ChipGapPixelBit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (experiment.GetDetectorMode() == DetectorMode::Conversion) {
|
||||
std::vector<uint32_t> tmp(experiment.GetPixelsNum(), 1); // nonfuctional areas (i.e. gaps) are filled with 1
|
||||
if (conv && (experiment.GetDetectorMode() == DetectorMode::Conversion)) {
|
||||
std::vector<uint32_t> tmp(experiment.GetPixelsNum(), 1<<ModuleGapPixelBit); // nonfunctional areas (i.e. gaps) are filled with 1
|
||||
RawToConvertedGeometry<uint32_t, uint32_t>(experiment, tmp.data(), mask_out.data());
|
||||
return tmp;
|
||||
} else
|
||||
return mask_out;
|
||||
}
|
||||
|
||||
std::vector<uint32_t> PixelMask::GetUserMask(const DiffractionExperiment &experiment, bool conv) const {
|
||||
std::vector<uint32_t> ret = GetMask(experiment, conv);
|
||||
for (auto &i: ret)
|
||||
i = ((i & (1 << UserMaskedPixelBit)) != 0) ? 1 : 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void PixelMask::LoadUserMask(const DiffractionExperiment &experiment,
|
||||
const std::vector<uint32_t> &in_mask,
|
||||
uint8_t bit) {
|
||||
const std::vector<uint32_t> &in_mask) {
|
||||
if (experiment.GetModulesNum() != nmodules)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Mismatch in module size");
|
||||
|
||||
if (in_mask.size() == nmodules * RAW_MODULE_SIZE) {
|
||||
LoadDetectorBadPixelMask(in_mask, bit);
|
||||
LoadMask(in_mask, UserMaskedPixelBit);
|
||||
} else if (in_mask.size() == experiment.GetPixelsNum()) {
|
||||
std::vector<uint32_t> raw_mask(nmodules * RAW_MODULE_SIZE);
|
||||
ConvertedToRawGeometry(experiment, raw_mask.data(), in_mask.data());
|
||||
LoadDetectorBadPixelMask(in_mask, bit);
|
||||
LoadMask(raw_mask, UserMaskedPixelBit);
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Size of input user mask invalid");
|
||||
|
||||
+12
-3
@@ -9,12 +9,21 @@
|
||||
class PixelMask {
|
||||
size_t nmodules;
|
||||
std::vector<uint32_t> mask;
|
||||
void LoadMask(const std::vector<uint32_t>& mask, uint8_t bit);
|
||||
public:
|
||||
// NXmx bits
|
||||
constexpr static const uint8_t ModuleGapPixelBit = 0;
|
||||
constexpr static const uint8_t ErrorPixelBit = 1;
|
||||
constexpr static const uint8_t UserMaskedPixelBit = 8;
|
||||
constexpr static const uint8_t ChipGapPixelBit = 31;
|
||||
constexpr static const uint8_t ModuleEdgePixelBit = 30;
|
||||
|
||||
PixelMask(const DetectorSetup& detector);
|
||||
PixelMask(const DiffractionExperiment& experiment);
|
||||
void LoadUserMask(const DiffractionExperiment& experiment, const std::vector<uint32_t>& mask, uint8_t bit);
|
||||
void LoadDetectorBadPixelMask(const std::vector<uint32_t>& mask, uint8_t bit);
|
||||
std::vector<uint32_t> GetMask(const DiffractionExperiment& experiment);
|
||||
void LoadUserMask(const DiffractionExperiment& experiment, const std::vector<uint32_t>& mask);
|
||||
void LoadDetectorBadPixelMask(const std::vector<uint32_t>& mask);
|
||||
std::vector<uint32_t> GetMask(const DiffractionExperiment& experiment, bool conv = true) const;
|
||||
std::vector<uint32_t> GetUserMask(const DiffractionExperiment& experiment, bool conv = true) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+6
-3
@@ -7,9 +7,12 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
enum class PlotType {BkgEstimate, RadInt, RadIntPerTimePoint, SpotCount, IndexingRate, IndexingRatePerTimePoint,
|
||||
ErrorPixels, ImageCollectionEfficiency, ReceiverDelay, ReceiverFreeSendBuf, StrongPixels,
|
||||
ROISum, ROIMaxCount, ROIPixels};
|
||||
enum class PlotType {
|
||||
BkgEstimate, RadInt, RadIntPerTimePoint, SpotCount, SpotCountInRings,
|
||||
IndexingRate, IndexingRatePerTimePoint,
|
||||
ErrorPixels, ImageCollectionEfficiency, ReceiverDelay, ReceiverFreeSendBuf, StrongPixels,
|
||||
ROISum, ROIMaxCount, ROIPixels
|
||||
};
|
||||
|
||||
struct PlotRequest {
|
||||
PlotType type;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <cmath>
|
||||
#include <optional>
|
||||
|
||||
#include "Plot.h"
|
||||
|
||||
@@ -37,6 +38,11 @@ template <class T> class StatusVector {
|
||||
return ret;
|
||||
}
|
||||
public:
|
||||
void AddElement(uint32_t id, std::optional<T> val) {
|
||||
if (val.has_value())
|
||||
AddElement(id, val.value());
|
||||
}
|
||||
|
||||
void AddElement(uint32_t id, T val) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
if (id >= content.size()) {
|
||||
|
||||
+89
-33
@@ -13,13 +13,18 @@
|
||||
struct spot_finder_packet {
|
||||
ap_uint<768> data;
|
||||
ap_uint<32> mask;
|
||||
ap_uint<32> strong_pixel;
|
||||
ap_int<32> count_threshold;
|
||||
ap_uint<32> snr_threshold;
|
||||
ap_uint<1> user;
|
||||
ap_uint<1> last;
|
||||
};
|
||||
|
||||
void spot_finder_in_stream(STREAM_768 &data_in,
|
||||
hls::stream<ap_uint<32>> &mask_in,
|
||||
hls::stream<spot_finder_packet> &data_out) {
|
||||
hls::stream<spot_finder_packet> &data_out,
|
||||
volatile ap_int<32> &in_count_threshold,
|
||||
volatile ap_uint<32> &in_snr_threshold) {
|
||||
ap_uint<32> mask;
|
||||
packet_768_t packet_in;
|
||||
{
|
||||
@@ -33,12 +38,53 @@ void spot_finder_in_stream(STREAM_768 &data_in,
|
||||
while (!packet_in.user) {
|
||||
#pragma HLS PIPELINE II=1
|
||||
mask_in >> mask;
|
||||
data_out << spot_finder_packet{.data = packet_in.data, .mask = mask, .user = packet_in.user, .last = packet_in.last};
|
||||
data_out << spot_finder_packet{
|
||||
.data = packet_in.data,
|
||||
.mask = mask,
|
||||
.strong_pixel = 0,
|
||||
.count_threshold = in_count_threshold,
|
||||
.snr_threshold = in_snr_threshold,
|
||||
.user = packet_in.user,
|
||||
.last = packet_in.last
|
||||
};
|
||||
data_in >> packet_in;
|
||||
}
|
||||
data_out << spot_finder_packet{.data = packet_in.data, .mask = 0, .user = packet_in.user, .last = packet_in.last};
|
||||
}
|
||||
|
||||
void spot_finder_out_stream(hls::stream<spot_finder_packet> &data_in,
|
||||
STREAM_768 &data_out,
|
||||
hls::stream<ap_axiu<32,1,1,1>> &strong_pixel_out) {
|
||||
spot_finder_packet packet_in;
|
||||
{
|
||||
#pragma HLS PROTOCOL fixed
|
||||
data_in >> packet_in;
|
||||
ap_wait();
|
||||
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
|
||||
ap_wait();
|
||||
}
|
||||
|
||||
data_in >> packet_in;
|
||||
while (!packet_in.user) {
|
||||
ap_uint<32> count_threshold = packet_in.count_threshold;
|
||||
ap_uint<32> snr_threshold_u32 = packet_in.snr_threshold;
|
||||
for (int i = 0; i < RAW_MODULE_SIZE * sizeof(uint16_t) / 64; i++) {
|
||||
#pragma HLS PIPELINE II=1
|
||||
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = packet_in.strong_pixel, .user = 0};
|
||||
data_in >> packet_in;
|
||||
}
|
||||
|
||||
// Save module statistics
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = count_threshold, .user = 0};
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = snr_threshold_u32, .user = 0};
|
||||
for (int i = 0; i < 14;i++)
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = 0, .user = 0};
|
||||
}
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = 0, .user = 1};
|
||||
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
|
||||
}
|
||||
|
||||
ap_int<SUM_BITWIDTH> calc_sum(ap_int<24> val[32], ap_uint<32> mask) {
|
||||
#pragma HLS PIPELINE II=1
|
||||
ap_int<SUM_BITWIDTH> ret = 0;
|
||||
@@ -73,6 +119,8 @@ void spot_finder_prepare(hls::stream<spot_finder_packet> &data_in,
|
||||
hls::stream<ap_int<SUM_BITWIDTH>> &sum_out,
|
||||
hls::stream<ap_int<SUM2_BITWIDTH>> &sum2_out,
|
||||
hls::stream<ap_int<VALID_BITWIDTH>> &valid_out) {
|
||||
ap_uint<32> strong_pixel;
|
||||
|
||||
spot_finder_packet packet;
|
||||
{
|
||||
#pragma HLS PROTOCOL fixed
|
||||
@@ -95,6 +143,7 @@ void spot_finder_prepare(hls::stream<spot_finder_packet> &data_in,
|
||||
for (ap_uint<15> i = 0; i < RAW_MODULE_SIZE * sizeof(uint16_t) / 64; i++) {
|
||||
#pragma HLS PIPELINE II=1
|
||||
data_out << packet;
|
||||
|
||||
ap_int<24> val[32];
|
||||
unpack32(packet.data, val);
|
||||
ap_uint<32> mask = packet.mask;
|
||||
@@ -167,31 +216,28 @@ ap_uint<32> spot_finder_count_threshold(ap_int<24> val[32], ap_int<32> &count_th
|
||||
}
|
||||
|
||||
void spot_finder_apply_threshold(hls::stream<spot_finder_packet> &data_in,
|
||||
STREAM_768 &data_out,
|
||||
hls::stream<spot_finder_packet> &data_out,
|
||||
hls::stream<ap_int<SUM_BITWIDTH>> &sum_in,
|
||||
hls::stream<ap_int<SUM2_BITWIDTH>> &sum2_in,
|
||||
hls::stream<ap_int<VALID_BITWIDTH>> &valid_in,
|
||||
hls::stream<ap_axiu<32,1,1,1>> &strong_pixel_out,
|
||||
volatile ap_int<32> &in_count_threshold,
|
||||
volatile ap_uint<32> &in_snr_threshold) {
|
||||
hls::stream<ap_int<VALID_BITWIDTH>> &valid_in) {
|
||||
ap_uint<32> strong_pixel_prev;
|
||||
spot_finder_packet packet_in;
|
||||
{
|
||||
#pragma HLS PROTOCOL fixed
|
||||
data_in >> packet_in;
|
||||
ap_wait();
|
||||
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
|
||||
data_out << packet_in;
|
||||
ap_wait();
|
||||
}
|
||||
|
||||
|
||||
ap_int<SUM_BITWIDTH> sum[32];
|
||||
ap_int<SUM2_BITWIDTH> sum2[32];
|
||||
ap_int<VALID_BITWIDTH> valid[32];
|
||||
|
||||
data_in >> packet_in;
|
||||
while (!packet_in.user) {
|
||||
ap_int<32> count_threshold = in_count_threshold;
|
||||
ap_uint<32> snr_threshold_u32 = in_snr_threshold;
|
||||
ap_int<32> count_threshold = packet_in.count_threshold;
|
||||
ap_uint<32> snr_threshold_u32 = packet_in.snr_threshold;
|
||||
float_uint32 thr;
|
||||
thr.u = snr_threshold_u32;
|
||||
ap_ufixed<10,8, AP_RND_CONV> snr_threshold = thr.f;
|
||||
@@ -212,34 +258,28 @@ void spot_finder_apply_threshold(hls::stream<spot_finder_packet> &data_in,
|
||||
valid_in >> valid[i % 32];
|
||||
}
|
||||
|
||||
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
|
||||
ap_int<24> data_unpacked[32];
|
||||
unpack32(packet_in.data, data_unpacked);
|
||||
|
||||
ap_uint<32> strong_pixel = spot_finder_count_threshold(data_unpacked, count_threshold) &
|
||||
spot_finder_snr_threshold(data_unpacked, snr_threshold_2,
|
||||
sum[i % 32], sum2[i % 32], valid[i % 32]);
|
||||
|
||||
strong_pixel = strong_pixel & packet_in.mask;
|
||||
spot_finder_snr_threshold(data_unpacked, snr_threshold_2,
|
||||
sum[i % 32], sum2[i % 32], valid[i % 32]);
|
||||
|
||||
if ((snr_threshold == 0) && (count_threshold <= 0))
|
||||
strong_pixel = 0;
|
||||
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = strong_pixel, .user = 0};
|
||||
strong_pixel = strong_pixel & packet_in.mask;
|
||||
|
||||
packet_in.mask |= strong_pixel; // mask strong pixels
|
||||
packet_in.strong_pixel |= strong_pixel; // add strong pixels to the output
|
||||
|
||||
data_out << packet_in;
|
||||
data_in >> packet_in;
|
||||
}
|
||||
|
||||
// Save module statistics
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = count_threshold, .user = 0};
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = snr_threshold_u32, .user = 0};
|
||||
for (int i = 0; i < 14;i++)
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = 0, .user = 0};
|
||||
}
|
||||
strong_pixel_out << ap_axiu<32,1,1,1>{.data = 0, .user = 1};
|
||||
data_out << packet_768_t{.data = packet_in.data, .user = packet_in.user, .last = packet_in.last};
|
||||
data_out << packet_in;
|
||||
}
|
||||
|
||||
|
||||
void spot_finder(STREAM_768 &data_in,
|
||||
hls::stream<ap_uint<32>> &mask_in,
|
||||
STREAM_768 &data_out,
|
||||
@@ -256,22 +296,38 @@ void spot_finder(STREAM_768 &data_in,
|
||||
|
||||
hls::stream<spot_finder_packet, 2> data_0;
|
||||
hls::stream<spot_finder_packet, 1080> data_1;
|
||||
hls::stream<spot_finder_packet, 8> data_2;
|
||||
hls::stream<spot_finder_packet, 1080> data_3;
|
||||
hls::stream<spot_finder_packet, 8> data_4;
|
||||
|
||||
#pragma HLS BIND_STORAGE variable=data_1 type=fifo impl=bram
|
||||
#pragma HLS BIND_STORAGE variable=data_3 type=fifo impl=bram
|
||||
|
||||
hls::stream<ap_int<SUM_BITWIDTH>, 24> sum_0;
|
||||
hls::stream<ap_int<SUM2_BITWIDTH>, 24> sum2_0;
|
||||
hls::stream<ap_int<VALID_BITWIDTH>, 24> valid_0;
|
||||
|
||||
hls::stream<ap_int<SUM_BITWIDTH>, 24> sum_1;
|
||||
hls::stream<ap_int<SUM2_BITWIDTH>, 24> sum2_1;
|
||||
hls::stream<ap_int<VALID_BITWIDTH>, 24> valid_1;
|
||||
|
||||
#ifndef JFJOCH_HLS_NOSYNTH
|
||||
spot_finder_in_stream(data_in, mask_in, data_0);
|
||||
spot_finder_in_stream(data_in, mask_in, data_0, in_count_threshold, in_snr_threshold);
|
||||
spot_finder_prepare(data_0, data_1, sum_0, sum2_0, valid_0);
|
||||
spot_finder_apply_threshold(data_1, data_out, sum_0, sum2_0, valid_0, strong_pixel_out,
|
||||
in_count_threshold, in_snr_threshold);
|
||||
spot_finder_apply_threshold(data_1, data_2, sum_0, sum2_0, valid_0);
|
||||
spot_finder_prepare(data_2, data_3, sum_1, sum2_1, valid_1);
|
||||
spot_finder_apply_threshold(data_3, data_4, sum_1, sum2_1, valid_1);
|
||||
spot_finder_out_stream(data_4, data_out, strong_pixel_out);
|
||||
#else
|
||||
std::vector<std::thread> spot_finder_cores;
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_in_stream(data_in, mask_in, data_0);});
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_in_stream(data_in, mask_in, data_0, in_count_threshold,
|
||||
in_snr_threshold);});
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_prepare(data_0, data_1, sum_0, sum2_0, valid_0);});
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_apply_threshold(data_1, data_out, sum_0, sum2_0, valid_0,
|
||||
strong_pixel_out, in_count_threshold,
|
||||
in_snr_threshold);});
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_apply_threshold(data_1, data_2, sum_0, sum2_0, valid_0);});
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_prepare(data_2, data_3, sum_1, sum2_1, valid_1);});
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_apply_threshold(data_3, data_4, sum_1, sum2_1, valid_1);});
|
||||
spot_finder_cores.emplace_back([&] {spot_finder_out_stream(data_4, data_out, strong_pixel_out);});
|
||||
|
||||
for (auto &i : spot_finder_cores)
|
||||
i.join();
|
||||
#endif
|
||||
|
||||
@@ -74,8 +74,8 @@ void spot_finder_mask(STREAM_768 &data_in,
|
||||
|| (((col == 0) || (col == 8) || (col == 16) || (col == 24)) && (j == 0))
|
||||
|| (pixel_val[j] == INT24_MIN)
|
||||
|| (pixel_val[j] == INT24_MAX)
|
||||
|| ((d[j] != 0) && (d[j] < min_d_value))
|
||||
|| ((d[j] != 0) && (d[j] > max_d_value)))
|
||||
|| (d[j] < min_d_value)
|
||||
|| (d[j] > max_d_value))
|
||||
mask_val[j] = 0;
|
||||
else
|
||||
mask_val[j] = 1;
|
||||
|
||||
@@ -54,12 +54,13 @@ int jfjoch_check_version(struct pci_dev *pdev) {
|
||||
release_level = ioread32(drvdata->bar0 + ACTION_CONFIG_OFFSET + ADDR_RELEASE_LEVEL);
|
||||
|
||||
if (action_type != JFJOCH_FPGA_MAGIC) {
|
||||
dev_err(dev, "Mismatch in JFJoch action type (%x)\n", action_type);
|
||||
dev_err(dev, "Very likely the FPGA is not flashed with Jungfraujoch design, given that action type register value is wrong (%x).\n", action_type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (release_level != JFJOCH_FPGA_RELEASE) {
|
||||
dev_err(dev, "Mismatch in JFJoch release level (%x)\n", release_level);
|
||||
dev_err(dev, "Jungfraujoch FPGA is flashed with design made with release %x, while driver is compiled with release %x.\n", release_level, JFJOCH_FPGA_RELEASE);
|
||||
dev_err(dev, "Given FPGA releases have braking changes in FPGA-driver interface (register map, data structure size, etc.)\n it is not safe and not supported at the moment to operate multiple releases with one driver.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -456,6 +456,8 @@ namespace {
|
||||
message.user_data = GetCBORString(value);
|
||||
else if (key == "spots")
|
||||
GetCBORSpots(message, value);
|
||||
else if (key == "spot_count_in_rings")
|
||||
message.spot_count_in_rings = GetCBORUInt(value);
|
||||
else if (key == "az_int_profile")
|
||||
GetCBORFloatArray(value, message.az_int_profile);
|
||||
else if (key == "indexing_result")
|
||||
|
||||
@@ -450,6 +450,8 @@ void CBORStream2Serializer::SerializeImage(const DataMessage& message) {
|
||||
CBOR_ENC_RATIONAL(mapEncoder, "end_time", message.timestamp + message.exptime, message.timestamp_base);
|
||||
|
||||
CBOR_ENC(mapEncoder, "spots", message.spots);
|
||||
CBOR_ENC(mapEncoder, "spot_count_in_rings", message.spot_count_in_rings);
|
||||
|
||||
CBOR_ENC(mapEncoder, "az_int_profile", message.az_int_profile);
|
||||
CBOR_ENC(mapEncoder, "indexing_result", message.indexing_result);
|
||||
if (!message.indexing_lattice.empty())
|
||||
|
||||
@@ -45,6 +45,7 @@ struct DataMessage {
|
||||
float image_collection_efficiency;
|
||||
|
||||
std::vector<SpotToSave> spots;
|
||||
std::optional<uint64_t> spot_count_in_rings = 0;
|
||||
|
||||
std::vector<float> az_int_profile;
|
||||
float bkg_estimate;
|
||||
|
||||
Generated
+5
-5
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "jungfrau-frontend",
|
||||
"version": "0.1.0",
|
||||
"name": "jungfraujoch-frontend",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "jungfrau-frontend",
|
||||
"version": "0.1.0",
|
||||
"license": "GPL-3.0",
|
||||
"name": "jungfraujoch-frontend",
|
||||
"version": "1.0.0",
|
||||
"license": "Proprietary",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.4",
|
||||
"@emotion/styled": "^11.10.4",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jungfrau-frontend",
|
||||
"version": "0.1.0",
|
||||
"license": "GPL-3.0",
|
||||
"name": "jungfraujoch-frontend",
|
||||
"version": "1.0.0",
|
||||
"license": "Proprietary",
|
||||
"private": true,
|
||||
"homepage": "/frontend",
|
||||
"dependencies": {
|
||||
@@ -29,7 +29,7 @@
|
||||
"redocly": "redocly build-docs ../broker/jfjoch_api.yaml --output=build/openapi.html",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"openapi": "openapi --input ../broker/jfjoch_api.yaml --output ./src/openapi"
|
||||
"openapi": "./node_modules/openapi-typescript-codegen/bin/index.js -i ../broker/jfjoch_api.yaml --output ./src/openapi"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
|
||||
@@ -80,7 +80,7 @@ class DataProcessingPlots extends Component<MyProps, MyState> {
|
||||
};
|
||||
|
||||
render() {
|
||||
return <Paper style={{textAlign: 'center'}} sx={{ height: 630, width: "100%" }}>
|
||||
return <Paper style={{textAlign: 'center'}} sx={{ height: 700, width: "100%" }}>
|
||||
<Toolbar>
|
||||
|
||||
<Grid container sx={{ minWidth: 500 }} >
|
||||
|
||||
@@ -17,6 +17,8 @@ class DataProcessingSettings extends Component<MyProps, MyState> {
|
||||
s: {
|
||||
enable: true,
|
||||
indexing: true,
|
||||
filter_powder_rings: false,
|
||||
min_spot_count_powder_ring: 20,
|
||||
photon_count_threshold: 8,
|
||||
signal_to_noise_threshold: 3.0,
|
||||
min_pix_per_spot: 2,
|
||||
@@ -50,10 +52,6 @@ class DataProcessingSettings extends Component<MyProps, MyState> {
|
||||
this.interval = setInterval(() => this.getValues(), 1000);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
|
||||
setPhotonCountThreshold = (event: Event, newValue: number | number[]) => {
|
||||
this.setState(prevState => (
|
||||
{
|
||||
@@ -133,8 +131,28 @@ class DataProcessingSettings extends Component<MyProps, MyState> {
|
||||
this.getValues();
|
||||
}
|
||||
|
||||
enableFilterPowderRingToggle = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
let x = this.state;
|
||||
x.s.filter_powder_rings = event.target.checked;
|
||||
this.putValues2(x);
|
||||
this.getValues();
|
||||
}
|
||||
|
||||
setMinSpotCountPowderRing = (event: Event, newValue: number | number[]) => {
|
||||
this.setState(prevState => (
|
||||
{
|
||||
s : {
|
||||
...prevState.s,
|
||||
min_spot_count_powder_ring: newValue as number
|
||||
}
|
||||
}
|
||||
));
|
||||
this.putValues();
|
||||
this.getValues();
|
||||
}
|
||||
|
||||
render() {
|
||||
return <Paper style={{textAlign: 'center'}} sx={{ height: 630, width: '100%' }}>
|
||||
return <Paper style={{textAlign: 'center'}} sx={{ height: 700, width: '100%' }}>
|
||||
<Grid container spacing={0}>
|
||||
|
||||
<Grid item xs={1}/>
|
||||
@@ -142,43 +160,53 @@ class DataProcessingSettings extends Component<MyProps, MyState> {
|
||||
<br/><strong>Spot finding parameters</strong><br/><br/>
|
||||
<Switch onChange={this.enableSpotFindingToggle} checked={this.state.s.enable}
|
||||
disabled={this.state.connection_error}/>
|
||||
Enable spot finding
|
||||
<Switch onChange={this.enableIndexingToggle} checked={this.state.s.indexing}
|
||||
disabled={this.state.connection_error || !this.state.s.enable}/>
|
||||
Enable indexing <br/><br/>
|
||||
Spot finding
|
||||
<br/><br/>
|
||||
|
||||
<Typography gutterBottom> Count threshold </Typography>
|
||||
<Slider disabled={this.state.connection_error || !this.state.s.enable}
|
||||
value={Number(this.state.s.photon_count_threshold)}
|
||||
onChange={this.setPhotonCountThreshold}
|
||||
min={1} max={50} step={1} valueLabelDisplay="auto" />
|
||||
min={1} max={50} step={1} valueLabelDisplay="auto"/>
|
||||
|
||||
<br/><Typography> Signal-to-noise threshold </Typography>
|
||||
<Slider disabled={this.state.connection_error || !this.state.s.enable}
|
||||
value={Number(this.state.s.signal_to_noise_threshold)}
|
||||
onChange={this.setSignalToNoiseThreshold}
|
||||
min={2} max={10} step={0.5} valueLabelDisplay="auto" />
|
||||
min={2} max={10} step={0.5} valueLabelDisplay="auto"/>
|
||||
|
||||
<br/><Typography> Minimum pixel / spot </Typography>
|
||||
<Slider disabled={this.state.connection_error || !this.state.s.enable}
|
||||
value={Number(this.state.s.min_pix_per_spot)}
|
||||
onChange={this.setMinPixPerSpot}
|
||||
min={1} max={8} step={1} valueLabelDisplay="auto" />
|
||||
min={1} max={8} step={1} valueLabelDisplay="auto"/>
|
||||
<Typography> High resolution limit [Å] </Typography>
|
||||
<Slider disabled={this.state.connection_error || !this.state.s.enable}
|
||||
value={Number(this.state.s.high_resolution_limit)}
|
||||
onChange={this.setHighResolutionLimit}
|
||||
min={1} max={5} step={0.2} valueLabelDisplay="auto" />
|
||||
min={1} max={5} step={0.2} valueLabelDisplay="auto"/>
|
||||
<br/><br/>
|
||||
<Switch onChange={this.enableFilterPowderRingToggle}
|
||||
checked={this.state.s.filter_powder_rings}
|
||||
disabled={this.state.connection_error || !this.state.s.enable}/>
|
||||
Filter spots in powder rings (<i>e.g.</i>, ice)
|
||||
<br/><br/>
|
||||
<Typography> Min spots to filter powder ring </Typography>
|
||||
<Slider disabled={this.state.connection_error || !this.state.s.enable || !this.state.s.filter_powder_rings}
|
||||
value={Number(this.state.s.filter_powder_rings)}
|
||||
onChange={this.setMinSpotCountPowderRing}
|
||||
min={5} max={50} step={1} valueLabelDisplay="auto"/>
|
||||
<br/> <br/>
|
||||
<Switch onChange={this.enableIndexingToggle} checked={this.state.s.indexing}
|
||||
disabled={this.state.connection_error || !this.state.s.enable}/>
|
||||
Indexing <br/><br/>
|
||||
<Typography> Indexing spot acceptance tolerance </Typography>
|
||||
<Slider disabled={this.state.connection_error || !this.state.s.enable}
|
||||
<Slider disabled={this.state.connection_error || !this.state.s.enable || !this.state.s.indexing}
|
||||
value={Number(this.state.s.indexing_tolerance)}
|
||||
onChange={this.setIndexingTolerance}
|
||||
min={0.0} max={0.3} step={0.01} valueLabelDisplay="auto" />
|
||||
<br/><br/>
|
||||
min={0.0} max={0.3} step={0.01} valueLabelDisplay="auto"/>
|
||||
</Grid>
|
||||
<Grid item xs={1}/>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Paper>
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
show_spots: true,
|
||||
show_roi: false,
|
||||
show_indexed: false,
|
||||
show_user_mask: false,
|
||||
resolution_ring: 0.5
|
||||
},
|
||||
s_url: null,
|
||||
@@ -94,6 +95,17 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
);
|
||||
}
|
||||
|
||||
showUserMaskToggle = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
this.setState(prevState => (
|
||||
{
|
||||
settings : {
|
||||
...prevState.settings,
|
||||
show_user_mask: event.target.checked
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
getValues() {
|
||||
if (!this.state.update)
|
||||
return;
|
||||
@@ -125,7 +137,7 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
}
|
||||
|
||||
render() {
|
||||
return <Paper sx={{height: 1050, width: 850, m: 2}}
|
||||
return <Paper sx={{height: 1250, width: 1000, m: 2}}
|
||||
component={Stack}
|
||||
direction="column">
|
||||
<br/>
|
||||
@@ -143,6 +155,9 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
<Switch disabled={this.state.connection_error} checked={this.state.settings.show_indexed}
|
||||
onChange={this.showIndexedToggle} name="Show ROI"/>
|
||||
Show only indexed images
|
||||
<Switch disabled={this.state.connection_error} checked={this.state.settings.show_user_mask}
|
||||
onChange={this.showUserMaskToggle} name="Show user mask"/>
|
||||
Show user mask
|
||||
<Box sx={{width: 200}}>
|
||||
<Slider disabled={this.state.connection_error}
|
||||
value={Number(this.state.settings.saturation)} min={1} max={80}
|
||||
|
||||
@@ -27,6 +27,10 @@ export type preview_settings = {
|
||||
* Preview indexed images only
|
||||
*/
|
||||
show_indexed?: boolean;
|
||||
/**
|
||||
* Show user mask
|
||||
*/
|
||||
show_user_mask?: boolean;
|
||||
resolution_ring?: number;
|
||||
};
|
||||
|
||||
@@ -5,13 +5,24 @@
|
||||
|
||||
export type spot_finding_settings = {
|
||||
/**
|
||||
* Enable spot finding
|
||||
* Enable spot finding. This is temporary setting, i.e. can be changed anytime during data collection.
|
||||
* Even if disabled spot finding information will still be send and written, though always with zero spots.
|
||||
*
|
||||
*/
|
||||
enable: boolean;
|
||||
/**
|
||||
* Enable indexing
|
||||
* Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.
|
||||
*
|
||||
*/
|
||||
indexing: boolean;
|
||||
/**
|
||||
* Filter spots which form powder rings (e.g., ice rings)
|
||||
*/
|
||||
filter_powder_rings?: boolean;
|
||||
/**
|
||||
* Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.
|
||||
*/
|
||||
min_spot_count_powder_ring?: number;
|
||||
signal_to_noise_threshold: number;
|
||||
photon_count_threshold: number;
|
||||
min_pix_per_spot: number;
|
||||
|
||||
@@ -280,20 +280,20 @@ export class DefaultService {
|
||||
* Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates
|
||||
* (depending on detector settings).
|
||||
*
|
||||
* @param number Image number to upload
|
||||
* @param id Image id to upload
|
||||
* @param requestBody
|
||||
* @returns any Everything OK
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putConfigInternalGeneratorImage(
|
||||
number?: number,
|
||||
id?: number,
|
||||
requestBody?: Blob,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/config/internal_generator_image',
|
||||
query: {
|
||||
'number': number,
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/octet-stream',
|
||||
@@ -303,6 +303,35 @@ export class DefaultService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load TIFF image for internal FPGA generator
|
||||
* 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).
|
||||
*
|
||||
* @param id Image ID to upload
|
||||
* @param requestBody
|
||||
* @returns any Everything OK
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putConfigInternalGeneratorImageTiff(
|
||||
id?: number,
|
||||
requestBody?: Blob,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/config/internal_generator_image.tiff',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'image/tiff',
|
||||
errors: {
|
||||
400: `Input parsing or validation error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Select detector
|
||||
* Jungfraujoch allows to control multiple detectors and/or region-of-interests.
|
||||
@@ -847,6 +876,63 @@ export class DefaultService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mask of the detector
|
||||
* Get full pixel mask of the detector
|
||||
* See NXmx standard for meaning of pixel values
|
||||
*
|
||||
* @returns binary Pixel mask in TIFF format (4 byte; unsigned)
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getConfigMaskTiff(): CancelablePromise<Blob> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/config/mask.tiff',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user mask of the detector
|
||||
* Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
|
||||
* @returns binary User mask in TIFF format (4 byte; unsigned)
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getConfigUserMaskTiff(): CancelablePromise<Blob> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/config/user_mask.tiff',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload user mask of the detector
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* @param requestBody
|
||||
* @returns binary All good
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putConfigUserMaskTiff(
|
||||
requestBody?: Blob,
|
||||
): CancelablePromise<Blob> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/config/user_mask.tiff',
|
||||
body: requestBody,
|
||||
mediaType: 'application/octet-stream',
|
||||
errors: {
|
||||
500: `Error within Jungfraujoch code - see output message.`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pedestal G0 in TIFF format
|
||||
* @param gainLevel Gain level (0, 1, 2)
|
||||
|
||||
@@ -1,86 +1,125 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include "CPUSpotFinder.h"
|
||||
#define NUM_PASS 2
|
||||
|
||||
template <int N>
|
||||
void FindSpots(DeviceOutput &output,
|
||||
int big_column, int big_row,
|
||||
const SpotFindingSettings& settings,
|
||||
const float *d_array) {
|
||||
const float *d_array,
|
||||
float *arr_mean,
|
||||
float *arr_stddev,
|
||||
uint32_t *arr_valid_count,
|
||||
uint32_t *arr_strong_pixel) {
|
||||
auto image = (int16_t *) output.pixels;
|
||||
|
||||
int64_t sum = 0;
|
||||
int64_t sum2 = 0;
|
||||
int64_t valid_count = 0;
|
||||
std::vector<uint8_t> mask(N * N, 0);
|
||||
|
||||
for (int y = 0; y < N; y++) {
|
||||
size_t line = big_row * N + y;
|
||||
for (int x = 0; x < N; x++) {
|
||||
size_t coord = (big_row * N + y) * RAW_MODULE_COLS + big_column * N + x;
|
||||
if ((image[coord] != INT16_MIN) || (image[coord] != INT16_MAX)) {
|
||||
sum += image[coord];
|
||||
sum2 += image[coord] * image[coord];
|
||||
valid_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int64_t variance = valid_count * sum2 - sum * sum;
|
||||
float threshold = variance * settings.signal_to_noise_threshold * settings.signal_to_noise_threshold;
|
||||
|
||||
for (int y = 0; y < N; y++) {
|
||||
for (int x = 0; x < N; x++) {
|
||||
size_t line = big_row * N + y;
|
||||
size_t col = big_column * N + x;
|
||||
size_t coord = line * RAW_MODULE_COLS + col;
|
||||
|
||||
bool strong_pixel = true;
|
||||
|
||||
uint8_t bad_pixel = 0;
|
||||
if ((line == 255) || (line == 256)
|
||||
|| (col == 255) || (col == 256)
|
||||
|| (col == 511) || (col == 512)
|
||||
|| (col == 767) || (col == 768))
|
||||
strong_pixel = false;
|
||||
bad_pixel = 1;
|
||||
|
||||
if (d_array[coord] != 0) {
|
||||
if ((d_array[coord] < settings.high_resolution_limit)
|
||||
|| (d_array[coord] > settings.low_resolution_limit))
|
||||
if ((d_array[coord] < settings.high_resolution_limit)
|
||||
|| (d_array[coord] > settings.low_resolution_limit))
|
||||
bad_pixel = 1;
|
||||
|
||||
if ((image[coord] == INT16_MIN) || (image[coord] > 32760))
|
||||
bad_pixel = 1;
|
||||
|
||||
mask[y * N + x] = bad_pixel;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUM_PASS; i++) {
|
||||
int64_t sum = 0;
|
||||
int64_t sum2 = 0;
|
||||
int64_t valid_count = 0;
|
||||
|
||||
for (int y = 0; y < N; y++) {
|
||||
for (int x = 0; x < N; x++) {
|
||||
size_t coord = (big_row * N + y) * RAW_MODULE_COLS + big_column * N + x;
|
||||
if (mask[y * N + x] == 0) {
|
||||
sum += image[coord];
|
||||
sum2 += image[coord] * image[coord];
|
||||
valid_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int64_t variance = valid_count * sum2 - sum * sum;
|
||||
float threshold = variance * settings.signal_to_noise_threshold * settings.signal_to_noise_threshold;
|
||||
|
||||
for (int y = 0; y < N; y++) {
|
||||
size_t line = big_row * N + y;
|
||||
for (int x = 0; x < N; x++) {
|
||||
size_t col = big_column * N + x;
|
||||
size_t coord = line * RAW_MODULE_COLS + col;
|
||||
|
||||
arr_valid_count[coord] = valid_count;
|
||||
if (valid_count > 0) {
|
||||
arr_mean[coord] = static_cast<float>(sum) / static_cast<float>(valid_count);
|
||||
arr_stddev[coord] = sqrtf(
|
||||
static_cast<float>(variance) / static_cast<float>(valid_count * valid_count));
|
||||
} else {
|
||||
arr_mean[coord] = -1;
|
||||
arr_stddev[coord] = -1;
|
||||
}
|
||||
|
||||
bool strong_pixel = true;
|
||||
|
||||
if (mask[y * N + x])
|
||||
strong_pixel = false;
|
||||
}
|
||||
|
||||
if ((settings.photon_count_threshold < 0)
|
||||
&& (settings.signal_to_noise_threshold <= 0))
|
||||
strong_pixel = false;
|
||||
|
||||
if ((settings.photon_count_threshold >= 0)
|
||||
&& (image[coord] <= settings.photon_count_threshold)) {
|
||||
strong_pixel = false;
|
||||
}
|
||||
|
||||
if (image[coord] > 32760)
|
||||
strong_pixel = false;
|
||||
|
||||
if (settings.signal_to_noise_threshold > 0) {
|
||||
int64_t in_minus_mean = image[coord] * valid_count - sum;
|
||||
if ((in_minus_mean * in_minus_mean <= threshold)
|
||||
|| (in_minus_mean <= 0)
|
||||
|| (valid_count < N * N / 2))
|
||||
if ((settings.photon_count_threshold < 0)
|
||||
&& (settings.signal_to_noise_threshold <= 0))
|
||||
strong_pixel = false;
|
||||
}
|
||||
|
||||
if (strong_pixel) {
|
||||
output.spot_finding_result.strong_pixel[coord / 8] |= (1 << (coord % 8));
|
||||
output.spot_finding_result.strong_pixel_count++;
|
||||
if ((settings.photon_count_threshold >= 0)
|
||||
&& (image[coord] <= settings.photon_count_threshold)) {
|
||||
strong_pixel = false;
|
||||
}
|
||||
|
||||
if (settings.signal_to_noise_threshold > 0) {
|
||||
int64_t in_minus_mean = image[coord] * valid_count - sum;
|
||||
if ((in_minus_mean * in_minus_mean <= threshold)
|
||||
|| (in_minus_mean <= 0)
|
||||
|| (valid_count <= N * N / 2))
|
||||
strong_pixel = false;
|
||||
}
|
||||
|
||||
if (strong_pixel) {
|
||||
mask[y * N + x] = 1;
|
||||
arr_strong_pixel[coord]++;
|
||||
output.spot_finding_result.strong_pixel[coord / 8] |= (1 << (coord % 8));
|
||||
output.spot_finding_result.strong_pixel_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FindSpots(DeviceOutput &output, const SpotFindingSettings& settings, const float *d_array) {
|
||||
void FindSpots(DeviceOutput &output,
|
||||
const SpotFindingSettings& settings,
|
||||
const float *d_array,
|
||||
float *arr_mean,
|
||||
float *arr_stddev,
|
||||
uint32_t *arr_valid_count,
|
||||
uint32_t *arr_strong_pixel) {
|
||||
for (auto &i: output.spot_finding_result.strong_pixel)
|
||||
i = 0;
|
||||
|
||||
for (int i = 0; i < RAW_MODULE_LINES / 32; i++) {
|
||||
for (int j = 0; j < RAW_MODULE_COLS / 32; j++)
|
||||
FindSpots<32>(output, j, i, settings, d_array);
|
||||
FindSpots<32>(output, j, i, settings, d_array, arr_mean, arr_stddev, arr_valid_count, arr_strong_pixel);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,13 @@
|
||||
#include "SpotFindingSettings.h"
|
||||
#include "StrongPixelSet.h"
|
||||
|
||||
void FindSpots(DeviceOutput &output, const SpotFindingSettings& settings, const float *d_array);
|
||||
void FindSpots(DeviceOutput &output,
|
||||
const SpotFindingSettings& settings,
|
||||
const float *d_array,
|
||||
float *arr_mean,
|
||||
float *arr_stddev,
|
||||
uint32_t *arr_valid_count,
|
||||
uint32_t *arr_strong_pixel);
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_CPUSPOTFINDER_H
|
||||
@@ -8,13 +8,17 @@ void IndexerWrapper::Setup(const UnitCell &cell) {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<IndexingResult> IndexerWrapper::Run(const std::vector<Coord> &coord, float indexing_threshold) {
|
||||
std::vector<IndexingResult> IndexerWrapper::Run(const std::vector<Coord> &coord, float indexing_threshold, int nspots) {
|
||||
#ifdef JFJOCH_USE_CUDA
|
||||
std::vector<IndexingResult> ret;
|
||||
|
||||
if (coord.size() <= viable_cell_min_spots)
|
||||
if (nspots > coord.size())
|
||||
nspots = coord.size();
|
||||
|
||||
if (nspots <= viable_cell_min_spots)
|
||||
return ret;
|
||||
|
||||
assert(nspots <= MAX_SPOT_COUNT);
|
||||
assert(coord.size() <= MAX_SPOT_COUNT);
|
||||
|
||||
for (int i = 0; i < coord.size(); i++) {
|
||||
@@ -24,9 +28,9 @@ std::vector<IndexingResult> IndexerWrapper::Run(const std::vector<Coord> &coord,
|
||||
}
|
||||
|
||||
// Index
|
||||
indexer.index(1, coord.size());
|
||||
indexer.index(1, nspots);
|
||||
|
||||
fast_feedback::refine::indexer_ifssr<float>::refine(indexer.spotM().topRows(coord.size()),
|
||||
fast_feedback::refine::indexer_ifssr<float>::refine(indexer.spotM().topRows(nspots),
|
||||
indexer.oCellM(),
|
||||
indexer.oScoreV(),
|
||||
cifssr);
|
||||
@@ -38,30 +42,28 @@ std::vector<IndexingResult> IndexerWrapper::Run(const std::vector<Coord> &coord,
|
||||
// Get best cell
|
||||
auto id = fast_feedback::refine::best_cell(indexer.oScoreV());
|
||||
|
||||
bool indexed = fast_feedback::refine::is_viable_cell(indexer.oCell(id), indexer.Spots(),
|
||||
indexing_threshold, viable_cell_min_spots,
|
||||
false);
|
||||
auto cell = indexer.oCell(id).colwise().reverse();
|
||||
fast_feedback::refine::make_right_handed(cell);
|
||||
|
||||
// Check if result is viable
|
||||
if (indexed) {
|
||||
auto cell = indexer.oCell(id).colwise().reverse();
|
||||
fast_feedback::refine::make_right_handed(cell);
|
||||
using M3x = Eigen::MatrixX3<float>;
|
||||
M3x resid = indexer.spotM().topRows(coord.size()) * cell.transpose();
|
||||
const M3x miller = round(resid.array());
|
||||
resid -= miller;
|
||||
|
||||
// get indexed spots
|
||||
using M3x = Eigen::MatrixX3<float>;
|
||||
M3x resid = indexer.spotM().topRows(coord.size()) * cell.transpose();
|
||||
const M3x miller = round(resid.array());
|
||||
const M3x predicted = miller * cell.transpose().inverse();
|
||||
auto indexed_spots = (resid.rowwise().norm().array() < indexing_threshold);
|
||||
auto indexed_spot_count = indexed_spots.topRows(nspots).count();
|
||||
|
||||
// Conditions for indexing:
|
||||
// * There must be 9 AND 20% of all spots indexed
|
||||
// * Decision is only based on spots used for indexing (not all spots)
|
||||
if ((indexed_spot_count > viable_cell_min_spots) && (indexed_spot_count > 0.20 * nspots)) {
|
||||
IndexingResult result;
|
||||
result.l = CrystalLattice(cell);
|
||||
|
||||
result.predicted_spots.resize(coord.size());
|
||||
result.indexed_spot.resize(coord.size());
|
||||
|
||||
for (int i = 0; i < coord.size(); i++)
|
||||
result.predicted_spots[i] = Coord(predicted.coeff(i, 0),
|
||||
predicted.coeff(i, 1),
|
||||
predicted.coeff(i, 2));
|
||||
result.indexed_spot[i] = indexed_spots(i);
|
||||
|
||||
ret.emplace_back(result);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
struct IndexingResult {
|
||||
CrystalLattice l;
|
||||
std::vector<Coord> predicted_spots;
|
||||
std::vector<uint8_t> indexed_spot;
|
||||
};
|
||||
|
||||
class IndexerWrapper {
|
||||
@@ -36,7 +36,7 @@ class IndexerWrapper {
|
||||
constexpr const static uint32_t viable_cell_min_spots = 9;
|
||||
public:
|
||||
void Setup(const UnitCell &cell);
|
||||
std::vector<IndexingResult> Run(const std::vector<Coord> &coord, float indexing_threshold);
|
||||
std::vector<IndexingResult> Run(const std::vector<Coord> &coord, float indexing_threshold, int nspots = -1);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ MXAnalyzer::MXAnalyzer(const DiffractionExperiment &in_experiment)
|
||||
throw JFJochException(JFJochExceptionCategory::GPUCUDAError, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
if (experiment.IsSpotFindingEnabled())
|
||||
find_spots = true;
|
||||
|
||||
}
|
||||
|
||||
void MXAnalyzer::ReadFromFPGA(const DeviceOutput *output, const SpotFindingSettings &settings, size_t module_number) {
|
||||
@@ -60,18 +60,70 @@ void MXAnalyzer::ReadFromCPU(const int16_t *image, const SpotFindingSettings &se
|
||||
|
||||
CalcSpotFinderResolutionMap(d_map.data(), experiment, module_number);
|
||||
|
||||
FindSpots(output, settings, d_map.data());
|
||||
arr_mean.resize(experiment.GetModulesNum() * RAW_MODULE_SIZE);
|
||||
arr_sttdev.resize(experiment.GetModulesNum() * RAW_MODULE_SIZE);
|
||||
arr_valid_count.resize(experiment.GetModulesNum() * RAW_MODULE_SIZE);
|
||||
arr_strong_pixel.resize(experiment.GetModulesNum() * RAW_MODULE_SIZE);
|
||||
|
||||
FindSpots(output,
|
||||
settings,
|
||||
d_map.data(),
|
||||
arr_mean.data() + module_number * RAW_MODULE_SIZE,
|
||||
arr_sttdev.data() + module_number * RAW_MODULE_SIZE,
|
||||
arr_valid_count.data() + module_number * RAW_MODULE_SIZE,
|
||||
arr_strong_pixel.data() + module_number * RAW_MODULE_SIZE);
|
||||
|
||||
ReadFromFPGA(&output, settings, module_number);
|
||||
}
|
||||
|
||||
uint32_t MXAnalyzer::FilterSpotsInPowderRings(const std::vector<DiffractionSpot> &spots_filter,
|
||||
std::vector<DiffractionSpot> &spots_out,
|
||||
int64_t min_spot_count_ring) {
|
||||
uint32_t ret = 0;
|
||||
|
||||
double high_q = 5.0;
|
||||
double low_q = 0;
|
||||
double q_spacing = 0.01;
|
||||
|
||||
size_t bin_count = (high_q - low_q) / q_spacing + 1;
|
||||
|
||||
std::vector<std::vector<uint32_t> > bins(bin_count);
|
||||
|
||||
for (int i = 0; i < spots_filter.size(); i++) {
|
||||
double q = 2 * M_PI / spots_filter[i].GetResolution(experiment);
|
||||
if ((q >= low_q) && (q < high_q)) {
|
||||
int32_t q_bin = std::floor((q - low_q) / q_spacing);
|
||||
bins[q_bin].push_back(i);
|
||||
} else // spots outside of azim. int. range are not filtered
|
||||
spots_out.push_back(spots_filter[i]);
|
||||
}
|
||||
|
||||
for (auto & bin : bins) {
|
||||
if (bin.size() > min_spot_count_ring)
|
||||
ret += bin.size();
|
||||
else {
|
||||
for (auto &iter: bin)
|
||||
spots_out.push_back(spots_filter[iter]);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void MXAnalyzer::Process(DataMessage &message, const SpotFindingSettings& settings) {
|
||||
message.indexing_result = false;
|
||||
if (!find_spots)
|
||||
return;
|
||||
|
||||
std::vector<DiffractionSpot> spots_out;
|
||||
FilterSpotsByCount(experiment, spots, spots_out);
|
||||
if (settings.filter_spots_powder_ring) {
|
||||
std::vector<DiffractionSpot> spots_no_rings;
|
||||
message.spot_count_in_rings = FilterSpotsInPowderRings(spots,
|
||||
spots_no_rings,
|
||||
settings.min_spot_count_powder_ring);
|
||||
FilterSpotsByCount(experiment, spots_no_rings, spots_out);
|
||||
} else
|
||||
FilterSpotsByCount(experiment, spots, spots_out);
|
||||
|
||||
spots.clear();
|
||||
|
||||
for (const auto &spot: spots_out)
|
||||
@@ -83,22 +135,39 @@ void MXAnalyzer::Process(DataMessage &message, const SpotFindingSettings& settin
|
||||
for (const auto &i: spots_out)
|
||||
recip.push_back(i.ReciprocalCoord(experiment));
|
||||
|
||||
auto indexer_result = indexer->Run(recip, settings.indexing_tolerance);
|
||||
std::vector<IndexingResult> indexer_result;
|
||||
|
||||
// If there is a really large number of spots detected, it is better to start with a smaller subset
|
||||
if (recip.size() > 80)
|
||||
indexer_result = indexer->Run(recip, settings.indexing_tolerance, 50);
|
||||
if (indexer_result.empty())
|
||||
indexer_result = indexer->Run(recip, settings.indexing_tolerance);
|
||||
|
||||
if (!indexer_result.empty()) {
|
||||
message.indexing_result = true;
|
||||
assert(indexer_result[0].indexed_spot.size() == recip.size());
|
||||
|
||||
// identify indexed spots
|
||||
for (int i = 0; i < recip.size(); i++) {
|
||||
auto predicted_pos = RecipToDector(experiment, indexer_result[0].predicted_spots[i]);
|
||||
float x_diff = predicted_pos.first - spots_out[i].RawCoord().x;
|
||||
float y_diff = predicted_pos.second - spots_out[i].RawCoord().y;
|
||||
message.spots[i].indexed = (x_diff * x_diff + y_diff * y_diff
|
||||
< spot_distance_threshold_pxl * spot_distance_threshold_pxl);
|
||||
}
|
||||
for (int i = 0; i < recip.size(); i++)
|
||||
message.spots[i].indexed = indexer_result[0].indexed_spot[i];
|
||||
|
||||
indexer_result[0].l.Save(message.indexing_lattice);
|
||||
message.indexing_unit_cell = indexer_result[0].l.GetUnitCell();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<float> &MXAnalyzer::GetCPUMean() const {
|
||||
return arr_mean;
|
||||
}
|
||||
|
||||
const std::vector<float> &MXAnalyzer::GetCPUStdDev() const {
|
||||
return arr_sttdev;
|
||||
}
|
||||
|
||||
const std::vector<uint32_t> &MXAnalyzer::GetCPUValidCount() const {
|
||||
return arr_valid_count;
|
||||
}
|
||||
|
||||
const std::vector<uint32_t> &MXAnalyzer::GetCPUStrongPixel() const {
|
||||
return arr_strong_pixel;
|
||||
}
|
||||
@@ -13,7 +13,17 @@ class MXAnalyzer {
|
||||
bool find_spots = false;
|
||||
std::vector<DiffractionSpot> spots;
|
||||
constexpr static const float spot_distance_threshold_pxl = 2.0f;
|
||||
|
||||
std::vector<float> arr_mean;
|
||||
std::vector<float> arr_sttdev;
|
||||
std::vector<uint32_t> arr_valid_count;
|
||||
std::vector<uint32_t> arr_strong_pixel;
|
||||
public:
|
||||
const std::vector<float> &GetCPUMean() const;
|
||||
const std::vector<float> &GetCPUStdDev() const;
|
||||
const std::vector<uint32_t> &GetCPUValidCount() const;
|
||||
const std::vector<uint32_t> &GetCPUStrongPixel() const;
|
||||
|
||||
explicit MXAnalyzer(const DiffractionExperiment& experiment);
|
||||
|
||||
void ReadFromFPGA(const DeviceOutput* output,
|
||||
@@ -26,6 +36,10 @@ public:
|
||||
|
||||
void Process(DataMessage &message,
|
||||
const SpotFindingSettings& settings);
|
||||
|
||||
uint32_t FilterSpotsInPowderRings(const std::vector<DiffractionSpot> &spots_filter,
|
||||
std::vector<DiffractionSpot> &spots_out,
|
||||
int64_t min_spot_count_ring);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -7,14 +7,17 @@
|
||||
|
||||
struct SpotFindingSettings {
|
||||
bool enable = true;
|
||||
bool indexing = true;
|
||||
float signal_to_noise_threshold = 3; // STRONG_PIXEL in XDS
|
||||
int64_t photon_count_threshold = 10; // Threshold in photon counts
|
||||
int64_t min_pix_per_spot = 2; // Minimum pixels per spot
|
||||
int64_t max_pix_per_spot = 50; // Maximum pixels per spot
|
||||
float high_resolution_limit = 2.5;
|
||||
float high_resolution_limit = 2.0;
|
||||
float low_resolution_limit = 50.0;
|
||||
|
||||
bool filter_spots_powder_ring = false;
|
||||
int64_t min_spot_count_powder_ring = 20;
|
||||
|
||||
bool indexing = true;
|
||||
float indexing_tolerance = 0.1;
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "JFCalibration.h"
|
||||
|
||||
#include <cstring>
|
||||
#include "../preview/WriteTIFF.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
|
||||
JFCalibration::JFCalibration(size_t in_nmodules, size_t in_nstorage_cells) :
|
||||
nmodules(in_nmodules),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
FIND_PACKAGE(JPEG REQUIRED)
|
||||
|
||||
ADD_LIBRARY(JFJochPreview STATIC
|
||||
WriteTIFF.cpp WriteTIFF.h
|
||||
WriteJPEG.cpp WriteJPEG.h
|
||||
JFJochTIFF.cpp JFJochTIFF.h
|
||||
JFJochJPEG.cpp JFJochJPEG.h
|
||||
PreviewCounter.cpp PreviewCounter.h
|
||||
PreviewImage.cpp PreviewImage.h)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <jpeglib.h>
|
||||
|
||||
#include "../common/JFJochException.h"
|
||||
#include "WriteJPEG.h"
|
||||
#include "JFJochJPEG.h"
|
||||
|
||||
|
||||
std::string WriteJPEGToMem(const std::vector<uint8_t> &input, size_t width, size_t height, int quality) {
|
||||
File renamed without changes.
@@ -0,0 +1,110 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <tiffio.h>
|
||||
#include <tiffio.hxx>
|
||||
#include <sstream>
|
||||
|
||||
#include "JFJochTIFF.h"
|
||||
#include "../common/JFJochException.h"
|
||||
|
||||
|
||||
void WriteTIFF(TIFF *tiff, void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
|
||||
|
||||
if (tiff == nullptr)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFStreamOpen error");
|
||||
|
||||
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, cols); // set the width of the image
|
||||
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, lines); // set the height of the image
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 1); // set number of channels per pixel
|
||||
TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, elem_size * 8); // set the size of the channels
|
||||
TIFFSetField(tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE); // setc ompression to LZW
|
||||
TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, lines);
|
||||
if (is_signed)
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT);
|
||||
else
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
|
||||
|
||||
if (TIFFWriteEncodedStrip(tiff, 0, buff, cols * lines * elem_size) < 0)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFWriteEncodedStrip error");
|
||||
}
|
||||
|
||||
std::string WriteTIFFToString(void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
|
||||
std::stringstream os;
|
||||
|
||||
TIFF *tiff = TIFFStreamOpen("x", (std::ostream *) &os);
|
||||
WriteTIFF(tiff, buff, cols, lines, elem_size, is_signed);
|
||||
TIFFClose(tiff);
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
void WriteTIFFToFile(const std::string &filename, void *buff, size_t cols, size_t lines, size_t elem_size,
|
||||
bool is_signed) {
|
||||
TIFF *tiff = TIFFOpen(filename.c_str(), "w");
|
||||
|
||||
WriteTIFF(tiff, buff, cols, lines, elem_size, is_signed);
|
||||
|
||||
TIFFClose(tiff);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> ReadTIFFFromString32(const std::string &s, uint32_t &cols, uint32_t &lines) {
|
||||
uint32_t rows_per_string = 0;
|
||||
|
||||
std::vector<uint32_t> ret;
|
||||
|
||||
uint16_t elem_size;
|
||||
|
||||
std::istringstream input_TIFF_stream(s);
|
||||
TIFF* tiff = TIFFStreamOpen("MemTIFF", &input_TIFF_stream);
|
||||
TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &cols); // get the width of the image
|
||||
TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &lines); // get the height of the image
|
||||
TIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &elem_size); // get the size of the channels
|
||||
TIFFGetField(tiff, TIFFTAG_ROWSPERSTRIP, &rows_per_string);
|
||||
|
||||
if (elem_size != 32)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "Only 32-bit format supported");
|
||||
|
||||
ret.resize(cols * lines);
|
||||
|
||||
if (cols * sizeof(uint32_t) != TIFFScanlineSize(tiff))
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFScanlineSize mismatch");
|
||||
|
||||
for (int i = 0; i < lines; i++) {
|
||||
if (TIFFReadScanline(tiff, ret.data() + i * cols, i, 0) < 0)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFReadScanline error");
|
||||
}
|
||||
|
||||
TIFFClose(tiff);
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<uint16_t> ReadTIFFFromString16(const std::string &s, uint32_t &cols, uint32_t &lines) {
|
||||
uint32_t rows_per_string = 0;
|
||||
|
||||
std::vector<uint16_t> ret;
|
||||
|
||||
uint16_t elem_size;
|
||||
|
||||
std::istringstream input_TIFF_stream(s);
|
||||
TIFF* tiff = TIFFStreamOpen("MemTIFF", &input_TIFF_stream);
|
||||
TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &cols); // get the width of the image
|
||||
TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &lines); // get the height of the image
|
||||
TIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &elem_size); // get the size of the channels
|
||||
TIFFGetField(tiff, TIFFTAG_ROWSPERSTRIP, &rows_per_string);
|
||||
|
||||
if (elem_size != 16)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "Only 16-bit format supported");
|
||||
|
||||
ret.resize(cols * lines);
|
||||
|
||||
if (cols * sizeof(uint16_t) != TIFFScanlineSize(tiff))
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFScanlineSize mismatch");
|
||||
|
||||
for (int i = 0; i < lines; i++) {
|
||||
if (TIFFReadScanline(tiff, ret.data() + i * cols, i, 0) < 0)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFReadScanline error");
|
||||
}
|
||||
|
||||
TIFFClose(tiff);
|
||||
return ret;
|
||||
}
|
||||
@@ -4,9 +4,12 @@
|
||||
#define JUNGFRAUJOCH_WRITETIFF_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
std::string WriteTIFFToString(void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed = false);
|
||||
void WriteTIFFToFile(const std::string &filename, void *buff, size_t cols, size_t lines, size_t elem_size,
|
||||
bool is_signed = false);
|
||||
std::vector<uint32_t> ReadTIFFFromString32(const std::string& s, uint32_t &cols, uint32_t &lines);
|
||||
std::vector<uint16_t> ReadTIFFFromString16(const std::string& s, uint32_t &cols, uint32_t &lines);
|
||||
|
||||
#endif //JUNGFRAUJOCH_WRITETIFF_H
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "WriteJPEG.h"
|
||||
#include "WriteTIFF.h"
|
||||
#include "JFJochJPEG.h"
|
||||
#include "JFJochTIFF.h"
|
||||
#include "../common/JFJochException.h"
|
||||
#include "../common/DiffractionGeometry.h"
|
||||
|
||||
@@ -192,7 +192,16 @@ void PreviewImage::AddResolutionRing(std::vector<uint8_t> &rgb_image, float d) c
|
||||
}
|
||||
}
|
||||
|
||||
void PreviewImage::Configure(const DiffractionExperiment &in_experiment) {
|
||||
void PreviewImage::AddUserMask(std::vector<uint8_t> &rgb_image) const {
|
||||
for (int y = 0; y < ypixel; y++) {
|
||||
for (int x = 0; x < xpixel; x++) {
|
||||
if (user_mask[y * xpixel + x] != 0)
|
||||
color_pixel(rgb_image, x, y, gray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PreviewImage::Configure(const DiffractionExperiment &in_experiment, const PixelMask& mask) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
experiment = in_experiment;
|
||||
@@ -205,6 +214,9 @@ void PreviewImage::Configure(const DiffractionExperiment &in_experiment) {
|
||||
pixel_is_signed = experiment.IsPixelSigned();
|
||||
uncompressed_image.resize(experiment.GetPixelsNum() * experiment.GetPixelDepth());
|
||||
memset(uncompressed_image.data(), 0, experiment.GetPixelsNum() * experiment.GetPixelDepth());
|
||||
user_mask = mask.GetUserMask(experiment);
|
||||
if (user_mask.size() != experiment.GetPixelsNum())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "User pixel mask size incorrect");
|
||||
}
|
||||
|
||||
void PreviewImage::Configure() {
|
||||
@@ -259,6 +271,10 @@ std::string PreviewImage::GenerateJPEG(const PreviewJPEGSettings &settings) cons
|
||||
v = GenerateRGB<int32_t>((int32_t *) uncompressed_image.data(), xpixel * ypixel,
|
||||
settings.saturation_value, INT32_MIN);
|
||||
}
|
||||
|
||||
if (settings.show_user_mask)
|
||||
AddUserMask(v);
|
||||
|
||||
if (settings.show_spots)
|
||||
AddSpots(v);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "../common/SpotToSave.h"
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
#include "../common/PixelMask.h"
|
||||
#include "PreviewCounter.h"
|
||||
|
||||
struct PreviewJPEGSettings {
|
||||
@@ -16,6 +17,7 @@ struct PreviewJPEGSettings {
|
||||
bool show_spots = true;
|
||||
bool show_roi = false;
|
||||
bool show_indexed = false;
|
||||
bool show_user_mask = false;
|
||||
std::optional<float> resolution_ring;
|
||||
};
|
||||
|
||||
@@ -31,6 +33,7 @@ class PreviewImage {
|
||||
|
||||
bool initialized = false;
|
||||
std::vector<uint8_t> uncompressed_image;
|
||||
std::vector<uint32_t> user_mask;
|
||||
std::vector<SpotToSave> spots;
|
||||
size_t xpixel = 0;
|
||||
size_t ypixel = 0;
|
||||
@@ -43,6 +46,7 @@ class PreviewImage {
|
||||
void AddBeamCenter(std::vector<uint8_t> &rgb_image) const;
|
||||
void AddSpots(std::vector<uint8_t> &rgb_image) const;
|
||||
void AddROI(std::vector<uint8_t> &rgb_image) const;
|
||||
void AddUserMask(std::vector<uint8_t> &rgb_image) const;
|
||||
PreviewCounter counter;
|
||||
|
||||
void color_pixel(std::vector<unsigned char>& ret, int64_t xpixel, int64_t ypixel, const rgb &color) const;
|
||||
@@ -52,7 +56,7 @@ class PreviewImage {
|
||||
|
||||
public:
|
||||
explicit PreviewImage(std::chrono::microseconds period = std::chrono::seconds(1));
|
||||
void Configure(const DiffractionExperiment& experiment);
|
||||
void Configure(const DiffractionExperiment& experiment, const PixelMask& mask);
|
||||
void Configure();
|
||||
void UpdateImage(const void *uncompressed_image, const std::vector<SpotToSave> &spots);
|
||||
[[nodiscard]] std::string GenerateJPEG(const PreviewJPEGSettings& settings) const;
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <tiffio.h>
|
||||
#include <tiffio.hxx>
|
||||
#include <sstream>
|
||||
|
||||
#include "WriteTIFF.h"
|
||||
#include "../common/JFJochException.h"
|
||||
|
||||
|
||||
void WriteTIFF(TIFF *tiff, void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
|
||||
|
||||
if (tiff == nullptr)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFStreamOpen error");
|
||||
|
||||
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, cols); // set the width of the image
|
||||
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, lines); // set the height of the image
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 1); // set number of channels per pixel
|
||||
TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, elem_size * 8); // set the size of the channels
|
||||
TIFFSetField(tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE); // setc ompression to LZW
|
||||
TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, lines);
|
||||
if (is_signed)
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT);
|
||||
else
|
||||
TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
|
||||
|
||||
if (TIFFWriteEncodedStrip(tiff, 0, buff, cols * lines * elem_size) < 0)
|
||||
throw JFJochException(JFJochExceptionCategory::TIFFGeneratorError, "TIFFWriteEncodedStrip error");
|
||||
}
|
||||
|
||||
std::string WriteTIFFToString(void *buff, size_t cols, size_t lines, size_t elem_size, bool is_signed) {
|
||||
std::stringstream os;
|
||||
|
||||
TIFF *tiff = TIFFStreamOpen("x", (std::ostream *) &os);
|
||||
WriteTIFF(tiff, buff, cols, lines, elem_size, is_signed);
|
||||
TIFFClose(tiff);
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
void WriteTIFFToFile(const std::string &filename, void *buff, size_t cols, size_t lines, size_t elem_size,
|
||||
bool is_signed) {
|
||||
TIFF *tiff = TIFFOpen(filename.c_str(), "w");
|
||||
|
||||
WriteTIFF(tiff, buff, cols, lines, elem_size, is_signed);
|
||||
|
||||
TIFFClose(tiff);
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "../common/PixelMask.h"
|
||||
|
||||
JFJochReceiver::JFJochReceiver(const DiffractionExperiment& in_experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration *in_calibration,
|
||||
AcquisitionDeviceGroup &in_aq_device,
|
||||
ImagePusher &in_image_sender,
|
||||
@@ -37,7 +38,8 @@ JFJochReceiver::JFJochReceiver(const DiffractionExperiment& in_experiment,
|
||||
spot_finding_settings(in_spot_finding_settings),
|
||||
preview_image(in_preview_image),
|
||||
preview_image_indexed(in_preview_image_indexed),
|
||||
serialmx_filter(experiment)
|
||||
serialmx_filter(experiment),
|
||||
user_mask_raw_coord(pixel_mask.GetUserMask(experiment, false))
|
||||
{
|
||||
if (experiment.GetDetectorSetup().GetDetectorType() == DetectorType::JUNGFRAU)
|
||||
calibration = in_calibration;
|
||||
@@ -62,7 +64,7 @@ JFJochReceiver::JFJochReceiver(const DiffractionExperiment& in_experiment,
|
||||
logger.Info("Data acquisition devices ready");
|
||||
|
||||
if (experiment.GetImageNum() > 0) {
|
||||
SendStartMessage();
|
||||
SendStartMessage(pixel_mask);
|
||||
SendCalibration();
|
||||
|
||||
for (int i = 0; i < experiment.GetImageNum(); i++)
|
||||
@@ -90,7 +92,7 @@ JFJochReceiver::JFJochReceiver(const DiffractionExperiment& in_experiment,
|
||||
logger.Info("Receiving data started");
|
||||
}
|
||||
|
||||
void JFJochReceiver::SendStartMessage() {
|
||||
void JFJochReceiver::SendStartMessage(const PixelMask &pixel_mask) {
|
||||
if (!push_images_to_writer)
|
||||
return;
|
||||
|
||||
@@ -101,11 +103,6 @@ void JFJochReceiver::SendStartMessage() {
|
||||
message.az_int_bin_to_q = az_int_mapping.GetBinToQ();
|
||||
message.write_master_file = true;
|
||||
|
||||
PixelMask pixel_mask(experiment);
|
||||
|
||||
if (calibration)
|
||||
pixel_mask.LoadDetectorBadPixelMask(calibration->CalculateMask(), 1);
|
||||
|
||||
std::vector<uint32_t> nexus_mask;
|
||||
nexus_mask = pixel_mask.GetMask(experiment);
|
||||
|
||||
@@ -180,6 +177,10 @@ void JFJochReceiver::AcquireThread(uint16_t data_stream) {
|
||||
std::vector<float> tmp(RAW_MODULE_SIZE);
|
||||
for (int m = 0; m < experiment.GetModulesNum(data_stream); m++) {
|
||||
CalcSpotFinderResolutionMap(tmp.data(), experiment, m_offset + m);
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
if (user_mask_raw_coord[(m_offset + m) * RAW_MODULE_SIZE + i] != 0)
|
||||
tmp[i] = 0.0f;
|
||||
}
|
||||
acquisition_device[data_stream].InitializeSpotFinderResolutionMap(tmp.data(), m);
|
||||
|
||||
CalcAzIntCorrRawCoord(tmp.data(), experiment, m_offset + m);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "../common/ThreadSafeFIFO.h"
|
||||
#include "../common/NUMAHWPolicy.h"
|
||||
#include "../common/SendBufferControl.h"
|
||||
#include "../common/PixelMask.h"
|
||||
|
||||
#include "../image_analysis/StrongPixelSet.h"
|
||||
#include "../image_analysis/AzimuthalIntegrationMapping.h"
|
||||
@@ -113,6 +114,8 @@ class JFJochReceiver {
|
||||
|
||||
LossyFilter serialmx_filter;
|
||||
|
||||
std::vector<uint32_t> user_mask_raw_coord;
|
||||
|
||||
void AcquireThread(uint16_t data_stream);
|
||||
void FrameTransformationThread(uint32_t threadid);
|
||||
void Cancel(const JFJochException &e);
|
||||
@@ -121,10 +124,11 @@ class JFJochReceiver {
|
||||
SpotFindingSettings GetSpotFindingSettings();
|
||||
void UpdateMaxImage(uint64_t image_number);
|
||||
void UpdateMaxDelay(uint64_t delay);
|
||||
void SendStartMessage();
|
||||
void SendStartMessage(const PixelMask &pixel_mask);
|
||||
void SendCalibration();
|
||||
public:
|
||||
JFJochReceiver(const DiffractionExperiment& experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration *calibration,
|
||||
AcquisitionDeviceGroup &acquisition_devices,
|
||||
ImagePusher &image_pusher,
|
||||
|
||||
@@ -23,15 +23,15 @@ JFJochReceiverPlots::JFJochReceiverPlots(const DiffractionExperiment &experiment
|
||||
void JFJochReceiverPlots::Add(const DataMessage &msg, uint64_t file_number, const AzimuthalIntegrationProfile &profile) {
|
||||
bkg_estimate.AddElement(msg.number, msg.bkg_estimate);
|
||||
spot_count.AddElement(msg.number, msg.spots.size());
|
||||
spot_count_in_rings.AddElement(msg.number, msg.spot_count_in_rings);
|
||||
|
||||
saturated_pixels.AddElement(msg.number, msg.saturated_pixel_count);
|
||||
error_pixels.AddElement(msg.number, msg.error_pixel_count);
|
||||
strong_pixels.AddElement(msg.number, msg.strong_pixel_count);
|
||||
|
||||
image_collection_efficiency.AddElement(msg.number, msg.image_collection_efficiency);
|
||||
if (msg.receiver_aq_dev_delay)
|
||||
receiver_delay.AddElement(msg.number, msg.receiver_aq_dev_delay.value());
|
||||
if (msg.receiver_free_send_buf)
|
||||
receiver_free_send_buf.AddElement(msg.number, msg.receiver_free_send_buf.value());
|
||||
receiver_delay.AddElement(msg.number, msg.receiver_aq_dev_delay);
|
||||
receiver_free_send_buf.AddElement(msg.number, msg.receiver_free_send_buf);
|
||||
|
||||
indexing_solution.AddElement(msg.number, msg.indexing_result);
|
||||
indexing_solution_per_time_point.Add(file_number, msg.indexing_result);
|
||||
@@ -39,11 +39,8 @@ void JFJochReceiverPlots::Add(const DataMessage &msg, uint64_t file_number, cons
|
||||
az_int_profile += profile;
|
||||
az_int_profile_per_time_point.at(file_number) += profile;
|
||||
|
||||
if (msg.xfel_pulse_id)
|
||||
xfel_pulse_id.AddElement(msg.number, msg.xfel_pulse_id.value());
|
||||
|
||||
if (msg.xfel_event_code)
|
||||
xfel_event_code.AddElement(msg.number, msg.xfel_event_code.value());
|
||||
xfel_pulse_id.AddElement(msg.number, msg.xfel_pulse_id);
|
||||
xfel_event_code.AddElement(msg.number, msg.xfel_event_code);
|
||||
|
||||
for (const auto &[key, value] : msg.roi) {
|
||||
if (roi_sum.contains(key) && roi_sum[key])
|
||||
@@ -69,7 +66,15 @@ MultiLinePlot JFJochReceiverPlots::GetPlots(const PlotRequest &request) {
|
||||
case PlotType::RadInt:
|
||||
return az_int_profile.GetPlot();
|
||||
case PlotType::SpotCount:
|
||||
return spot_count.GetMeanPlot(nbins);
|
||||
tmp = spot_count.GetMeanPlot(nbins);
|
||||
tmp.at(0).title = "Spots (crystal)";
|
||||
ret.emplace_back(tmp.at(0));
|
||||
|
||||
tmp = spot_count_in_rings.GetMeanPlot(nbins);
|
||||
tmp.at(0).title = "Spots (rings)";
|
||||
ret.emplace_back(tmp.at(0));
|
||||
|
||||
return ret;
|
||||
case PlotType::IndexingRate:
|
||||
return indexing_solution.GetMeanPlot(nbins);
|
||||
case PlotType::BkgEstimate:
|
||||
|
||||
@@ -18,6 +18,7 @@ class JFJochReceiverPlots {
|
||||
|
||||
StatusVector<float> bkg_estimate;
|
||||
StatusVector<uint64_t> spot_count;
|
||||
StatusVector<uint64_t> spot_count_in_rings;
|
||||
StatusVector<uint64_t> indexing_solution;
|
||||
StatusVector<uint64_t> saturated_pixels;
|
||||
StatusVector<uint64_t> error_pixels;
|
||||
|
||||
@@ -45,18 +45,21 @@ std::optional<JFJochReceiverStatus> JFJochReceiverService::GetStatus() {
|
||||
return {};
|
||||
}
|
||||
|
||||
void JFJochReceiverService::Start(const DiffractionExperiment &experiment, const JFCalibration *calibration) {
|
||||
void JFJochReceiverService::Start(const DiffractionExperiment &experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration *calibration) {
|
||||
std::unique_lock ul_state(state_mutex); // unique lock, as it will destroy and create receiver object
|
||||
if (state != ReceiverState::Idle)
|
||||
throw JFJochException(JFJochExceptionCategory::WrongDAQState, "Receiver not idle, cannot start");
|
||||
|
||||
try {
|
||||
preview_image.Configure(experiment);
|
||||
preview_image_indexed.Configure(experiment);
|
||||
preview_image.Configure(experiment, pixel_mask);
|
||||
preview_image_indexed.Configure(experiment, pixel_mask);
|
||||
|
||||
// Thanks to properties of unique_ptr, starting new measurement will call destructor of JFJochReceiver, which will
|
||||
// ensure that everything was rolled back
|
||||
receiver = std::make_unique<JFJochReceiver>(experiment, calibration,
|
||||
receiver = std::make_unique<JFJochReceiver>(experiment, pixel_mask,
|
||||
calibration,
|
||||
aq_devices, image_pusher,
|
||||
logger, nthreads, numa_policy,
|
||||
spot_finding_settings,
|
||||
|
||||
@@ -40,7 +40,9 @@ public:
|
||||
void LoadInternalGeneratorImage(const DiffractionExperiment& experiment,
|
||||
const std::vector<uint16_t> &raw_expected_image,
|
||||
uint64_t image_number);
|
||||
void Start(const DiffractionExperiment &experiment, const JFCalibration *calibration);
|
||||
void Start(const DiffractionExperiment &experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration *calibration);
|
||||
void Cancel(bool silent);
|
||||
JFJochReceiverOutput Stop();
|
||||
void SetSpotFindingSettings(const SpotFindingSettings& settings);
|
||||
|
||||
@@ -54,6 +54,8 @@ bool JFJochReceiverTest(JFJochReceiverOutput &output, Logger &logger,
|
||||
size_t send_buf_size_MiB) {
|
||||
|
||||
JFCalibration calib = GeneratePedestalCalibration(x);
|
||||
PixelMask mask(x);
|
||||
mask.LoadDetectorBadPixelMask(calib.CalculateMask());
|
||||
|
||||
int64_t image_number = x.GetImageNum() - 1;
|
||||
|
||||
@@ -75,7 +77,7 @@ bool JFJochReceiverTest(JFJochReceiverOutput &output, Logger &logger,
|
||||
settings.max_pix_per_spot = 200;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(x, &calib);
|
||||
service.Start(x, mask, &calib);
|
||||
output = service.Stop();
|
||||
|
||||
bool no_errors = true;
|
||||
|
||||
@@ -345,6 +345,7 @@ TEST_CASE("CBORSerialize_Image", "[CBOR]") {
|
||||
.image = image,
|
||||
.image_collection_efficiency = 0.11,
|
||||
.spots = spots,
|
||||
.spot_count_in_rings = 157,
|
||||
.bkg_estimate = 12.345f,
|
||||
.indexing_result = 1,
|
||||
.adu_histogram = {3, 4, 5, 8},
|
||||
@@ -401,6 +402,7 @@ TEST_CASE("CBORSerialize_Image", "[CBOR]") {
|
||||
REQUIRE(image_array.image_collection_efficiency == message.image_collection_efficiency);
|
||||
REQUIRE(image_array.user_data == message.user_data);
|
||||
REQUIRE(image_array.original_number == message.original_number);
|
||||
REQUIRE(image_array.spot_count_in_rings == message.spot_count_in_rings);
|
||||
}
|
||||
|
||||
TEST_CASE("CBORSerialize_Image_2", "[CBOR]") {
|
||||
|
||||
@@ -1513,6 +1513,7 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_count_threshol
|
||||
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
|
||||
std::vector<float> d_map(RAW_MODULE_SIZE, 3.0);
|
||||
std::vector<uint16_t> frame(RAW_MODULE_SIZE, 0);
|
||||
frame [ 1*1024 + 1] = 11;
|
||||
frame [123*1024 + 578] = 10;
|
||||
@@ -1520,14 +1521,17 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_count_threshol
|
||||
frame [ 89*1024 + 300] = 8;
|
||||
frame [300*1024 + 0] = 9;
|
||||
|
||||
for (int m = 0; m < x.GetModulesNum(); m++)
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
test.SetInternalGeneratorFrame(frame.data(), m);
|
||||
|
||||
test.InitializeSpotFinderResolutionMap(d_map.data(), m);
|
||||
}
|
||||
|
||||
SpotFindingSettings parameters{
|
||||
.signal_to_noise_threshold = 0.0,
|
||||
.photon_count_threshold = 9,
|
||||
.min_pix_per_spot = 1
|
||||
.signal_to_noise_threshold = 0.0,
|
||||
.photon_count_threshold = 9,
|
||||
.min_pix_per_spot = 1,
|
||||
.high_resolution_limit = 2.5,
|
||||
.low_resolution_limit = 3.1
|
||||
};
|
||||
test.SetSpotFinderParameters(parameters);
|
||||
|
||||
@@ -1577,14 +1581,19 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_mask", "[FPGA]
|
||||
frame [ 256*1024 + 876] = 50;
|
||||
frame [ 320*1024 + 400] = 50;
|
||||
|
||||
for (int m = 0; m < x.GetModulesNum(); m++)
|
||||
test.SetInternalGeneratorFrame(frame.data(), m);
|
||||
std::vector<float> d_map(RAW_MODULE_SIZE, 3.0);
|
||||
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
test.SetInternalGeneratorFrame(frame.data(), m);
|
||||
test.InitializeSpotFinderResolutionMap(d_map.data(), m);
|
||||
}
|
||||
|
||||
SpotFindingSettings parameters{
|
||||
.signal_to_noise_threshold = 0.0,
|
||||
.photon_count_threshold = 45,
|
||||
.min_pix_per_spot = 1
|
||||
.min_pix_per_spot = 1,
|
||||
.high_resolution_limit = 2.0,
|
||||
.low_resolution_limit = 4.0
|
||||
};
|
||||
test.SetSpotFinderParameters(parameters);
|
||||
|
||||
@@ -1616,6 +1625,8 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_min_pix_per_sp
|
||||
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
|
||||
std::vector<float> d_map(RAW_MODULE_SIZE, 3.0);
|
||||
|
||||
std::vector<uint16_t> frame(RAW_MODULE_SIZE, 0);
|
||||
frame [1*1024 + 1] = 11;
|
||||
frame [1*1024 + 2] = 10;
|
||||
@@ -1630,13 +1641,17 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_min_pix_per_sp
|
||||
frame [101*1024+200] = 12;
|
||||
frame [RAW_MODULE_SIZE - 1 - 1024] = 20;
|
||||
|
||||
for (int m = 0; m < x.GetModulesNum(); m++)
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
test.InitializeSpotFinderResolutionMap(d_map.data(), m);
|
||||
test.SetInternalGeneratorFrame(frame.data(), m);
|
||||
}
|
||||
|
||||
SpotFindingSettings parameters{
|
||||
.signal_to_noise_threshold = 0.0,
|
||||
.photon_count_threshold = 9,
|
||||
.min_pix_per_spot = 2
|
||||
.min_pix_per_spot = 2,
|
||||
.high_resolution_limit = 2.0,
|
||||
.low_resolution_limit = 4.0
|
||||
};
|
||||
test.SetSpotFinderParameters(parameters);
|
||||
|
||||
@@ -1685,9 +1700,10 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_d_min_max", "[
|
||||
frame [1024+4] = 12;
|
||||
|
||||
test.InitializeSpotFinderResolutionMap(d_map.data(), 0);
|
||||
for (int m = 0; m < x.GetModulesNum(); m++)
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
test.SetInternalGeneratorFrame(frame.data(), m);
|
||||
|
||||
test.InitializeSpotFinderResolutionMap(d_map.data(), m);
|
||||
}
|
||||
|
||||
SpotFindingSettings parameters{
|
||||
.signal_to_noise_threshold = 0.0,
|
||||
@@ -1727,6 +1743,7 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_snr_threshold"
|
||||
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
|
||||
std::vector<float> d_map(RAW_MODULE_SIZE, 3.0);
|
||||
std::vector<uint16_t> frame(RAW_MODULE_SIZE);
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
frame[i] = ((i / RAW_MODULE_COLS) + (i % RAW_MODULE_COLS)) % 2;
|
||||
@@ -1741,13 +1758,17 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_snr_threshold"
|
||||
frame [ 89*1024 + 300] = 7;
|
||||
frame [300*1024 + 5] = 3;
|
||||
|
||||
for (int m = 0; m < x.GetModulesNum(); m++)
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
test.SetInternalGeneratorFrame(frame.data(), m);
|
||||
test.InitializeSpotFinderResolutionMap(d_map.data(), m);
|
||||
}
|
||||
|
||||
SpotFindingSettings parameters{
|
||||
.signal_to_noise_threshold = 10.0,
|
||||
.photon_count_threshold = 0,
|
||||
.min_pix_per_spot = 1
|
||||
.min_pix_per_spot = 1,
|
||||
.high_resolution_limit = 2.0,
|
||||
.low_resolution_limit = 3.1
|
||||
};
|
||||
test.SetSpotFinderParameters(parameters);
|
||||
|
||||
|
||||
@@ -491,6 +491,8 @@ TEST_CASE("JFJochReceiverTest_PacketLost_Raw", "[JFJochReceiver]") {
|
||||
x.PedestalG0Frames(0).NumTriggers(1)
|
||||
.UseInternalPacketGenerator(false).ImagesPerTrigger(4).PhotonEnergy_keV(12.4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
@@ -517,7 +519,7 @@ TEST_CASE("JFJochReceiverTest_PacketLost_Raw", "[JFJochReceiver]") {
|
||||
JFJochReceiverService service(aq_devices, logger, pusher);
|
||||
service.NumThreads(nthreads);
|
||||
|
||||
service.Start(x, &calib);
|
||||
service.Start(x, pixel_mask, &calib);
|
||||
auto receiver_out = service.Stop();
|
||||
|
||||
const auto image = pusher.GetImage();
|
||||
@@ -551,6 +553,8 @@ TEST_CASE("JFJochReceiverTest_Cancel", "[JFJochReceiver]") {
|
||||
x.PedestalG0Frames(0).NumTriggers(1)
|
||||
.UseInternalPacketGenerator(false).ImagesPerTrigger(4).PhotonEnergy_keV(12.4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
@@ -570,7 +574,7 @@ TEST_CASE("JFJochReceiverTest_Cancel", "[JFJochReceiver]") {
|
||||
JFJochReceiverService service(aq_devices, logger, pusher);
|
||||
service.NumThreads(nthreads);
|
||||
|
||||
service.Start(x, &calib);
|
||||
service.Start(x, pixel_mask, &calib);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(60));
|
||||
service.Cancel(false);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "../writer/HDF5Objects.h"
|
||||
#include "../receiver/JFJochReceiverService.h"
|
||||
#include "../common/DiffractionGeometry.h"
|
||||
#include "../preview/WriteTIFF.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
#include "../common/ZMQWrappers.h"
|
||||
#include "../frame_serialize/ZMQStream2Pusher.h"
|
||||
#include "../writer/StreamWriter.h"
|
||||
@@ -26,6 +26,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index", "[JFJochReceiver]
|
||||
.FilePrefix("lyso_test").ConversionOnFPGA(false)
|
||||
.DetectorDistance_mm(75).BeamY_pxl(1136).BeamX_pxl(1090).PhotonEnergy_keV(12.4)
|
||||
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90});
|
||||
PixelMask pixel_mask(experiment);
|
||||
|
||||
// Load example image
|
||||
HDF5ReadOnlyFile data("../../tests/test_data/compression_benchmark.h5");
|
||||
@@ -64,9 +65,11 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index", "[JFJochReceiver]
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, nullptr);
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
auto receiver_out = service.Stop();
|
||||
|
||||
std::string jpeg;
|
||||
@@ -80,7 +83,8 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index", "[JFJochReceiver]
|
||||
f.write(jpeg.data(), jpeg.size());
|
||||
|
||||
CHECK(receiver_out.efficiency == 1.0);
|
||||
CHECK(receiver_out.status.indexing_rate == 1.0);
|
||||
REQUIRE(receiver_out.status.indexing_rate);
|
||||
CHECK(receiver_out.status.indexing_rate.value() == 1.0);
|
||||
CHECK(receiver_out.status.images_sent == experiment.GetImageNum());
|
||||
CHECK(!receiver_out.status.cancelled);
|
||||
|
||||
@@ -99,6 +103,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index_min_pix_2", "[JFJoc
|
||||
.FilePrefix("lyso_test_min_pix_2").ConversionOnFPGA(false)
|
||||
.DetectorDistance_mm(75).BeamY_pxl(1136).BeamX_pxl(1090).PhotonEnergy_keV(12.4)
|
||||
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90});
|
||||
PixelMask pixel_mask(experiment);
|
||||
|
||||
// Load example image
|
||||
HDF5ReadOnlyFile data("../../tests/test_data/compression_benchmark.h5");
|
||||
@@ -138,7 +143,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index_min_pix_2", "[JFJoc
|
||||
settings.max_pix_per_spot = 200;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, nullptr);
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
auto receiver_out = service.Stop();
|
||||
|
||||
std::string jpeg;
|
||||
@@ -195,6 +200,8 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_ROI", "[JFJochReceiver]") {
|
||||
.DetectorDistance_mm(75).BeamY_pxl(1136).BeamX_pxl(1090).PhotonEnergy_keV(12.4)
|
||||
.SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90});
|
||||
|
||||
PixelMask pixel_mask(experiment);
|
||||
|
||||
experiment.ROI().SetROIBox({ROIBox("roi0", 100, 120, 20,30)});
|
||||
experiment.ROI().SetROICircle({ROICircle("roi1", 500, 800, 10)});
|
||||
|
||||
@@ -242,7 +249,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_ROI", "[JFJochReceiver]") {
|
||||
JFJochReceiverService service(aq_devices, logger, pusher);
|
||||
service.NumThreads(nthreads);
|
||||
|
||||
service.Start(experiment, nullptr);
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
auto receiver_out = service.Stop();
|
||||
|
||||
std::string jpeg;
|
||||
|
||||
+12
-4
@@ -3,7 +3,7 @@
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include "../preview//WriteJPEG.h"
|
||||
#include "../preview//JFJochJPEG.h"
|
||||
#include "../preview//PreviewImage.h"
|
||||
#include "../writer/HDF5Objects.h"
|
||||
#include "../common/RawToConvertedGeometry.h"
|
||||
@@ -69,8 +69,11 @@ TEST_CASE("PreviewImage_GenerateJPEG","[JPEG]") {
|
||||
{.x = 800, .y = 1000, .indexed = false},
|
||||
{.x = 1200, .y = 500, .indexed = true}
|
||||
};
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
PreviewImage image;
|
||||
image.Configure(experiment);
|
||||
image.Configure(experiment, mask);
|
||||
|
||||
PreviewJPEGSettings preview_settings{
|
||||
.saturation_value = 5,
|
||||
@@ -126,7 +129,10 @@ TEST_CASE("PreviewImage_GenerateJPEG_ROI","[JPEG]") {
|
||||
{.x = 1200, .y = 500, .indexed = true}
|
||||
};
|
||||
PreviewImage image;
|
||||
image.Configure(experiment);
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
image.Configure(experiment, mask);
|
||||
image.UpdateImage(image_conv_2.data(), spots);
|
||||
|
||||
PreviewJPEGSettings preview_settings{
|
||||
@@ -169,9 +175,11 @@ TEST_CASE("PreviewImage_GenerateJPEG_resolution","[JPEG]") {
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
RawToConvertedGeometry(experiment, image_conv_2.data(), image_raw_geom.data());
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
std::vector<SpotToSave> spots = {};
|
||||
PreviewImage image;
|
||||
image.Configure(experiment);
|
||||
image.Configure(experiment, mask);
|
||||
image.UpdateImage(image_conv_2.data(), spots);
|
||||
|
||||
PreviewJPEGSettings preview_settings{
|
||||
|
||||
+101
-4
@@ -57,22 +57,119 @@ TEST_CASE("PixelMask_CalculateNexusMask","[PixelMask]") {
|
||||
v[2] = 1;
|
||||
v[4] = 1;
|
||||
v[5] = 1;
|
||||
v[3 * RAW_MODULE_SIZE + 780] = 1;
|
||||
|
||||
REQUIRE_NOTHROW(mask.LoadDetectorBadPixelMask(v, 2));
|
||||
REQUIRE_NOTHROW(mask.LoadDetectorBadPixelMask(v));
|
||||
|
||||
auto mask_v = mask.GetMask(experiment);
|
||||
|
||||
REQUIRE(mask_v.size() == experiment.GetPixelsNum() );
|
||||
REQUIRE(mask_v[0] == 0);
|
||||
REQUIRE(mask_v[1] == 0);
|
||||
REQUIRE(mask_v[2] == 4);
|
||||
REQUIRE(mask_v[2] == (1 << PixelMask::ErrorPixelBit));
|
||||
REQUIRE(mask_v[3] == 0);
|
||||
REQUIRE(mask_v[4] == 4);
|
||||
REQUIRE(mask_v[5] == 4);
|
||||
REQUIRE(mask_v[4] == (1 << PixelMask::ErrorPixelBit));
|
||||
REQUIRE(mask_v[5] == (1 << PixelMask::ErrorPixelBit));
|
||||
REQUIRE(mask_v[6] == 0);
|
||||
REQUIRE(mask_v[1030 * 700 + 300] == 0);
|
||||
REQUIRE(mask_v[(514+36)*1030*3 + 780 + 6] == (1 << PixelMask::ErrorPixelBit));
|
||||
}
|
||||
|
||||
TEST_CASE("PixelMask_CalculateNexusMask_GetMaskRaw","[PixelMask]") {
|
||||
DiffractionExperiment experiment(DetectorGeometry(4, 1, 8, 36, false));
|
||||
experiment.MaskModuleEdges(false).MaskChipEdges(false);
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
std::vector<uint32_t> v(4 * RAW_MODULE_SIZE, 0);
|
||||
v[2] = 1;
|
||||
v[4] = 1;
|
||||
v[5] = 1;
|
||||
v[3 * RAW_MODULE_SIZE + 780] = 1;
|
||||
|
||||
REQUIRE_NOTHROW(mask.LoadDetectorBadPixelMask(v));
|
||||
|
||||
auto mask_v = mask.GetMask(experiment, false);
|
||||
|
||||
REQUIRE(mask_v.size() == 4 * RAW_MODULE_SIZE );
|
||||
REQUIRE(mask_v[0] == 0);
|
||||
REQUIRE(mask_v[1] == 0);
|
||||
REQUIRE(mask_v[2] == (1 << PixelMask::ErrorPixelBit));
|
||||
REQUIRE(mask_v[3] == 0);
|
||||
REQUIRE(mask_v[4] == (1 << PixelMask::ErrorPixelBit));
|
||||
REQUIRE(mask_v[5] == (1 << PixelMask::ErrorPixelBit));
|
||||
REQUIRE(mask_v[6] == 0);
|
||||
|
||||
REQUIRE(mask_v[3 * RAW_MODULE_SIZE + 780] == (1 << PixelMask::ErrorPixelBit));
|
||||
}
|
||||
|
||||
TEST_CASE("PixelMask_CalculateNexusMask_UserMaskRaw","[PixelMask]") {
|
||||
DiffractionExperiment experiment(DetectorGeometry(4, 1, 8, 36, false));
|
||||
experiment.MaskModuleEdges(false).MaskChipEdges(false);
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
std::vector<uint32_t> v(4 * RAW_MODULE_SIZE, 0);
|
||||
v[2] = 1;
|
||||
v[4] = 1;
|
||||
v[5] = 1;
|
||||
|
||||
REQUIRE_NOTHROW(mask.LoadUserMask(experiment, v));
|
||||
|
||||
auto mask_v = mask.GetMask(experiment);
|
||||
|
||||
REQUIRE(mask_v.size() == experiment.GetPixelsNum() );
|
||||
REQUIRE(mask_v[0] == 0);
|
||||
REQUIRE(mask_v[1] == 0);
|
||||
REQUIRE(mask_v[2] == (1 << PixelMask::UserMaskedPixelBit));
|
||||
REQUIRE(mask_v[3] == 0);
|
||||
REQUIRE(mask_v[4] == (1 << PixelMask::UserMaskedPixelBit));
|
||||
REQUIRE(mask_v[5] == (1 << PixelMask::UserMaskedPixelBit));
|
||||
REQUIRE(mask_v[6] == 0);
|
||||
REQUIRE(mask_v[1030 * 700 + 300] == 0);
|
||||
REQUIRE(mask_v[(1030+8)*514] == (1 << PixelMask::ModuleGapPixelBit));
|
||||
|
||||
auto user_mask_v = mask.GetUserMask(experiment);
|
||||
|
||||
REQUIRE(user_mask_v.size() == experiment.GetPixelsNum() );
|
||||
REQUIRE(user_mask_v[0] == 0);
|
||||
REQUIRE(user_mask_v[1] == 0);
|
||||
REQUIRE(user_mask_v[2] == 1);
|
||||
REQUIRE(user_mask_v[3] == 0);
|
||||
REQUIRE(user_mask_v[4] == 1);
|
||||
REQUIRE(user_mask_v[5] == 1);
|
||||
REQUIRE(user_mask_v[6] == 0);
|
||||
REQUIRE(user_mask_v[1030 * 700 + 300] == 0);
|
||||
|
||||
REQUIRE(user_mask_v[(1030+8)*514] == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("PixelMask_CalculateNexusMask_UserMaskConv","[PixelMask]") {
|
||||
DiffractionExperiment experiment(DetectorGeometry(4, 1, 8, 36, false));
|
||||
experiment.MaskModuleEdges(false).MaskChipEdges(false);
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
std::vector<uint32_t> v(experiment.GetPixelsNum(), 0);
|
||||
v[1030 * 700 + 300] = 1;
|
||||
|
||||
REQUIRE_NOTHROW(mask.LoadUserMask(experiment, v));
|
||||
|
||||
auto mask_v = mask.GetMask(experiment);
|
||||
|
||||
REQUIRE(mask_v.size() == experiment.GetPixelsNum() );
|
||||
REQUIRE(mask_v[1030 * 700 + 300] == (1 << PixelMask::UserMaskedPixelBit));
|
||||
REQUIRE(mask_v[(1030+8)*514] == (1 << PixelMask::ModuleGapPixelBit));
|
||||
|
||||
auto user_mask_v = mask.GetUserMask(experiment);
|
||||
|
||||
REQUIRE(user_mask_v.size() == experiment.GetPixelsNum() );
|
||||
REQUIRE(user_mask_v[1030 * 700 + 300] == 1);
|
||||
|
||||
REQUIRE(user_mask_v[(1030+8)*514] == 0);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("PixelMask_MaskDetectorGaps","[PixelMask]") {
|
||||
DiffractionExperiment experiment(DetectorGeometry(8, 2, 8, 36, true));
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ TEST_CASE("StreamWriterTest_ZMQ","[JFJochWriter]") {
|
||||
x.FilePrefix("subdir/JFJochWriterTest").NumTriggers(1).ImagesPerTrigger(5)
|
||||
.UseInternalPacketGenerator(true).Mode(DetectorMode::Raw).PedestalG0Frames(0);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
|
||||
JFModuleGainCalibration gain;
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++)
|
||||
@@ -32,7 +34,7 @@ TEST_CASE("StreamWriterTest_ZMQ","[JFJochWriter]") {
|
||||
REQUIRE(pusher_addr.size() == 1);
|
||||
REQUIRE_NOTHROW(writer = std::make_unique<StreamWriter>(logger, pusher_addr[0]));
|
||||
CHECK (writer->GetStatistics().state == StreamWriterState::Idle);
|
||||
REQUIRE_NOTHROW(fpga_receiver_service.Start(x, nullptr));
|
||||
REQUIRE_NOTHROW(fpga_receiver_service.Start(x, pixel_mask, nullptr));
|
||||
|
||||
REQUIRE_NOTHROW(writer->Run());
|
||||
|
||||
|
||||
+26
-3
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include "../preview/WriteTIFF.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
#include "../preview/PreviewImage.h"
|
||||
#include "../writer/HDF5Objects.h"
|
||||
#include "../common/RawToConvertedGeometry.h"
|
||||
@@ -14,6 +14,25 @@ TEST_CASE("TIFFTest","[TIFF]") {
|
||||
REQUIRE_NOTHROW(WriteTIFFToString(values.data(), 1024, 512, 2));
|
||||
}
|
||||
|
||||
#include <iostream>
|
||||
|
||||
TEST_CASE("TIFFTest_Write_Read","[TIFF]") {
|
||||
std::vector<uint32_t> values(512*1024), values_out;
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
values[i] = (i * 17 + 2);
|
||||
}
|
||||
|
||||
std::string s;
|
||||
REQUIRE_NOTHROW(s = WriteTIFFToString(values.data(), 1024, 512, 4));
|
||||
uint32_t lines, cols;
|
||||
|
||||
REQUIRE_NOTHROW(values_out = ReadTIFFFromString32(s, cols, lines));
|
||||
REQUIRE(lines == 512);
|
||||
REQUIRE(cols == 1024);
|
||||
REQUIRE(values.size() == values_out.size());
|
||||
REQUIRE(memcmp(values.data(), values_out.data(), cols * lines * sizeof(uint32_t)) == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("TIFFTest_File","[TIFF]") {
|
||||
std::vector<uint16_t> values(512*1024);
|
||||
|
||||
@@ -59,9 +78,11 @@ TEST_CASE("PreviewImage_GenerateTIFF","[TIFF]") {
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
RawToConvertedGeometry(experiment, image_conv_2.data(), image_raw_geom.data());
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
std::vector<SpotToSave> spots;
|
||||
PreviewImage image;
|
||||
image.Configure(experiment);
|
||||
image.Configure(experiment, mask);
|
||||
image.UpdateImage(image_conv_2.data(), spots);
|
||||
|
||||
std::string s;
|
||||
@@ -98,9 +119,11 @@ TEST_CASE("PreviewImage_GenerateTIFFDioptas","[TIFF]") {
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
RawToConvertedGeometry(experiment, image_conv_2.data(), image_raw_geom.data());
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
std::vector<SpotToSave> spots;
|
||||
PreviewImage image;
|
||||
image.Configure(experiment);
|
||||
image.Configure(experiment, mask);
|
||||
image.UpdateImage(image_conv_2.data(), spots);
|
||||
|
||||
std::string s;
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
#include "../image_analysis/MXAnalyzer.h"
|
||||
#include "../preview/PreviewImage.h"
|
||||
#include "../receiver/LossyFilter.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
|
||||
Logger logger("jfjoch_spot_finding_test");
|
||||
|
||||
bool write_jpeg = false;
|
||||
bool write_debug = false;
|
||||
|
||||
void print_usage() {
|
||||
logger.Info("Usage ./jfjoch_spot_finding_test {options} <name of master dataset> <name of data dataset>");
|
||||
@@ -34,6 +36,8 @@ void print_usage() {
|
||||
logger.Info("-I enable indexing");
|
||||
logger.Info("-t<float> indexing tolerance (0.0-1.0)");
|
||||
logger.Info("-l<float> lossy filter probability (0.0-1.0)");
|
||||
logger.Info("-r{<int>} filter powder rings (min spots)");
|
||||
logger.Info("-g write debug images");
|
||||
logger.Info("");
|
||||
}
|
||||
|
||||
@@ -76,12 +80,14 @@ int parse_options(DiffractionExperiment& experiment,
|
||||
{"indexing_tolerance", required_argument, 0, 't'},
|
||||
{"nimages", required_argument, 0, 'n'},
|
||||
{"lossy", required_argument, 0, 'l'},
|
||||
{"filter_rings", optional_argument, 0, 'r'},
|
||||
{"debug", no_argument, 0, 'g'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
int option_index = 0;
|
||||
int opt;
|
||||
while ((opt = getopt_long(argc, argv, "c:s:o:p:d:D:j?hS:Ii:t:l:",long_options, &option_index)) != -1 ) {
|
||||
while ((opt = getopt_long(argc, argv, "c:s:o:p:d:D:j?hS:Ii:t:l:r::g",long_options, &option_index)) != -1 ) {
|
||||
switch (opt) {
|
||||
case 'j':
|
||||
write_jpeg = true;
|
||||
@@ -119,7 +125,14 @@ int parse_options(DiffractionExperiment& experiment,
|
||||
case 'l':
|
||||
experiment.DataReductionFactorSerialMX(atof(optarg));
|
||||
break;
|
||||
case '?':
|
||||
case 'r':
|
||||
settings.filter_spots_powder_ring = true;
|
||||
if (optarg != nullptr)
|
||||
settings.min_spot_count_powder_ring = atol(optarg);
|
||||
break;
|
||||
case 'g':
|
||||
write_debug = true;
|
||||
break;
|
||||
case 'h':
|
||||
print_usage();
|
||||
exit(EXIT_SUCCESS);
|
||||
@@ -209,8 +222,10 @@ int main(int argc, char **argv) {
|
||||
|
||||
MXAnalyzer analyzer(x);
|
||||
|
||||
PixelMask mask(x);
|
||||
|
||||
PreviewImage preview;
|
||||
preview.Configure(x);
|
||||
preview.Configure(x, mask);
|
||||
|
||||
uint64_t indexed_images = 0;
|
||||
|
||||
@@ -265,6 +280,33 @@ int main(int argc, char **argv) {
|
||||
static_cast<float>(indexed_images) / static_cast<float>(i+1) * 100.0f);
|
||||
}
|
||||
fileset.reset();
|
||||
|
||||
if (write_debug) {
|
||||
std::vector<float> convg(x.GetPixelsNum());
|
||||
std::vector<int32_t> convg_u32(x.GetPixelsNum());
|
||||
|
||||
if (!analyzer.GetCPUMean().empty()) {
|
||||
RawToConvertedGeometry(x, convg.data(), analyzer.GetCPUMean().data());
|
||||
for (int i = 0; i < convg.size(); i++)
|
||||
convg_u32[i] = std::lround(convg[i] * 10.0f);
|
||||
WriteTIFFToFile("spot_finding_mean.tiff", convg_u32.data(), x.GetXPixelsNum(), x.GetYPixelsNum(), 4, true);
|
||||
}
|
||||
|
||||
if (!analyzer.GetCPUStdDev().empty()) {
|
||||
RawToConvertedGeometry(x, convg.data(), analyzer.GetCPUStdDev().data());
|
||||
for (int i = 0; i < convg.size(); i++)
|
||||
convg_u32[i] = std::lround(convg[i] * 10.0f);
|
||||
WriteTIFFToFile("spot_finding_stddev.tiff", convg_u32.data(), x.GetXPixelsNum(), x.GetYPixelsNum(), 4, true);
|
||||
}
|
||||
|
||||
if (!analyzer.GetCPUStrongPixel().empty()) {
|
||||
RawToConvertedGeometry(x, convg_u32.data(), analyzer.GetCPUStrongPixel().data());
|
||||
WriteTIFFToFile("spot_finding_strong_pixel.tiff", convg_u32.data(), x.GetXPixelsNum(), x.GetYPixelsNum(), 4, true);
|
||||
}
|
||||
|
||||
WriteTIFFToFile("spot_finding_original_image.tiff", original_image.data(), x.GetXPixelsNum(), x.GetYPixelsNum(), 2, true);
|
||||
}
|
||||
|
||||
if (settings.indexing)
|
||||
logger.Info("Indexing rate: {:0.1f}%", static_cast<float>(indexed_images) / static_cast<float>(nimages) * 100.0f);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ void HDF5DataFilePluginMX::OpenFile(HDF5File &data_file, const DataMessage &msg)
|
||||
strong_pixel_count.reserve(RESERVE_IMAGES);
|
||||
indexed.reserve(RESERVE_IMAGES);
|
||||
indexed_lattice.reserve(9 * RESERVE_IMAGES);
|
||||
spot_count_rings.reserve(RESERVE_IMAGES);
|
||||
}
|
||||
|
||||
void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number) {
|
||||
@@ -33,6 +34,9 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number)
|
||||
strong_pixel_count.resize(max_image_number + 1);
|
||||
indexed.resize(max_image_number + 1);
|
||||
indexed_lattice.resize((max_image_number + 1) * 9);
|
||||
|
||||
if (msg.spot_count_in_rings)
|
||||
spot_count_rings.resize(max_image_number + 1);
|
||||
}
|
||||
|
||||
uint32_t spot_cnt = std::min(msg.spots.size(), max_spots);
|
||||
@@ -46,6 +50,9 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number)
|
||||
npeaks[image_number] = spot_cnt;
|
||||
strong_pixel_count[image_number] = msg.strong_pixel_count;
|
||||
indexed[image_number] = msg.indexing_result;
|
||||
if (msg.spot_count_in_rings)
|
||||
spot_count_rings[image_number] = msg.spot_count_in_rings.value();
|
||||
|
||||
if (msg.indexing_lattice.size() == 9) {
|
||||
for (int i = 0; i < 9; i++)
|
||||
indexed_lattice[image_number * 9 + i] = msg.indexing_lattice[i];
|
||||
@@ -64,6 +71,9 @@ void HDF5DataFilePluginMX::WriteFinal(HDF5File &data_file) {
|
||||
data_file.SaveVector("/entry/MX/strongPixels", strong_pixel_count);
|
||||
}
|
||||
|
||||
if (!spot_count_rings.empty())
|
||||
data_file.SaveVector("/entry/MX/nPeaksRingFiltered", spot_count_rings);
|
||||
|
||||
if (!indexed.empty())
|
||||
data_file.SaveVector("/entry/MX/imageIndexed", indexed);
|
||||
if (!indexed_lattice.empty())
|
||||
|
||||
@@ -15,7 +15,7 @@ class HDF5DataFilePluginMX : public HDF5DataFilePlugin {
|
||||
|
||||
std::vector<uint32_t> npeaks;
|
||||
std::vector<uint32_t> strong_pixel_count;
|
||||
|
||||
std::vector<uint32_t> spot_count_rings;
|
||||
// indexing
|
||||
std::vector<uint8_t> indexed;
|
||||
std::vector<float> indexed_lattice;
|
||||
|
||||
Reference in new issue
Block a user