Files
Jungfraujoch/image_analysis/beam_stop
leonarski_fandClaude Opus 5 a7ed4e2d34 beam stop: a bright ring is not a beam stop
Inside the stop a whole ring is blocked, so its own median is blocked too and the per-pixel
comparison has nothing to work with. The walk that covers that case declared a ring to be inside the
stop when its background fell below a third of the LARGEST background of any ring further out - and
on a sample whose background peaks in a strong ring away from the beam, the ordinary background
inside that ring is legitimately below a third of the peak. The walk then runs out to the ring and
returns a filled disk of good detector: on one corpus dataset 16 % of the area, with diffraction
rings plainly visible inside the disk it masked, and on another 2.5 %.

The defect predates the branch; what changed is that the flood from the beam centre used to discard
the disk whenever its seeds landed on invalid pixels, which is how the first of those two datasets
came back with an empty mask instead of a wrong one. Dropping that anchor was right, and it made
this visible.

A ring is now compared against what this detector's background typically is - the median over the
rings the walk is willing to judge - which is robust to a bright ring and to a corner ring of a
handful of pixels alike, and is less code. Evaluated over 151 corpus datasets: the number returning
a disk larger than 0.2 % of the detector falls from 12 to 3, the two pathological cases collapse
(radius 974 -> 68 px and 188 -> 12 px), and genuine stops move by a few pixels at most (152 -> 132,
122 -> 120, 70 -> 64). The new test fails on the old walk and passes on this one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-13 07:36:57 +02:00
..
2026-08-25 08:21:39 +02:00
2026-08-25 08:21:39 +02:00