Merge rc167 into the detection-score branch

Both lanes added a per-image scalar to the same eleven files, so every conflict was two
additions competing for one line. All were resolved by keeping both, with three that needed
more than that:

- ScanResultGenerator: rc167 changed the per-image float vectors to resize(n, NAN) so a frame
  that never arrived does not read back as a real 0. v_protein_score and v_ice_score are exactly
  that case - 0 is a real answer ("nothing detected here") - so they take the NAN default too.
- HDF5MetadataSource: rc167 established that NaN in a stored per-image array means "no value" and
  the optional must come back absent. The two detection scores now follow it, which they did not
  before the merge; without the guard a missing score would come back as a NaN that a threshold
  would silently compare against.
- CBORTest: designated initialisers must follow member declaration order, so spindle_blind_fraction
  precedes the two scores in the DataMessage aggregate.

Verified after the merge that every CBOR key that is encoded is also decoded (198 encoded keys,
one intentional exception: the "type" discriminator), that both lanes' fields survive in the
writer, the reader, the plots and the API, and that a stored file still round-trips.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
2026-09-08 00:13:51 +02:00
co-authored by Claude Opus 5
283 changed files with 10689 additions and 1732 deletions
+7 -1
View File
@@ -271,7 +271,9 @@ inline void CBOR_ENC(CborEncoder &encoder, const Reflection& r) {
CBOR_ENC(mapEncoder, "sigma", r.sigma);
CBOR_ENC(mapEncoder, "image", r.image_number);
CBOR_ENC(mapEncoder, "rp", r.dist_ewald);
CBOR_ENC(mapEncoder, "rlp", r.rlp);
CBOR_ENC(mapEncoder, "rlp", r.prescaling_corr);
CBOR_ENC(mapEncoder, "qe", r.qe_corr);
CBOR_ENC(mapEncoder, "flight", r.flight_corr);
CBOR_ENC(mapEncoder, "partiality", r.partiality);
CBOR_ENC(mapEncoder, "zeta", r.zeta);
CBOR_ENC(mapEncoder, "image_scale_corr", r.image_scale_corr);
@@ -801,6 +803,8 @@ void CBORStream2Serializer::SerializeSequenceEnd(const EndMessage& message) {
CBOR_ENC(mapEncoder, "max_receiver_delay", message.max_receiver_delay);
CBOR_ENC(mapEncoder, "indexing_rate", message.indexing_rate);
CBOR_ENC(mapEncoder, "bkg_estimate", message.bkg_estimate);
CBOR_ENC(mapEncoder, "spindle_blind_fraction", message.spindle_blind_fraction);
CBOR_ENC(mapEncoder, "spindle_lost_unique_fraction", message.spindle_lost_unique_fraction);
CBOR_ENC(mapEncoder, "rotation_lattice_type", message.rotation_lattice_type);
if (message.rotation_lattice.has_value())
@@ -824,6 +828,7 @@ void CBORStream2Serializer::SerializeSequenceEnd(const EndMessage& message) {
CBOR_ENC(mapEncoder, "v_ice_score", message.v_ice_score);
CBOR_ENC(mapEncoder, "protein_score", message.protein_score);
CBOR_ENC(mapEncoder, "ice_score", message.ice_score);
CBOR_ENC(mapEncoder, "v_spindle_blind_fraction", message.v_spindle_blind_fraction);
CBOR_ENC(mapEncoder, "ice_ring_score", message.ice_ring_score);
CBOR_ENC(mapEncoder, "ice_ring_score_mean", message.ice_ring_score_mean);
CBOR_ENC(mapEncoder, "spot_count_ice_control", message.spot_count_ice_control);
@@ -924,6 +929,7 @@ void CBORStream2Serializer::SerializeImageInternal(CborEncoder &mapEncoder, cons
CBOR_ENC(mapEncoder, "ice_ring_score", message.ice_ring_score);
CBOR_ENC(mapEncoder, "protein_score", message.protein_score);
CBOR_ENC(mapEncoder, "ice_score", message.ice_score);
CBOR_ENC(mapEncoder, "spindle_blind_fraction", message.spindle_blind_fraction);
CBOR_ENC(mapEncoder, "adu_histogram", message.adu_histogram);
CBOR_ENC(mapEncoder, "roi_integrals", message.roi);
CBOR_ENC(mapEncoder, "beam_corr_x", message.beam_corr_x);