21a8ea51ee
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Failing after 8m56s
Build Packages / build:rpm (rocky8_nocuda) (push) Failing after 10m5s
Build Packages / build:rpm (rocky9_nocuda) (push) Failing after 11m41s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Failing after 11m39s
Build Packages / build:rpm (rocky9_sls9) (push) Failing after 11m42s
Build Packages / build:rpm (rocky8_sls9) (push) Failing after 11m45s
Build Packages / build:rpm (rocky8) (push) Failing after 11m47s
Build Packages / build:rpm (rocky9) (push) Failing after 10m21s
Build Packages / Generate python client (push) Successful in 14s
Build Packages / build:rpm (ubuntu2204) (push) Failing after 9m58s
Build Packages / Create release (push) Skipped
Build Packages / XDS test (neggia plugin) (push) Successful in 8m14s
Build Packages / Build documentation (push) Successful in 36s
Build Packages / XDS test (durin plugin) (push) Successful in 8m52s
Build Packages / build:rpm (ubuntu2404) (push) Failing after 9m4s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 9m7s
Build Packages / DIALS test (push) Successful in 11m49s
Build Packages / Unit tests (push) Successful in 1h8m58s
63 lines
2.2 KiB
C++
63 lines
2.2 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
#include "../common/GoniometerAxis.h"
|
|
#include "../common/CrystalLattice.h"
|
|
#include "../common/DiffractionGeometry.h"
|
|
#include "../common/SpotToSave.h"
|
|
#include "gemmi/symmetry.hpp"
|
|
|
|
struct XtalOptimizerData {
|
|
DiffractionGeometry geom;
|
|
CrystalLattice latt;
|
|
gemmi::CrystalSystem crystal_system = gemmi::CrystalSystem::Triclinic;
|
|
int64_t min_spots = 8;
|
|
|
|
float min_length_A = 5.0;
|
|
float max_length_A = 500.0;
|
|
float min_angle_deg = 60.0f;
|
|
float max_angle_deg = 120.0f;
|
|
|
|
bool refine_beam_center = true;
|
|
bool refine_distance_mm = false;
|
|
bool refine_detector_angles = false;
|
|
bool refine_unit_cell = true; // This refines unit cell size + angles - orientation is always refined
|
|
bool refine_rotation_axis = false;
|
|
|
|
bool index_ice_rings = true;
|
|
|
|
float max_time = 1.0;
|
|
|
|
std::optional<GoniometerAxis> axis;
|
|
|
|
// output
|
|
std::optional<double> beam_corr_x;
|
|
std::optional<double> beam_corr_y;
|
|
|
|
// For rotation only optimizer
|
|
std::optional<double> angle_corr;
|
|
std::optional<Coord> angle_axis;
|
|
};
|
|
|
|
void LatticeToRodriguesAndLengths_GS(const CrystalLattice &latt, double rod[3], double lengths[3]);
|
|
void LatticeToRodriguesAndLengths_Hex(const CrystalLattice &latt, double rod[3], double ac[3]);
|
|
void LatticeToRodriguesLengthsBeta_Mono(const CrystalLattice &latt,
|
|
double rod[3],
|
|
double lengths[3],
|
|
double &beta_rad);
|
|
|
|
CrystalLattice AngleAxisAndCellToLattice(const double rod[3],
|
|
const double lengths[3],
|
|
double alpha_rad,
|
|
double beta_rad,
|
|
double gamma_rad);
|
|
|
|
bool XtalOptimizer(XtalOptimizerData &data, const std::vector<std::vector<SpotToSave>> &spots);
|
|
bool XtalOptimizerRotationOnly(XtalOptimizerData &data, const std::vector<SpotToSave> &spots, float tolerance);
|
|
|
|
|