GoniometerAxis: Transformation is based on angle, not image number
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 12m32s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 13m30s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 13m45s
Build Packages / Generate python client (push) Successful in 13s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m58s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 14m5s
Build Packages / Build documentation (push) Successful in 30s
Build Packages / build:rpm (rocky8) (push) Successful in 14m12s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 14m41s
Build Packages / build:rpm (rocky9) (push) Successful in 14m47s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m26s
Build Packages / Unit tests (push) Successful in 51m37s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 12m32s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 13m30s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 13m45s
Build Packages / Generate python client (push) Successful in 13s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m58s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 14m5s
Build Packages / Build documentation (push) Successful in 30s
Build Packages / build:rpm (rocky8) (push) Successful in 14m12s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 14m41s
Build Packages / build:rpm (rocky9) (push) Successful in 14m47s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m26s
Build Packages / Unit tests (push) Successful in 51m37s
This commit is contained in:
@@ -120,9 +120,7 @@ std::vector<double> GoniometerAxis::GetAngleContainerEnd(int64_t max_image_numbe
|
||||
return angle_container;
|
||||
}
|
||||
|
||||
RotMatrix GoniometerAxis::GetTransformation(int64_t image_number) const {
|
||||
// Transformation goes back from rotated to "start"
|
||||
auto angle_deg = GetAngle_deg(image_number);
|
||||
RotMatrix GoniometerAxis::GetTransformationAngle(float angle_deg) const {
|
||||
auto angle_rad = angle_deg / 180.0f * static_cast<float>(M_PI);
|
||||
return {angle_rad, axis};
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
[[nodiscard]] std::vector<double> GetAxisVector() const;
|
||||
|
||||
[[nodiscard]] RotMatrix GetTransformation(int64_t image_number) const;
|
||||
[[nodiscard]] RotMatrix GetTransformationAngle(float angle_deg) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -29,8 +29,10 @@ IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(Data
|
||||
|
||||
// get rotated lattice
|
||||
auto gon = experiment.GetGoniometer();
|
||||
if (gon)
|
||||
outcome.lattice_candidate = result->lattice.Multiply(gon->GetTransformation(-msg.number));
|
||||
if (gon) {
|
||||
const float angle_deg = gon->GetAngle_deg(msg.number) + gon->GetWedge_deg() / 2.0f;
|
||||
outcome.lattice_candidate = result->lattice.Multiply(gon->GetTransformationAngle(-angle_deg));
|
||||
}
|
||||
|
||||
outcome.experiment.BeamX_pxl(result->geom.GetBeamX_pxl())
|
||||
.BeamY_pxl(result->geom.GetBeamY_pxl())
|
||||
|
||||
@@ -114,7 +114,8 @@ std::optional<RotationIndexerResult> RotationIndexer::ProcessImage(int64_t image
|
||||
if (!axis_)
|
||||
return {};
|
||||
|
||||
const auto rot = axis_->GetTransformation(image);
|
||||
const float angle_deg = axis_->GetAngle_deg(image) + axis_->GetWedge_deg() / 2.0f;
|
||||
const auto rot = axis_->GetTransformationAngle(angle_deg);
|
||||
|
||||
if (!indexing_tried && image >= last_accumulated_image + image_stride) {
|
||||
v_.reserve(v_.size() + spots.size());
|
||||
|
||||
@@ -429,7 +429,8 @@ bool XtalOptimizerInternal(XtalOptimizerData &data,
|
||||
Coord recip = data.geom.DetectorToRecip(pt.x, pt.y);
|
||||
|
||||
if (data.axis) {
|
||||
auto rot = data.axis->GetTransformation(pt.image);
|
||||
const float angle_deg = data.axis->GetAngle_deg(pt.image) + data.axis->GetWedge_deg() / 2.0f;
|
||||
auto rot = data.axis->GetTransformationAngle(angle_deg);
|
||||
recip = rot * recip;
|
||||
|
||||
Eigen::Matrix3d Rg;
|
||||
|
||||
@@ -53,7 +53,8 @@ TEST_CASE("RotationIndexer") {
|
||||
for (int img = 0; img < 50; ++img) {
|
||||
std::vector<SpotToSave> spots;
|
||||
// For a rotated image, per-image lattice is obtained as Multiply(rot.transpose())
|
||||
const RotMatrix rot = axis.GetTransformation(img);
|
||||
const float angle_deg = axis.GetAngle_deg(img) + axis.GetWedge_deg() / 2.0f;
|
||||
const RotMatrix rot = axis.GetTransformationAngle(angle_deg);
|
||||
const CrystalLattice latt_img = latt_base.Multiply(rot.transpose());
|
||||
|
||||
const auto n = prediction.Calc(exp_i, latt_img, prediction_settings);
|
||||
|
||||
@@ -576,7 +576,8 @@ TEST_CASE("XtalOptimizer_rotation") {
|
||||
// Predict reflections for images at 0-30 deg.
|
||||
for (int img = 0; img < 10; ++img) {
|
||||
// For a rotated image, per-image lattice is obtained as Multiply(rot.transpose())
|
||||
const RotMatrix rot = axis.GetTransformation(img);
|
||||
const float angle_deg = axis.GetAngle_deg(img) + axis.GetWedge_deg() / 2.0f;
|
||||
const RotMatrix rot = axis.GetTransformationAngle(angle_deg);
|
||||
const CrystalLattice latt_img = latt_base.Multiply(rot.transpose());
|
||||
|
||||
const auto n = prediction.Calc(exp_i, latt_img, prediction_settings);
|
||||
|
||||
Reference in New Issue
Block a user