Commit Graph
2 Commits
Author SHA1 Message Date
leonarski_fandClaude Opus 5 b34f7b09a3 Rugnux: retire <prefix>_image.dat, and read the diagnostic picture off the background
_image.dat carried the per-image scaling table before _plot.txt existed, and the
two were written from the same ScalingResult with six columns between them. Drop
it: the writer, its call site and its documentation entries go, and _plot.txt
gains the one column of the old file that was not already there and is not dead -
cc_n, the number of observations cc_to_merge was taken over, without which that
correlation cannot be read at the sparse end of a sweep. The old file's wedge_deg
is NOT carried over: image_scale_wedge_deg is only ever reset, never assigned, so
that column was nan on every run that ever wrote it.

_plot.txt is now written on a stills run too - it is the only per-image scaling
table there is, and the columns a sweep would fill come out nan - while the
picture stays rotation-only, as only the rotation pre-scan builds the projection
it draws. "merged" reads nan rather than 0 where no merge stands behind the run,
so --no-merge no longer looks like a sweep every frame of which was thrown out.

The picture's contrast now comes from the background instead of the peaks: the
ramp saturates at eight times the median measured pixel, where it used to
saturate at the brightest 0.1 % as the preview and the viewer do. That percentile
belongs to the Bragg spots, so the background - which is what a shadow is read
off, being a place where it is MISSING - sat in the first few per cent of the
scale and rendered as a flat white. The median is pure background whatever the
crystal, and eight times it falls between the 94th and the 99th percentile of the
projection on every set measured. Two times the median, the first value tried,
falls at the 73rd to 90th instead and floods the inner half of the detector to a
flat indigo, hiding the deficit at the other end of the scale. The colours are
untouched - they are the viewer's, from common/ColorScale.h - and only the
intensity mapping moves.

Processing is unchanged: p.hkl and p.mtz are byte-identical before and after on a
rotation sweep, and the wall clock does not move.

rugnux_stills_ab.py reads scale_G from _plot.txt instead of the retired file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nW6FNRP1bBJJ8pfHiByAT
2026-09-20 19:09:44 +02:00
leonarski_fandClaude Opus 5 4e4de57aae Rugnux: two diagnostic outputs a person can check the run by eye with
Written on every rotation run, next to the reflections, with no flag to
switch them on:

<prefix>_detector.jpg - the mean projection the beam-stop pre-scan built,
which is the very image the shadow detection tested, coloured with the
viewer's own default map from common/ColorScale.h: white-to-indigo for the
counts, grey for the module and chip gaps, coral for the detected shadow,
magenta for the rest of the pixel mask. A shadow claimed where the
background is unbroken, or a dark patch left uncoloured, is then visible at
a glance instead of being a pixel count in the log. The projection is the
one the pre-scan already holds, so no frame is read twice; the picture is
rendered there and held as JPEG bytes until the canonical pass writes it,
because on a two-pass run the pre-scan belongs to the superseded pass.

<prefix>_plot.txt - one row per processed image, whitespace-separated with
a single '#' legend line over its own columns, so gnuplot plots it as it
stands: image, spindle angle, background, resolution, spot count, scale,
sigma_M, CC to merge, and whether the image's observations reached the
merged data. A quantity nothing measured is written nan, so the columns
never shift and no row is ever left out.

sigma_M is emitted as the pipeline produces it - a per-image Gaussian
rocking width, smoothed in frame order and filled with the run median where
a frame could not be fitted - and the documentation says so rather than
presenting it as a crystal property.

<prefix>_image.dat stays: the in-tree comparison scripts read it and it
carries the smoothing wedge, which the new file does not. The docs name
_plot.txt as the one to script against.

Measured on a 1800-image rotation sweep: 29.6/30.4 s before against
29.8/30.5 s after, and the merged reflections are byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nW6FNRP1bBJJ8pfHiByAT
2026-09-20 18:45:18 +02:00