file format: the ice ring ratio is stored and sent under its own name, and the retired one is still read
Completes the rename the C++ identifiers already carried. Producers now emit ice_ring_ratio / ice_ring_ratio_mean over CBOR and write /entry/MX/iceRingRatio and iceRingRatioMean; both readers accept the retired ice_ring_score / iceRingScore spellings as well, so nothing that exists on disk or on the wire stops being readable. The REST plot_type gains ice_ring_ratio and KEEPS ice_ring_score, both mapping to the same plot, so no client breaks. --ice-min-score is deliberately unchanged: it is a threshold on the ratio, it is the one surface a user types, and this program has 91 long options and no aliases. The fallback is not a formality. rugnux --mode scale reads the stored per-image value to reproduce the ice gate the writing run applied, and an unread dataset does not fail loudly - ice_n == 0 sends the gate to its fail-safe branch, "ice present". Demonstrated on a clean crystal whose stored file uses the old names: with the fallback the gate reads 1.06 against a 1.50 threshold and skips ice handling; with the fallback removed the same file has 272056 of 1032493 reflections (26%) excluded from the scale fit, and ISa, R_meas, I/sigma, SIGANO and both error-model terms all move. That is a silent change to merged intensities on files already written, which is why the two new CBOR test cases were each checked to FAIL when their fallback is taken out rather than merely to pass. Verified: same binary on an old-name and a new-name copy of one file gives byte-identical .hkl, .mtz and unmerged .mtz and an identical report; a file written after the rename scales to the same bytes again; the master and the data-file read paths were each exercised with both spellings; and the live API serves the same plot under either name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
@@ -575,7 +575,12 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen
|
||||
dataset->indexing_result = master_file->ReadOptVector<float>("/entry/MX/imageIndexed");
|
||||
dataset->bkg_estimate = master_file->ReadOptVector<float>("/entry/MX/bkgEstimate");
|
||||
dataset->spindle_blind_fraction = master_file->ReadOptVector<float>("/entry/MX/spindleBlindFraction");
|
||||
dataset->ice_ring_ratio = master_file->ReadOptVector<float>("/entry/MX/iceRingScore");
|
||||
// Renamed from iceRingScore. Accept either for backward compatibility - a file
|
||||
// written before the rename must still read, and --mode scale reads this to
|
||||
// reproduce the ice gate the writing run applied.
|
||||
dataset->ice_ring_ratio = master_file->ReadOptVector<float>("/entry/MX/iceRingRatio");
|
||||
if (dataset->ice_ring_ratio.empty())
|
||||
dataset->ice_ring_ratio = master_file->ReadOptVector<float>("/entry/MX/iceRingScore");
|
||||
dataset->protein_score = master_file->ReadOptVector<float>("/entry/MX/proteinScore");
|
||||
dataset->ice_score = master_file->ReadOptVector<float>("/entry/MX/iceScore");
|
||||
dataset->score_beam_center_x = master_file->GetOptFloat("/entry/MX/scoreBeamCenterX");
|
||||
@@ -726,8 +731,11 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen
|
||||
data_file, "/entry/MX/spindleBlindFraction",
|
||||
number_of_images, fimages);
|
||||
|
||||
// Either spelling, as in the master above.
|
||||
ReadVector(dataset->ice_ring_ratio,
|
||||
data_file, "/entry/MX/iceRingScore",
|
||||
data_file,
|
||||
data_file.Exists("/entry/MX/iceRingRatio")
|
||||
? "/entry/MX/iceRingRatio" : "/entry/MX/iceRingScore",
|
||||
number_of_images, fimages);
|
||||
|
||||
ReadVector(dataset->protein_score,
|
||||
|
||||
Reference in New Issue
Block a user