scale/merge: what each stretch of a sweep costs the merged data, measured
Build Packages / Create release (push) Successful in 32s
Build Packages / build:viewer-tgz:cpu (push) Successful in 7m40s
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 6m54s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 7m7s
Build Packages / build:viewer-tgz:cuda (push) Successful in 8m29s
Build Packages / build:windows:nocuda (push) Successful in 16m47s
Build Packages / build:windows:cuda (push) Successful in 19m18s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 21m1s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m53s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 14m3s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 12m48s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 14m34s
Build Packages / build:rugnux:windows (push) Successful in 10m19s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 15m38s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 16m35s
Build Packages / Generate python client (push) Successful in 47s
Build Packages / Build documentation (push) Successful in 1m19s
Build Packages / build:rpm (rocky8) (push) Successful in 15m59s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 15m34s
Build Packages / build:rpm (rocky9) (push) Successful in 16m26s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m48s
Build Packages / Unit tests (push) Successful in 1h34m17s
Build Packages / Create release (push) Successful in 32s
Build Packages / build:viewer-tgz:cpu (push) Successful in 7m40s
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 6m54s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 7m7s
Build Packages / build:viewer-tgz:cuda (push) Successful in 8m29s
Build Packages / build:windows:nocuda (push) Successful in 16m47s
Build Packages / build:windows:cuda (push) Successful in 19m18s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 21m1s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m53s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 14m3s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 12m48s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 14m34s
Build Packages / build:rugnux:windows (push) Successful in 10m19s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 15m38s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 16m35s
Build Packages / Generate python client (push) Successful in 47s
Build Packages / Build documentation (push) Successful in 1m19s
Build Packages / build:rpm (rocky8) (push) Successful in 15m59s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 15m34s
Build Packages / build:rpm (rocky9) (push) Successful in 16m26s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m48s
Build Packages / Unit tests (push) Successful in 1h34m17s
The sweep-quality diagnostic says a range is weak; it cannot say whether that weakness costs anything. A 60 degree stretch of poor diffraction and a radiation damage tail look alike in scale and correlation, and on one dataset they measure -0.0758 +- 0.0005 and -0.0019: one is 150 sigma of real harm, the other is nothing once the corrections have done their work. So measure it, per batch of the sweep, as the change in CC1/2 when that batch is left out - Assmann, Brehm & Diederichs (2016) Acta Cryst. D72, 1071-1081. In the sigma-tau form, so no half-set is drawn and nothing depends on a seed; against the observed scatter of each reflection's own observations rather than the error model's sigmas, which would invert the sign and make a bad batch read as added precision; and on the 10 degree batch the damage monitor already uses, because a single frame is far below what the statistic can resolve - the precision goes as one over the root of the reflection count, and 0.1 degrees of rotation does not have the reflections. Report only. Nothing is dropped, no observation is weighted differently, and every existing key of every dataset tested is unchanged to the digit. The disposition column says merged for all of them; acting on it needs a frame attribution this code does not yet have, since a full is currently labelled with its peak frame rather than with the frames its partials came from. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GxZqDiFP3KqriBhNdcR56
This commit is contained in:
1 parent
c367e88261
commit
beae384bb7
17 files changed
+583
-62
No files matched your search
@@ -20,12 +20,20 @@ namespace {
|
||||
.reason = SweepQualityReason::CrystalOutOfBeam,
|
||||
.severity = 0.83f, .rotation_deg = 5.0f,
|
||||
.mean_relative_scale = 0.12f, .mean_relative_cc = 0.30f,
|
||||
.indexed_fraction = 0.015f});
|
||||
.indexed_fraction = 0.015f,
|
||||
.disposition = FrameDisposition::Rejected,
|
||||
.delta_cc_half = -0.0312f, .delta_cc_half_se = 0.0060f});
|
||||
out.ranges.push_back(SweepQualityRange{.first_image = 400, .last_image = 499,
|
||||
.reason = SweepQualityReason::RadiationDamage,
|
||||
.severity = 0.41f, .rotation_deg = 10.0f,
|
||||
.mean_relative_scale = 0.55f, .mean_relative_cc = 0.80f,
|
||||
.indexed_fraction = 0.62f});
|
||||
.indexed_fraction = 0.62f,
|
||||
.disposition = FrameDisposition::Downgraded,
|
||||
.delta_cc_half = 0.0011f, .delta_cc_half_se = 0.0042f});
|
||||
out.frames_merged = 450;
|
||||
out.frames_downgraded = 100;
|
||||
out.frames_rejected = 50;
|
||||
out.rejected_deg = 5.0f;
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -35,6 +43,13 @@ namespace {
|
||||
out.emplace_back(SweepQualityReasonCode(static_cast<SweepQualityReason>(r)));
|
||||
return out;
|
||||
}
|
||||
|
||||
std::vector<std::string> DispositionVocabulary() {
|
||||
std::vector<std::string> out;
|
||||
for (int d = 0; d <= static_cast<int>(FrameDisposition::Rejected); ++d)
|
||||
out.emplace_back(FrameDispositionCode(static_cast<FrameDisposition>(d)));
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("SweepQuality_ReasonVocabulary", "[Diagnostics]") {
|
||||
@@ -48,6 +63,12 @@ TEST_CASE("SweepQuality_ReasonVocabulary", "[Diagnostics]") {
|
||||
CHECK(codes[2] == "weak_diffraction");
|
||||
CHECK(codes[3] == "loss_of_centring");
|
||||
CHECK(codes[4] == "radiation_damage");
|
||||
|
||||
// The disposition vocabulary is an interface for the same reasons, and the per-image HDF5 array
|
||||
// indexes it from 0.
|
||||
CHECK(std::string(FrameDispositionCode(FrameDisposition::Merged)) == "merged");
|
||||
CHECK(std::string(FrameDispositionCode(FrameDisposition::Downgraded)) == "downgraded");
|
||||
CHECK(std::string(FrameDispositionCode(FrameDisposition::Rejected)) == "rejected");
|
||||
}
|
||||
|
||||
TEST_CASE("ResultReport_Render", "[Diagnostics]") {
|
||||
@@ -100,12 +121,26 @@ TEST_CASE("ResultReport_Render", "[Diagnostics]") {
|
||||
CHECK(dev_text.find("\nSWEEP_QUALITY_STATUS= COMPUTED\n") != std::string::npos);
|
||||
CHECK(dev_text.find("\nSWEEP_QUALITY_REASONS= no_diffraction crystal_out_of_beam weak_diffraction "
|
||||
"loss_of_centring radiation_damage\n") != std::string::npos);
|
||||
CHECK(dev_text.find("\nSWEEP_DISPOSITIONS= merged downgraded rejected\n") != std::string::npos);
|
||||
|
||||
// The disposition headline: frames AND degrees, so that re-slicing cannot move the percentage
|
||||
// without the degrees moving with it.
|
||||
CHECK(text.find("\nFRAMES_MERGED= 450\n") != std::string::npos);
|
||||
CHECK(text.find("\nFRAMES_DOWNGRADED= 100\n") != std::string::npos);
|
||||
CHECK(text.find("\nFRAMES_REJECTED= 50\n") != std::string::npos);
|
||||
CHECK(text.find("\nFRAMES_REJECTED_PCT= 8.33\n") != std::string::npos);
|
||||
CHECK(text.find("\nROTATION_REJECTED_DEG= 5.0\n") != std::string::npos);
|
||||
CHECK(text.find("600 frames / 60.0 deg; 450 merged (75.0%), 100 downgraded (16.7%)")
|
||||
!= std::string::npos);
|
||||
|
||||
// One table row per range, with the reason code verbatim.
|
||||
CHECK(text.find(" 100 149 50 5.0 crystal_out_of_beam ")
|
||||
!= std::string::npos);
|
||||
CHECK(text.find(" 400 499 100 10.0 radiation_damage ")
|
||||
!= std::string::npos);
|
||||
// ... and its disposition beside what keeping it costs the merged intensities.
|
||||
CHECK(text.find("rejected -0.0312 0.0060") != std::string::npos);
|
||||
CHECK(text.find("downgraded +0.0011 0.0042") != std::string::npos);
|
||||
|
||||
// ... and one plain-English WARNING line per range, greppable by the marker alone. They sit in
|
||||
// the SUMMARY at the top of the file now, which is what the verdict is composed from.
|
||||
@@ -115,6 +150,9 @@ TEST_CASE("ResultReport_Render", "[Diagnostics]") {
|
||||
CHECK(text.find("VERDICT=") < text.find("SWEEP_QUALITY_COUNT="));
|
||||
CHECK(text.find("\n# WARNING: Frames 100-149 out of beam (5.0 deg,") != std::string::npos);
|
||||
CHECK(text.find("\n# WARNING: Frames 400-499 radiation damage (10.0 deg,") != std::string::npos);
|
||||
CHECK(text.find("nothing of them reached the merge") != std::string::npos);
|
||||
CHECK(text.find("kept at their own reduced weight; removing them would change CC1/2 by -0.0011")
|
||||
!= std::string::npos);
|
||||
}
|
||||
|
||||
TEST_CASE("ResultReport_RenderEmpty", "[Diagnostics]") {
|
||||
@@ -184,6 +222,15 @@ TEST_CASE("SweepQuality_HDF5RoundTrip", "[HDF5][Full][Diagnostics]") {
|
||||
static_cast<uint8_t>(SweepQualityReason::CrystalOutOfBeam) + 1,
|
||||
0,
|
||||
static_cast<uint8_t>(SweepQualityReason::RadiationDamage) + 1};
|
||||
// What was DONE about them: the out-of-beam pair is dropped, the damaged tail stays in at its own
|
||||
// reduced weight, the rest merges. Indexed from 0, unlike the reason codes above.
|
||||
const std::vector<uint8_t> expected_disposition{
|
||||
static_cast<uint8_t>(FrameDisposition::Merged),
|
||||
static_cast<uint8_t>(FrameDisposition::Merged),
|
||||
static_cast<uint8_t>(FrameDisposition::Rejected),
|
||||
static_cast<uint8_t>(FrameDisposition::Rejected),
|
||||
static_cast<uint8_t>(FrameDisposition::Merged),
|
||||
static_cast<uint8_t>(FrameDisposition::Downgraded)};
|
||||
|
||||
{
|
||||
RegisterHDF5Filter();
|
||||
@@ -194,6 +241,8 @@ TEST_CASE("SweepQuality_HDF5RoundTrip", "[HDF5][Full][Diagnostics]") {
|
||||
end_message.max_image_number = x.GetImageNum();
|
||||
end_message.sweep_quality = expected;
|
||||
end_message.sweep_quality_reasons = ReasonVocabulary();
|
||||
end_message.frame_disposition = expected_disposition;
|
||||
end_message.frame_disposition_codes = DispositionVocabulary();
|
||||
|
||||
FileWriter writer(start_message);
|
||||
std::vector<int16_t> image(x.GetPixelsNum(), 42);
|
||||
@@ -214,6 +263,8 @@ TEST_CASE("SweepQuality_HDF5RoundTrip", "[HDF5][Full][Diagnostics]") {
|
||||
CHECK(dataset->sweep_quality == expected);
|
||||
// The vocabulary travels with the codes, so a consumer can name them without this source.
|
||||
CHECK(dataset->sweep_quality_reasons == ReasonVocabulary());
|
||||
CHECK(dataset->frame_disposition == expected_disposition);
|
||||
CHECK(dataset->frame_disposition_codes == DispositionVocabulary());
|
||||
}
|
||||
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
|
||||
Reference in new issue
Block a user