All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m0s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 11m2s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 11m54s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m20s
Build Packages / Generate python client (push) Successful in 24s
Build Packages / Build documentation (push) Successful in 56s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 8m51s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m9s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m53s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m21s
Build Packages / build:rpm (rocky9) (push) Successful in 9m47s
Build Packages / Unit tests (push) Successful in 1h13m38s
This is an UNSTABLE release and not recommended for production use (please use rc.111 instead). * jfjoch_broker: Improve handling of rotation indexing * jfjoch_broker: More information saved in CBOR end message (WIP) * jfjoch_writer: Save rotation indexing lattice parameters and Niggli class * jfjoch_viewer: Remove (for now) primitive cell information Reviewed-on: #19 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
442 lines
14 KiB
C++
442 lines
14 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.113
|
|
* 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 "Indexing_settings.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Indexing_settings::Indexing_settings()
|
|
{
|
|
m_Fft_max_unit_cell_A = 250.0f;
|
|
m_Fft_min_unit_cell_A = 10.0f;
|
|
m_Fft_high_resolution_A = 2.0f;
|
|
m_Fft_num_vectors = 16384L;
|
|
m_Tolerance = 0.0f;
|
|
m_Thread_count = 0L;
|
|
m_Unit_cell_dist_tolerance = 0.05f;
|
|
m_Viable_cell_min_spots = 10L;
|
|
m_Index_ice_rings = false;
|
|
m_Rotation_indexing = false;
|
|
m_Rotation_indexing_min_angular_range_deg = 20.0f;
|
|
m_Rotation_indexing_angular_stride_deg = 0.5f;
|
|
|
|
}
|
|
|
|
void Indexing_settings::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Indexing_settings::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Indexing_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Indexing_settings" : pathPrefix;
|
|
|
|
|
|
|
|
/* Fft_max_unit_cell_A */ {
|
|
const float& value = m_Fft_max_unit_cell_A;
|
|
const std::string currentValuePath = _pathPrefix + ".fftMaxUnitCellA";
|
|
|
|
|
|
if (value < static_cast<float>(50))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 50;";
|
|
}
|
|
if (value > static_cast<float>(500))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 500;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Fft_min_unit_cell_A */ {
|
|
const float& value = m_Fft_min_unit_cell_A;
|
|
const std::string currentValuePath = _pathPrefix + ".fftMinUnitCellA";
|
|
|
|
|
|
if (value < static_cast<float>(5))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 5;";
|
|
}
|
|
if (value > static_cast<float>(40))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 40;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Fft_high_resolution_A */ {
|
|
const float& value = m_Fft_high_resolution_A;
|
|
const std::string currentValuePath = _pathPrefix + ".fftHighResolutionA";
|
|
|
|
|
|
if (value < static_cast<float>(0.5))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0.5;";
|
|
}
|
|
if (value > static_cast<float>(6.0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 6.0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Fft_num_vectors */ {
|
|
const int64_t& value = m_Fft_num_vectors;
|
|
const std::string currentValuePath = _pathPrefix + ".fftNumVectors";
|
|
|
|
|
|
if (value < 128ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 128;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Tolerance */ {
|
|
const float& value = m_Tolerance;
|
|
const std::string currentValuePath = _pathPrefix + ".tolerance";
|
|
|
|
|
|
if (value < static_cast<float>(0.0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0.0;";
|
|
}
|
|
if (value > static_cast<float>(0.5))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 0.5;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Thread_count */ {
|
|
const int64_t& value = m_Thread_count;
|
|
const std::string currentValuePath = _pathPrefix + ".threadCount";
|
|
|
|
|
|
if (value < 1ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 1;";
|
|
}
|
|
if (value > 64ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 64;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Unit_cell_dist_tolerance */ {
|
|
const float& value = m_Unit_cell_dist_tolerance;
|
|
const std::string currentValuePath = _pathPrefix + ".unitCellDistTolerance";
|
|
|
|
|
|
if (value < static_cast<float>(0.00010))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0.00010;";
|
|
}
|
|
if (value > static_cast<float>(0.2001))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 0.2001;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Viable_cell_min_spots */ {
|
|
const int64_t& value = m_Viable_cell_min_spots;
|
|
const std::string currentValuePath = _pathPrefix + ".viableCellMinSpots";
|
|
|
|
|
|
if (value < 5ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 5;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Rotation_indexing_min_angular_range_deg */ {
|
|
const float& value = m_Rotation_indexing_min_angular_range_deg;
|
|
const std::string currentValuePath = _pathPrefix + ".rotationIndexingMinAngularRangeDeg";
|
|
|
|
|
|
if (value < static_cast<float>(1.0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 1.0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Rotation_indexing_angular_stride_deg */ {
|
|
const float& value = m_Rotation_indexing_angular_stride_deg;
|
|
const std::string currentValuePath = _pathPrefix + ".rotationIndexingAngularStrideDeg";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Indexing_settings::operator==(const Indexing_settings& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getAlgorithm() == rhs.getAlgorithm())
|
|
&&
|
|
|
|
(getFftMaxUnitCellA() == rhs.getFftMaxUnitCellA())
|
|
&&
|
|
|
|
(getFftMinUnitCellA() == rhs.getFftMinUnitCellA())
|
|
&&
|
|
|
|
(getFftHighResolutionA() == rhs.getFftHighResolutionA())
|
|
&&
|
|
|
|
(getFftNumVectors() == rhs.getFftNumVectors())
|
|
&&
|
|
|
|
(getTolerance() == rhs.getTolerance())
|
|
&&
|
|
|
|
(getThreadCount() == rhs.getThreadCount())
|
|
&&
|
|
|
|
(getGeomRefinementAlgorithm() == rhs.getGeomRefinementAlgorithm())
|
|
&&
|
|
|
|
(getUnitCellDistTolerance() == rhs.getUnitCellDistTolerance())
|
|
&&
|
|
|
|
(getViableCellMinSpots() == rhs.getViableCellMinSpots())
|
|
&&
|
|
|
|
(isIndexIceRings() == rhs.isIndexIceRings())
|
|
&&
|
|
|
|
(isRotationIndexing() == rhs.isRotationIndexing())
|
|
&&
|
|
|
|
(getRotationIndexingMinAngularRangeDeg() == rhs.getRotationIndexingMinAngularRangeDeg())
|
|
&&
|
|
|
|
(getRotationIndexingAngularStrideDeg() == rhs.getRotationIndexingAngularStrideDeg())
|
|
|
|
|
|
;
|
|
}
|
|
|
|
bool Indexing_settings::operator!=(const Indexing_settings& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Indexing_settings& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["algorithm"] = o.m_Algorithm;
|
|
j["fft_max_unit_cell_A"] = o.m_Fft_max_unit_cell_A;
|
|
j["fft_min_unit_cell_A"] = o.m_Fft_min_unit_cell_A;
|
|
j["fft_high_resolution_A"] = o.m_Fft_high_resolution_A;
|
|
j["fft_num_vectors"] = o.m_Fft_num_vectors;
|
|
j["tolerance"] = o.m_Tolerance;
|
|
j["thread_count"] = o.m_Thread_count;
|
|
j["geom_refinement_algorithm"] = o.m_Geom_refinement_algorithm;
|
|
j["unit_cell_dist_tolerance"] = o.m_Unit_cell_dist_tolerance;
|
|
j["viable_cell_min_spots"] = o.m_Viable_cell_min_spots;
|
|
j["index_ice_rings"] = o.m_Index_ice_rings;
|
|
j["rotation_indexing"] = o.m_Rotation_indexing;
|
|
j["rotation_indexing_min_angular_range_deg"] = o.m_Rotation_indexing_min_angular_range_deg;
|
|
j["rotation_indexing_angular_stride_deg"] = o.m_Rotation_indexing_angular_stride_deg;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Indexing_settings& o)
|
|
{
|
|
j.at("algorithm").get_to(o.m_Algorithm);
|
|
j.at("fft_max_unit_cell_A").get_to(o.m_Fft_max_unit_cell_A);
|
|
j.at("fft_min_unit_cell_A").get_to(o.m_Fft_min_unit_cell_A);
|
|
j.at("fft_high_resolution_A").get_to(o.m_Fft_high_resolution_A);
|
|
j.at("fft_num_vectors").get_to(o.m_Fft_num_vectors);
|
|
j.at("tolerance").get_to(o.m_Tolerance);
|
|
j.at("thread_count").get_to(o.m_Thread_count);
|
|
j.at("geom_refinement_algorithm").get_to(o.m_Geom_refinement_algorithm);
|
|
j.at("unit_cell_dist_tolerance").get_to(o.m_Unit_cell_dist_tolerance);
|
|
j.at("viable_cell_min_spots").get_to(o.m_Viable_cell_min_spots);
|
|
j.at("index_ice_rings").get_to(o.m_Index_ice_rings);
|
|
j.at("rotation_indexing").get_to(o.m_Rotation_indexing);
|
|
j.at("rotation_indexing_min_angular_range_deg").get_to(o.m_Rotation_indexing_min_angular_range_deg);
|
|
j.at("rotation_indexing_angular_stride_deg").get_to(o.m_Rotation_indexing_angular_stride_deg);
|
|
|
|
}
|
|
|
|
org::openapitools::server::model::Indexing_algorithm Indexing_settings::getAlgorithm() const
|
|
{
|
|
return m_Algorithm;
|
|
}
|
|
void Indexing_settings::setAlgorithm(org::openapitools::server::model::Indexing_algorithm const& value)
|
|
{
|
|
m_Algorithm = value;
|
|
}
|
|
float Indexing_settings::getFftMaxUnitCellA() const
|
|
{
|
|
return m_Fft_max_unit_cell_A;
|
|
}
|
|
void Indexing_settings::setFftMaxUnitCellA(float const value)
|
|
{
|
|
m_Fft_max_unit_cell_A = value;
|
|
}
|
|
float Indexing_settings::getFftMinUnitCellA() const
|
|
{
|
|
return m_Fft_min_unit_cell_A;
|
|
}
|
|
void Indexing_settings::setFftMinUnitCellA(float const value)
|
|
{
|
|
m_Fft_min_unit_cell_A = value;
|
|
}
|
|
float Indexing_settings::getFftHighResolutionA() const
|
|
{
|
|
return m_Fft_high_resolution_A;
|
|
}
|
|
void Indexing_settings::setFftHighResolutionA(float const value)
|
|
{
|
|
m_Fft_high_resolution_A = value;
|
|
}
|
|
int64_t Indexing_settings::getFftNumVectors() const
|
|
{
|
|
return m_Fft_num_vectors;
|
|
}
|
|
void Indexing_settings::setFftNumVectors(int64_t const value)
|
|
{
|
|
m_Fft_num_vectors = value;
|
|
}
|
|
float Indexing_settings::getTolerance() const
|
|
{
|
|
return m_Tolerance;
|
|
}
|
|
void Indexing_settings::setTolerance(float const value)
|
|
{
|
|
m_Tolerance = value;
|
|
}
|
|
int64_t Indexing_settings::getThreadCount() const
|
|
{
|
|
return m_Thread_count;
|
|
}
|
|
void Indexing_settings::setThreadCount(int64_t const value)
|
|
{
|
|
m_Thread_count = value;
|
|
}
|
|
org::openapitools::server::model::Geom_refinement_algorithm Indexing_settings::getGeomRefinementAlgorithm() const
|
|
{
|
|
return m_Geom_refinement_algorithm;
|
|
}
|
|
void Indexing_settings::setGeomRefinementAlgorithm(org::openapitools::server::model::Geom_refinement_algorithm const& value)
|
|
{
|
|
m_Geom_refinement_algorithm = value;
|
|
}
|
|
float Indexing_settings::getUnitCellDistTolerance() const
|
|
{
|
|
return m_Unit_cell_dist_tolerance;
|
|
}
|
|
void Indexing_settings::setUnitCellDistTolerance(float const value)
|
|
{
|
|
m_Unit_cell_dist_tolerance = value;
|
|
}
|
|
int64_t Indexing_settings::getViableCellMinSpots() const
|
|
{
|
|
return m_Viable_cell_min_spots;
|
|
}
|
|
void Indexing_settings::setViableCellMinSpots(int64_t const value)
|
|
{
|
|
m_Viable_cell_min_spots = value;
|
|
}
|
|
bool Indexing_settings::isIndexIceRings() const
|
|
{
|
|
return m_Index_ice_rings;
|
|
}
|
|
void Indexing_settings::setIndexIceRings(bool const value)
|
|
{
|
|
m_Index_ice_rings = value;
|
|
}
|
|
bool Indexing_settings::isRotationIndexing() const
|
|
{
|
|
return m_Rotation_indexing;
|
|
}
|
|
void Indexing_settings::setRotationIndexing(bool const value)
|
|
{
|
|
m_Rotation_indexing = value;
|
|
}
|
|
float Indexing_settings::getRotationIndexingMinAngularRangeDeg() const
|
|
{
|
|
return m_Rotation_indexing_min_angular_range_deg;
|
|
}
|
|
void Indexing_settings::setRotationIndexingMinAngularRangeDeg(float const value)
|
|
{
|
|
m_Rotation_indexing_min_angular_range_deg = value;
|
|
}
|
|
float Indexing_settings::getRotationIndexingAngularStrideDeg() const
|
|
{
|
|
return m_Rotation_indexing_angular_stride_deg;
|
|
}
|
|
void Indexing_settings::setRotationIndexingAngularStrideDeg(float const value)
|
|
{
|
|
m_Rotation_indexing_angular_stride_deg = value;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|