rugnux: print ISa as undetermined when the error model's b is not resolved from zero
The (a, b) error-model fit already refuses to report ISa when its top intensity bin has no leverage on b. It still printed 1/b when b had leverage but came out at zero within its own error - the strongest bins scatter no more than counting statistics say (the fitted b^2 is negative and clamps to 0), or there are too few samples for the bin medians to mean anything. ISa then reports the noise in b as an I/sigma: on one low-resolution sweep consecutive merges of the same data gave ISa 0, 28, 46, 113 and 130. The standard error of b^2 is taken from the 16 bins' own scatter about the fitted line, and when b^2 is less than two standard errors above zero the merge result carries isa_resolved = false. Only what is printed follows it: the report's ISA key reads "undetermined", the summary line says so, the asymptote is not printed and the mmCIF carries "?". The fitted ISa itself is unchanged and is still what the space-group search's present-reflection cut and the refused-point-group arbitration read, so no decision moves. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -651,6 +651,30 @@ TEST_CASE("ResultReport_FittedResolutionSuppressed", "[Diagnostics]") {
|
||||
CHECK(climbs_text.find("RESOLUTION_FIT") != std::string::npos);
|
||||
}
|
||||
|
||||
// ISa of a b that is zero within its error is the noise in b; the report says undetermined, not a number.
|
||||
TEST_CASE("ResultReport_IsaUndetermined", "[Diagnostics]") {
|
||||
DiffractionExperiment x(DetJF(1));
|
||||
ProcessResult result;
|
||||
result.consensus_cell = UnitCell{.a = 79.0f, .b = 79.0f, .c = 38.0f,
|
||||
.alpha = 90.0f, .beta = 90.0f, .gamma = 90.0f};
|
||||
result.has_merge_statistics = true;
|
||||
result.merge_statistics.overall.d_max = 50.0f;
|
||||
result.merge_statistics.overall.d_min = 1.50f;
|
||||
result.merge_statistics.overall.cc_half = 0.99;
|
||||
result.error_model_a = 1.1;
|
||||
result.error_model_b = 1e-4;
|
||||
result.error_model_isa = 95.0;
|
||||
result.error_model_isa_asymptotic = 120.0;
|
||||
|
||||
const auto resolved = RenderResultReport("p", "in.h5", x, result);
|
||||
CHECK(resolved.find("\nISA= 95.00\n") != std::string::npos);
|
||||
|
||||
result.error_model_isa_resolved = false;
|
||||
const auto text = RenderResultReport("p", "in.h5", x, result);
|
||||
CHECK(text.find("\nISA= undetermined\n") != std::string::npos);
|
||||
CHECK(text.find("ISA_ASYMPTOTIC") == std::string::npos);
|
||||
}
|
||||
|
||||
// The completeness of the range where the signal is, beside the completeness of the range that was
|
||||
// written. Users compare the single overall figure against another program's and conclude the run
|
||||
// lost data, when it is the deliberately generous cut diluting the denominator - so the report says
|
||||
|
||||
Reference in New Issue
Block a user