sidescanpy.viz.contact_sheet#

Thumbnail grid and boxed-context QA rendering for sonar targets.

Uses the same percentile-based amplitude auto-scaling convention as viz/waterfall.py (default 1st/99th percentile) so target imagery reads consistently with other sidescanpy figures.

2026 rshomberg@uri.edu

Contents

contact_sheet

Grid of thumbnails, one per image, captioned individually.

render_target_context

Full ping-window image with a box drawn at target's computed position, for visual QA of the localization formula.

sidescanpy.viz.contact_sheet.contact_sheet(images, captions, *, boxes=None, box_size=(40.0, 40.0), ncols=6, cmap='copper', vmin_pct=1.0, vmax_pct=99.0, cell_size=(2.2, 2.2), suptitle=None)#

Grid of thumbnails, one per image, captioned individually.

Each image is auto-scaled independently (its own percentile range) — appropriate for a review grid of unrelated crops, not for comparing absolute intensity across targets.

Parameters:
imageslist of 2D arrays

One per target.

captionslist of str

Same length as images.

boxeslist of list of Target, optional

Same length as images if given — every target to draw a box for on that thumbnail (.sample/extra_attributes["window_row"], the same convention bbox_from_center/COCO/YOLO already use). An empty list for an entry draws no box on that thumbnail. Omit entirely for a plain, unboxed grid (e.g. no-target negative samples, which have nothing to box by definition).

box_sizetuple, default (40.0, 40.0)

Shared placeholder box size — same meaning as everywhere else in this codebase (no measured target extent exists in any source catalog seen so far).

ncolsint, default 6

Grid columns; rows are computed to fit.

sidescanpy.viz.contact_sheet.render_target_context(window, target, *, box_size=(40.0, 40.0), cmap='copper', vmin_pct=1.0, vmax_pct=99.0, title=None, coordinate_system='pixel', resolution_m=None)#

Full ping-window image with a box drawn at target’s computed position, for visual QA of the localization formula.

box_size is a fixed placeholder (width, height in samples/pings – or, under a real-meters coordinate_system, output pixels of that resample, i.e. box_size * resolution_m meters) around the computed center — no real measured target dimensions exist in the source catalog (LengthMeters/WidthMeters unpopulated), so this is explicitly not derived from anything measured.

coordinate_system – one of "pixel" (default, native sample/ping space – export.py’s raw/radiometric render levels), "geometric" (extract_geometric_window’s local along/across-track meters frame), or "georef" (extract_georef_window’s northing/easting meters frame) – controls only the axis labels below; window itself must already be built in that coordinate system by the caller. Found real (2026-09-28, user report): this always labeled axes “Sample”/”Ping” even when --with-context rendered a geometric/georef real-meters resample (added 2026-09-28 to follow --render-level’s own coordinate choice) – correct-looking image, mislabeled axes.