Skip to content

useq.pycromanager

Convert useq objects to the event dicts used by Pycro-Manager.

Classes

Name Description
PycroManagerAxes Axes dict used by pycro-manager.
PycroManagerEvent Dict in the format expected by pycro-manager.

Functions

Name Description
to_pycromanager Convert a useq.MDAEvent or useq.MDASequence to pycro-manager form.

Attributes

Name Description
PycroAxis
PycroKey

Classes

PycroManagerAxes

Bases: TypedDict

Axes dict used by pycro-manager.

time

time: int

position

position: int

z

z: int

channel

channel: str

row

row: int

column

column: int

PycroManagerEvent

Bases: TypedDict

Dict in the format expected by pycro-manager.

x

x: float

y

y: float

z

z: float

min_start_time

min_start_time: float

config_group

config_group: list[str]

exposure

exposure: float

properties

properties: list[list[str]]

keep_shutter_open

keep_shutter_open: bool

Functions

to_pycromanager

to_pycromanager(obj: MDAEvent) -> PycroManagerEvent
to_pycromanager(obj: MDASequence) -> list[PycroManagerEvent]
to_pycromanager(
    obj: MDAEvent | MDASequence,
) -> PycroManagerEvent | list[PycroManagerEvent]

Convert a useq.MDAEvent or useq.MDASequence to pycro-manager form.

Parameters:

Name Type Description Default
obj MDAEvent | MDASequence

The event or sequence to convert.

required

Returns:

Type Description
PycroManagerEvent | list[PycroManagerEvent]

If obj is an useq.MDAEvent, returns a single pycro-manager event dict. Otherwise, returns a list of pycro-manager event dicts.

Attributes

PycroAxis

PycroAxis = Literal['time', 'position', 'z', 'channel', 'row', 'column']

PycroKey

PycroKey = Literal[
    "x", "y", "z", "exposure", "min_start_time", "keep_shutter_open"
]