Commit dc7147e1 authored by vertighel's avatar vertighel
Browse files

Viewer: render /png at 512 px like the WebSocket preview

The canvas is painted both by the fits-preview push (512 px) and by the
REST /png refresh triggered by the camera telemetry (256 px). With a
camera loop running the two alternated, and the 256 px render looked
like a frame with a coarser binning every few images.

Co-Authored-By: default avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 159153e4
Loading
Loading
Loading
Loading
Loading
+5 −2
Changes for noctua/api/fits_image.py: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Endpoints
GET /info
    JSON metadata: shape, dtype, auto-range percentiles.
GET /png?vmin=&vmax=
    PNG rendered with Viridis, longest side capped at 256 px.
    PNG rendered with Viridis, longest side capped at 512 px.
GET /panoramic?vmin=&vmax=&max_px=
    Small PNG thumbnail (longest side ≤ *max_px*, default 256).
GET /tile?cx=&cy=&rx=&ry=
@@ -62,7 +62,10 @@ CAMERAS_INI = PACKAGE_ROOT / 'config' / 'cameras.ini'
cameras_cfg = configparser.ConfigParser()
cameras_cfg_mtime = None

_PNG_MAX_PX = 256
# Same size as the WebSocket preview (web/stream.py _PREVIEW_PX): both
# paint the same canvas, and a smaller REST render looks like a coarser
# binning when it alternates with the preview.
_PNG_MAX_PX = 512


def get_cameras_cfg() -> configparser.ConfigParser: