rugnux: report-only supercell probe - the eight parity classes of the doubled cell
Every lattice decision counts spots or frames, and the sub-lattice's strong reflections win every count, so a crystal whose cell is doubled by a weak superstructure class (9min, 6z9g) is adopted at the half cell. This asks the question in intensities instead. On 60 frames spread over the sweep, after each frame's own integration, the 2a x 2b x 2c supercell of its primitive lattice is predicted to 3 A with the frame's own refined orientation and geometry and integrated on the same engine; the reflections are summed per parity class in two shells (20-5, 5-3 A), with a fit of intensity against partiality (I = a + b p) that separates what rocks like a Bragg reflection from what sits at the node whatever the rocking. Only the tested frames are predicted and nothing is retained, so memory is bounded (the previous prototype predicted the whole run through the merge and ran out of GPU memory). The probe's integrations are kept out of the engine's own counts, which the two-pass stencil guard reads. Results are bit-identical with and without it. REPORT ONLY - it decides nothing, because on the battery it does not yet separate a weak real class from what sits at the half-integer nodes of crystals whose cell is right. Real classes: 6z9g class 101 at 24 % of the lattice's intensity (29 % rocking), 9min 100 at 19 % (4 % rocking - its real class does not rock like the lattice either). On correct cells the largest classes reach 9-12 % raw (7n2s, 9i0a, 7os3) and 3-4 % rocking (7dkp, 7os3), and 7mzt reads 40 % / 19 % on a class the deposition does not have. The log line is the population a decision has to be calibrated on. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D1G8gJVAy6gp1K5Dz3NE5C
This commit is contained in:
1 parent
96b681e50d
commit
2b476336ae
6 files changed
+227
-8
No files matched your search
@@ -7,6 +7,7 @@
|
||||
#include "../writer/HDF5Objects.h"
|
||||
#include "../image_analysis/indexing/IndexerFactory.h"
|
||||
#include "../image_analysis/indexing/PostIndexingRefinement.h"
|
||||
#include "../image_analysis/IndexAndRefine.h"
|
||||
#include "../image_analysis/bragg_prediction/BraggPrediction.h"
|
||||
#include "../common/Logger.h"
|
||||
|
||||
@@ -757,3 +758,30 @@ TEST_CASE("FFTIndexer_ManyNoiseFrames", "[Indexing]") {
|
||||
SUCCEED(lattices << " candidate lattices from noise frames");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("FitSupercellProbe", "[SupercellProbe]") {
|
||||
// A class whose intensity is 3 at any rocking plus 40 times its partiality: the fit separates the
|
||||
// two, and the part that rocks is known to the noise the scatter about the line allows.
|
||||
SupercellProbeClass c;
|
||||
std::mt19937 rng(1);
|
||||
std::normal_distribution<double> noise(0.0, 1.0);
|
||||
for (int i = 0; i < 20000; i++) {
|
||||
const double p = (i % 100) / 100.0;
|
||||
const double I = 3.0 + 40.0 * p + noise(rng);
|
||||
c.n++;
|
||||
c.sum_i += I;
|
||||
c.sum_i_over_sigma += I;
|
||||
c.sum_p += p;
|
||||
c.sum_pp += p * p;
|
||||
c.sum_pi += p * I;
|
||||
c.sum_ii += I * I;
|
||||
}
|
||||
const SupercellProbeFit f = FitSupercellProbe(c);
|
||||
CHECK(f.b == Catch::Approx(40.0).margin(0.1));
|
||||
CHECK(f.a == Catch::Approx(3.0).margin(0.05));
|
||||
CHECK(f.b_se == Catch::Approx(1.0 / std::sqrt(20000.0 * (0.9999 / 12.0))).epsilon(0.05));
|
||||
CHECK(f.mean_p == Catch::Approx(0.495));
|
||||
|
||||
// Too few reflections to fit a line: nothing.
|
||||
CHECK(FitSupercellProbe(SupercellProbeClass{}).b == 0.0);
|
||||
}
|
||||
Reference in new issue
Block a user