camacq.plugins.api package

Microscope API specific modules.

class camacq.plugins.api.Api[source]

Bases: object

Represent the microscope API.

property name: str

Return the name of the API.

async send(command: Any, **kwargs: Any) Any[source]

Send a command to the microscope API.

Parameters:

command (str) – The command to send.

async send_many(commands: list[Any], **kwargs: Any) None[source]

Send multiple commands to the microscope API.

Parameters:

commands (list) – A list of commands to send.

async start_imaging() None[source]

Send a command to the microscope to start the imaging.

async stop_imaging() None[source]

Send a command to the microscope to stop the imaging.

class camacq.plugins.api.CommandEvent(data: dict[str, Any] | None = None)[source]

Bases: Event

An event received from the API.

Notify with this event when a command is received via API.

property command: str | None

str: Return the command string.

event_type: ClassVar[str] = 'command_event'
class camacq.plugins.api.ImageEvent(data: dict[str, Any] | None = None)[source]

Bases: Event

An event received from the API.

Notify with this event when an image is saved via API.

property channel_id: int | None

int: Return channel id of the image.

event_type: ClassVar[str] = 'image_event'
property field_x: int | None

int: Return x coordinate of the well of the image.

property field_y: int | None

int: Return y coordinate of the well of the image.

property path: str

str: Return absolute path to the image.

property plate_name: str | None

str: Return plate name of the image.

property well_x: int | None

int: Return x coordinate of the well of the image.

property well_y: int | None

int: Return y coordinate of the well of the image.

property z_slice_id: int | None

int: Return z index of the image.

class camacq.plugins.api.StartCommandEvent(data: dict[str, Any] | None = None)[source]

Bases: CommandEvent

An event received from the API.

Notify with this event when imaging starts via API.

event_type: ClassVar[str] = 'start_command_event'
class camacq.plugins.api.StopCommandEvent(data: dict[str, Any] | None = None)[source]

Bases: CommandEvent

An event received from the API.

Notify with this event when imaging stops via API.

event_type: ClassVar[str] = 'stop_command_event'
camacq.plugins.api.register_api(center: Center, api: Api) None[source]

Register api.

async camacq.plugins.api.setup_module(center: Center, config: dict[str, Any]) None[source]

Set up the microscope API package.

Parameters:
  • center (Center instance) – The Center instance.

  • config (dict) – The config dict.

camacq.plugins.api.validate_commands(value: Any) list[Any][source]

Validate a template string via JSON.