diff --git a/rugnux/rugnux_cli.cpp b/rugnux/rugnux_cli.cpp index 5abd5ab3..93cc6914 100644 --- a/rugnux/rugnux_cli.cpp +++ b/rugnux/rugnux_cli.cpp @@ -849,7 +849,8 @@ static int RunRugnux(int argc, char **argv) { scale_fulls_arg = false; break; case OPT_DETECT_ICE_RINGS: - spot_finding_options_given = true; + // Deliberately NOT a spot-finding option for the purpose of re-finding the first-pass + // rotation spots - see where reuse_rotation_spots is decided below. if (optarg == nullptr || strcmp(optarg, "on") == 0) detect_ice_rings = true; else if (strcmp(optarg, "off") == 0) @@ -1591,6 +1592,27 @@ static int RunRugnux(int argc, char **argv) { else if (!dataset->file_detect_ice_rings.has_value()) experiment.DetectIceRings(rotation_indexing); + // First-pass rotation indexing reuses the spots stored in the file, and does NOT re-mark them - + // their ice flags are the ones the acquisition wrote. So --detect-ice-rings can only invalidate + // them when it asks for something the file did not do; matching the file is a no-op for that pass. + // Re-finding whenever the flag is merely present would swap the acquisition's spots for this + // program's own, which moves the first-pass lattice by itself: measured over the rotation battery, + // passing the semantically null --detect-ice-rings=on to files that already carry it changed the + // merged data on every crystal and lost one to indexing failure. That also made the flag impossible + // to test, since both arms of an A/B moved for a reason unrelated to ice. + // A file with no key at all is treated as "did not mark", which is what its stored spots show: + // such a dataset carries no per-spot ice flags to reuse. That is a statement about the SPOTS, not + // about the setting - which is why it stays value_or(false) even though a keyless rotation file + // now defaults to detecting ice. + if (detect_ice_rings.has_value() + && detect_ice_rings.value() != dataset->file_detect_ice_rings.value_or(false)) { + if (reuse_rotation_spots) + logger.Info("--detect-ice-rings={} differs from the spots stored in the file: re-finding " + "them for first-pass rotation indexing too", + detect_ice_rings.value() ? "on" : "off"); + reuse_rotation_spots = false; + } + // Scale-fulls refits the per-frame scale on the rotation combined fulls; on by default for rotation // data (where it lifts ISa substantially) and off for stills. --no-scale-fulls overrides. const bool scale_fulls = scale_fulls_arg.value_or(rotation_indexing);