XtalOptimizer: add option to refine distance mm
This commit is contained in:
@@ -458,7 +458,8 @@ bool XtalOptimizerInternal(XtalOptimizerData &data,
|
||||
if (problem.NumResidualBlocks() < data.min_spots)
|
||||
return false;
|
||||
|
||||
problem.SetParameterBlockConstant(&distance_mm);
|
||||
if (!data.refine_distance_mm)
|
||||
problem.SetParameterBlockConstant(&distance_mm);
|
||||
|
||||
if (!data.refine_beam_center) {
|
||||
problem.SetParameterBlockConstant(&beam_x);
|
||||
@@ -503,6 +504,9 @@ bool XtalOptimizerInternal(XtalOptimizerData &data,
|
||||
data.geom.BeamX_pxl(beam_x).BeamY_pxl(beam_y);
|
||||
}
|
||||
|
||||
if (data.refine_distance_mm)
|
||||
data.geom.DetectorDistance_mm(distance_mm);
|
||||
|
||||
if (data.crystal_system == gemmi::CrystalSystem::Orthorhombic)
|
||||
data.latt = AngleAxisAndLengthsToLattice(latt_vec0, latt_vec1, false);
|
||||
else if (data.crystal_system == gemmi::CrystalSystem::Tetragonal) {
|
||||
|
||||
@@ -23,6 +23,7 @@ struct XtalOptimizerData {
|
||||
float max_angle_deg = 120.0f;
|
||||
|
||||
bool refine_beam_center = true;
|
||||
bool refine_distance_mm = false;
|
||||
|
||||
// output
|
||||
std::optional<double> beam_corr_x;
|
||||
|
||||
Reference in New Issue
Block a user