Files
leonarski_fandClaude Opus 5.5 62457ec5ea
Build Packages / Build documentation (push) Successful in 2m6s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 17m38s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 22m16s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 26m3s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 29m35s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m24s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 11m11s
Build Packages / Unit tests (push) Successful in 1h36m54s
Build Packages / Validation Battery (push) Successful in 56m13s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 29m38s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 30m46s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 28m56s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 28m3s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 27m26s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 25m24s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 25m42s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 20m26s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 24m25s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 30m56s
Build Packages / Generate python client (push) Successful in 27s
Build Packages / Create release (push) Successful in 9s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 9m25s
RESULT-CHANGING: -C supercell step-down on rotation runs only, not on stills
The step-down (659c0322a) ran in every FFT call with a reference cell, so also in stills geometry
refinement and per-frame indexing. A still is one frame, and the given cell there picks one crystal
form among several in the stream: with the step-down's tolerance (5 % on lengths, up to index 10) a
frame's supercell candidate came back as a neighbouring form or a noise lattice "matching" the given
cell. On a serial set with two P21 forms 4 % apart this indexed more sampled frames, moved the refined
geometry, widened the given-cell volume population from -6.3 % to -13 %, and merged ~12k frames of the
other form in (written cell drifted, twin test positive, R-free 0.29 -> 0.43). The step-down now runs only
when the run indexes by rotation; a still keeps refusing a candidate that does not match the given cell.
Measured: both forms of that set back to the numbers before 659c0322a (same frames left out, same
indexing rate and d_min); the twinned small-molecule rotation sweep given its true cell still indexes
on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQqrcrEZy6XBUCMZvyT
2026-11-01 20:25:10 +01:00

41 lines
1.5 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <vector>
#include <optional>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <Eigen/Dense>
#include "../common/CrystalLattice.h"
constexpr float REFINE_CANDIDATE_SPOT_COUNT_RATIO_THRESHOLD = 0.9f;
constexpr float REFINE_CANDIDATE_VOLUME_RATIO_THRESHOLD = 1.05f;
constexpr float REFINE_CANDIDATE_OVERLAP_RATIO_THRESHOLD = 0.4f;
constexpr float REFINE_MIN_VOLUME_EPSILON = 1e-12f;
constexpr float REFINE_MIN_REFERENCE_LENGTH_EPSILON = 1e-6f;
// Max deviation (deg) of a candidate cell angle from the reference cell angle, compared after
// folding both to the acute complement (min(x,180-x)) so the obtuse/acute setting is irrelevant.
constexpr float REFINE_ANGLE_TOLERANCE_VS_REFERENCE_DEG = 10.0f;
struct RefineParameters {
int64_t viable_cell_min_spots;
float dist_tolerance_vs_reference;
bool step_down_to_reference = false;
std::optional<UnitCell> reference_unit_cell;
float min_length_A;
float max_length_A;
float min_angle_deg;
float max_angle_deg;
float indexing_tolerance;
unsigned refine_threads = 1;
};
std::vector<CrystalLattice> Refine(const std::vector<Coord> &in_spots,
size_t nspots,
Eigen::MatrixX3<float> &oCell,
Eigen::VectorX<float> &scores,
RefineParameters &p);