Loading noctua/api/fits_image.py +8 −15 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ The key must match the URL segment ``<station>/<camera>``. # System modules import asyncio import base64 import configparser from pathlib import Path Loading Loading @@ -190,7 +189,7 @@ async def _run_loop(device, exposure: float, station: str, camera: str): try: while True: if is_stx: # STX Guider: trigger exposure, poll ready, then grab matrix → viridis # STX Guider: trigger exposure, poll ready, then grab matrix await ev.run_in_executor(None, device.start, exposure, 1) deadline = ev.time() + exposure + 30.0 while ev.time() < deadline: Loading @@ -198,19 +197,13 @@ async def _run_loop(device, exposure: float, station: str, camera: str): if ready == 1: break await asyncio.sleep(0.3) data = await ev.run_in_executor(None, lambda: device.matrix) if data is not None: await streamer._broadcast_preview(station, camera, np.squeeze(data)) else: # Mako: device.image uses array_to_png(matrix, vmin=0, vmax=255), # identical to the HTTP stream — no viridis auto-range amplification png = await ev.run_in_executor(None, lambda: device.image) if png is not None: encoded = base64.b64encode(png).decode('utf-8') await streamer.broadcaster.broadcast( "fits-preview", {"station": station, "camera": camera, "png": encoded}, ) if not is_stx: # Mako: broadcast first frame immediately, then wait before next await asyncio.sleep(exposure) except asyncio.CancelledError: pass Loading Loading
noctua/api/fits_image.py +8 −15 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ The key must match the URL segment ``<station>/<camera>``. # System modules import asyncio import base64 import configparser from pathlib import Path Loading Loading @@ -190,7 +189,7 @@ async def _run_loop(device, exposure: float, station: str, camera: str): try: while True: if is_stx: # STX Guider: trigger exposure, poll ready, then grab matrix → viridis # STX Guider: trigger exposure, poll ready, then grab matrix await ev.run_in_executor(None, device.start, exposure, 1) deadline = ev.time() + exposure + 30.0 while ev.time() < deadline: Loading @@ -198,19 +197,13 @@ async def _run_loop(device, exposure: float, station: str, camera: str): if ready == 1: break await asyncio.sleep(0.3) data = await ev.run_in_executor(None, lambda: device.matrix) if data is not None: await streamer._broadcast_preview(station, camera, np.squeeze(data)) else: # Mako: device.image uses array_to_png(matrix, vmin=0, vmax=255), # identical to the HTTP stream — no viridis auto-range amplification png = await ev.run_in_executor(None, lambda: device.image) if png is not None: encoded = base64.b64encode(png).decode('utf-8') await streamer.broadcaster.broadcast( "fits-preview", {"station": station, "camera": camera, "png": encoded}, ) if not is_stx: # Mako: broadcast first frame immediately, then wait before next await asyncio.sleep(exposure) except asyncio.CancelledError: pass Loading