Replace the free functions BraggIntegrate2D/ProfileIntegrate2D with the BraggIntegrationEngine (CPU/GPU) as the live integrator. - IndexAndRefine no longer holds the integrator: ProcessImage takes a per-worker BraggIntegrateFn callback (ProcessImage is called concurrently by the shared IndexAndRefine, so the stateful engine must not be a member). - WithoutFPGA/jfjoch_process: owns a GPU engine when a GPU is present, else CPU, and passes the GPU-resident preprocessed buffer so integration runs on-device. - AfterFPGA: forces CPU and integrates straight off the assembled CompressedImage via a templated per-pixel sampler - only the reflection-disk pixels are read, no whole-image copy (the FPGA host runs up to 36 GB/s). Sampler maps type min/max to INT32_MIN/INT32_MAX on read; special/saturation only, no +/-1 band. - Remove BraggIntegrate2D/ProfileIntegrate2D and their test; keep IntegratorMode. Prediction: buffer up to 20000 candidates but return the 10000 closest to the Ewald sphere (deterministic partial_sort on |dist_ewald|, hkl tiebreak) instead of the GPU atomic-fill order. Serialized output stays <=10000, so the frame transport headroom and its CBOR guard are unchanged. integration_model exposed via OpenAPI (bragg_integration_settings schema, /config/bragg_integration PUT/GET, added to jfjoch_settings and jfjoch_statistics) and the frontend (BraggIntegrationSettings dropdown). Regenerated C++/TS clients and redoc. Validated old-vs-new on all 18 /data/rotation_test crystals: indexing rate and space group bit-identical; ISa/CC identical on 16/18 (one improved, EcwtAL500 ISa 0.0->6.7); new CompressedImage-vs-buffer and GPU-vs-CPU parity tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
123 lines
4.2 KiB
C++
123 lines
4.2 KiB
C++
/**
|
|
* Jungfraujoch
|
|
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0-rc.156
|
|
* Contact: filip.leonarski@psi.ch
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
#include "Integration_model.h"
|
|
#include "Helpers.h"
|
|
#include <stdexcept>
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Integration_model::Integration_model()
|
|
{
|
|
|
|
}
|
|
|
|
void Integration_model::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Integration_model::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Integration_model::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Integration_model" : pathPrefix;
|
|
|
|
|
|
if (m_value == Integration_model::eIntegration_model::INVALID_VALUE_OPENAPI_GENERATED)
|
|
{
|
|
success = false;
|
|
msg << _pathPrefix << ": has no value;";
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Integration_model::operator==(const Integration_model& rhs) const
|
|
{
|
|
return
|
|
getValue() == rhs.getValue()
|
|
|
|
;
|
|
}
|
|
|
|
bool Integration_model::operator!=(const Integration_model& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Integration_model& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
|
|
switch (o.getValue())
|
|
{
|
|
case Integration_model::eIntegration_model::INVALID_VALUE_OPENAPI_GENERATED:
|
|
j = "INVALID_VALUE_OPENAPI_GENERATED";
|
|
break;
|
|
case Integration_model::eIntegration_model::PROFILEGAUSSIAN:
|
|
j = "ProfileGaussian";
|
|
break;
|
|
case Integration_model::eIntegration_model::PROFILEEMPIRICAL:
|
|
j = "ProfileEmpirical";
|
|
break;
|
|
case Integration_model::eIntegration_model::BOXSUM:
|
|
j = "BoxSum";
|
|
break;
|
|
}
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Integration_model& o)
|
|
{
|
|
|
|
auto s = j.get<std::string>();
|
|
if (s == "ProfileGaussian") {
|
|
o.setValue(Integration_model::eIntegration_model::PROFILEGAUSSIAN);
|
|
}
|
|
else if (s == "ProfileEmpirical") {
|
|
o.setValue(Integration_model::eIntegration_model::PROFILEEMPIRICAL);
|
|
}
|
|
else if (s == "BoxSum") {
|
|
o.setValue(Integration_model::eIntegration_model::BOXSUM);
|
|
} else {
|
|
std::stringstream ss;
|
|
ss << "Unexpected value " << s << " in json"
|
|
<< " cannot be converted to enum of type"
|
|
<< " Integration_model::eIntegration_model";
|
|
throw std::invalid_argument(ss.str());
|
|
}
|
|
|
|
}
|
|
|
|
Integration_model::eIntegration_model Integration_model::getValue() const
|
|
{
|
|
return m_value;
|
|
}
|
|
void Integration_model::setValue(Integration_model::eIntegration_model value)
|
|
{
|
|
m_value = value;
|
|
}
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|