v1.0.0-rc.113 #19
@@ -987,7 +987,8 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input) {
|
||||
if (i.bkg.has_value())
|
||||
tmp.setBkg(i.bkg.value());
|
||||
|
||||
std::optional<uint64_t> pixel_sum;
|
||||
if (i.angle_deg.has_value())
|
||||
tmp.setAngle(i.angle_deg.value());
|
||||
if (i.pixel_sum.has_value())
|
||||
tmp.setPixelSum(i.pixel_sum.value());
|
||||
if (i.max_viable_pixel.has_value())
|
||||
|
||||
@@ -27,6 +27,8 @@ Scan_result_images_inner::Scan_result_images_inner()
|
||||
m_NxIsSet = false;
|
||||
m_Ny = 0L;
|
||||
m_NyIsSet = false;
|
||||
m_Angle = 0.0f;
|
||||
m_AngleIsSet = false;
|
||||
m_Bkg = 0.0f;
|
||||
m_BkgIsSet = false;
|
||||
m_Spots = 0L;
|
||||
@@ -78,7 +80,7 @@ bool Scan_result_images_inner::validate(std::stringstream& msg, const std::strin
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Scan_result_images_inner" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -100,6 +102,9 @@ bool Scan_result_images_inner::operator==(const Scan_result_images_inner& rhs) c
|
||||
((!nyIsSet() && !rhs.nyIsSet()) || (nyIsSet() && rhs.nyIsSet() && getNy() == rhs.getNy())) &&
|
||||
|
||||
|
||||
((!angleIsSet() && !rhs.angleIsSet()) || (angleIsSet() && rhs.angleIsSet() && getAngle() == rhs.getAngle())) &&
|
||||
|
||||
|
||||
((!bkgIsSet() && !rhs.bkgIsSet()) || (bkgIsSet() && rhs.bkgIsSet() && getBkg() == rhs.getBkg())) &&
|
||||
|
||||
|
||||
@@ -161,6 +166,8 @@ void to_json(nlohmann::json& j, const Scan_result_images_inner& o)
|
||||
j["nx"] = o.m_Nx;
|
||||
if(o.nyIsSet())
|
||||
j["ny"] = o.m_Ny;
|
||||
if(o.angleIsSet())
|
||||
j["angle"] = o.m_Angle;
|
||||
if(o.bkgIsSet())
|
||||
j["bkg"] = o.m_Bkg;
|
||||
if(o.spotsIsSet())
|
||||
@@ -208,6 +215,11 @@ void from_json(const nlohmann::json& j, Scan_result_images_inner& o)
|
||||
j.at("ny").get_to(o.m_Ny);
|
||||
o.m_NyIsSet = true;
|
||||
}
|
||||
if(j.find("angle") != j.end())
|
||||
{
|
||||
j.at("angle").get_to(o.m_Angle);
|
||||
o.m_AngleIsSet = true;
|
||||
}
|
||||
if(j.find("bkg") != j.end())
|
||||
{
|
||||
j.at("bkg").get_to(o.m_Bkg);
|
||||
@@ -336,6 +348,23 @@ void Scan_result_images_inner::unsetNy()
|
||||
{
|
||||
m_NyIsSet = false;
|
||||
}
|
||||
float Scan_result_images_inner::getAngle() const
|
||||
{
|
||||
return m_Angle;
|
||||
}
|
||||
void Scan_result_images_inner::setAngle(float const value)
|
||||
{
|
||||
m_Angle = value;
|
||||
m_AngleIsSet = true;
|
||||
}
|
||||
bool Scan_result_images_inner::angleIsSet() const
|
||||
{
|
||||
return m_AngleIsSet;
|
||||
}
|
||||
void Scan_result_images_inner::unsetAngle()
|
||||
{
|
||||
m_AngleIsSet = false;
|
||||
}
|
||||
float Scan_result_images_inner::getBkg() const
|
||||
{
|
||||
return m_Bkg;
|
||||
|
||||
@@ -83,6 +83,13 @@ public:
|
||||
bool nyIsSet() const;
|
||||
void unsetNy();
|
||||
/// <summary>
|
||||
/// Rotation angle associated with the image
|
||||
/// </summary>
|
||||
float getAngle() const;
|
||||
void setAngle(float const value);
|
||||
bool angleIsSet() const;
|
||||
void unsetAngle();
|
||||
/// <summary>
|
||||
/// Background estimate
|
||||
/// </summary>
|
||||
float getBkg() const;
|
||||
@@ -199,6 +206,8 @@ protected:
|
||||
bool m_NxIsSet;
|
||||
int64_t m_Ny;
|
||||
bool m_NyIsSet;
|
||||
float m_Angle;
|
||||
bool m_AngleIsSet;
|
||||
float m_Bkg;
|
||||
bool m_BkgIsSet;
|
||||
int64_t m_Spots;
|
||||
|
||||
@@ -1388,6 +1388,10 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Cell position in Y for grid scan
|
||||
angle:
|
||||
type: number
|
||||
format: float
|
||||
description: Rotation angle associated with the image
|
||||
bkg:
|
||||
type: number
|
||||
format: float
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -18,6 +18,7 @@ struct ScanResultElem {
|
||||
|
||||
std::optional<int64_t> x;
|
||||
std::optional<int64_t> y;
|
||||
std::optional<float> angle_deg;
|
||||
|
||||
std::optional<uint64_t> pixel_sum;
|
||||
std::optional<int64_t> max_viable_pixel;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
ScanResultGenerator::ScanResultGenerator(const DiffractionExperiment &experiment) {
|
||||
grid_scan = experiment.GetGridScan();
|
||||
goniometer_axis = experiment.GetGoniometer();
|
||||
if (grid_scan)
|
||||
v.resize(grid_scan->GetNElem());
|
||||
else
|
||||
@@ -24,6 +25,8 @@ void ScanResultGenerator::Add(const DataMessage &message) {
|
||||
if (grid_scan) {
|
||||
v[image_number].x = grid_scan->GetElementPosX_step(message.number);
|
||||
v[image_number].y = grid_scan->GetElementPosY_step(message.number);
|
||||
} else if (goniometer_axis) {
|
||||
v[image_number].angle_deg = goniometer_axis->GetAngle_deg(message.number);
|
||||
}
|
||||
|
||||
v[image_number].number = message.number;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
class ScanResultGenerator {
|
||||
mutable std::mutex m;
|
||||
std::optional<GridScanSettings> grid_scan;
|
||||
std::optional<GoniometerAxis> goniometer_axis;
|
||||
|
||||
std::vector<ScanResultElem> v;
|
||||
std::string file_prefix;
|
||||
public:
|
||||
|
||||
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
||||
**number** | **int** | Detector image number for a given cell |
|
||||
**nx** | **int** | Cell position in X for grid scan | [optional]
|
||||
**ny** | **int** | Cell position in Y for grid scan | [optional]
|
||||
**angle** | **float** | Rotation angle associated with the image | [optional]
|
||||
**bkg** | **float** | Background estimate | [optional]
|
||||
**spots** | **int** | Spot count | [optional]
|
||||
**spots_low_res** | **int** | Spot count in low resolution range | [optional]
|
||||
|
||||
@@ -24,6 +24,10 @@ export type scan_result = {
|
||||
* Cell position in Y for grid scan
|
||||
*/
|
||||
ny?: number;
|
||||
/**
|
||||
* Rotation angle associated with the image
|
||||
*/
|
||||
angle?: number;
|
||||
/**
|
||||
* Background estimate
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user