pylabrobot.revvity.celigo.Celigo.execute#

async Celigo.execute(plan: ScanPlan, *, on_frame: Callable[[FrameResult], Awaitable[None]] | None = None, initial_brightfield_z_mm: float | None = None, retain_frames: bool = True, before_frame: Callable[[PlannedFrame], Awaitable[None]] | None = None) → ScanResult#

Execute a compiled scan plan, optionally reporting each completed frame.

Parameters:
  • plan (ScanPlan) – Plan compiled for the current instrument configuration.

  • on_frame (Callable[[FrameResult], Awaitable[None]] | None) – Async callback awaited after each acquisition and illumination cleanup, before the next frame or stage move. Exceptions and cancellation propagate to the caller and stop execution of the remaining plan.

  • initial_brightfield_z_mm (float | None) – Brightfield focus seed in millimeters for each block, with channel offsets applied. None uses the plan’s seed or calibrated focus. When autofocus is requested, its result sets the focus for subsequent frames in that block.

  • retain_frames (bool) – Keep images in the returned ScanResult. False requires on_frame and releases each image after the callback, keeping image memory bounded.

  • before_frame (Callable[[PlannedFrame], Awaitable[None]] | None) – Async callback after stage positioning and before each acquisition. It can check instrument state or stop execution by raising an exception.

Returns:

Acquired frames when retain_frames is true, and elapsed time including callbacks.

Raises:
  • TypeError – plan is not a ScanPlan.

  • ValueError – The plan does not match the configuration or references an unknown block.

Return type:

ScanResult