Hardware Autofocus Plan#
Ways to describe a hardware-based autofocus plan.
AutoFocusPlan
#
Base class for hardware autofocus plans.
Attributes:
Name | Type | Description |
---|---|---|
autofocus_device_name |
str | None
|
Optional name of the offset motor device. If |
autofocus_motor_offset |
float | None
|
Before autofocus is performed, the autofocus motor should be moved to this offset, if applicable. (Not all autofocus devices have an offset motor.) If None, the autofocus motor should not be moved. |
as_action() -> HardwareAutofocus
#
Return a useq.HardwareAutofocus
for this autofocus plan.
event(event: MDAEvent) -> Optional[MDAEvent]
#
Return an autofocus useq.MDAEvent
if autofocus should be performed.
The z position of the new useq.MDAEvent
is also updated if a relative
zplan is provided since autofocus shuld be performed on the home z stack
position.
should_autofocus(event: MDAEvent) -> bool
#
Method that must be implemented by a subclass.
Should return True if autofocus should be performed (see
useq.AxesBasedAF
).
AxesBasedAF
#
Autofocus plan that performs autofocus when any of the specified axes change.
Attributes:
Name | Type | Description |
---|---|---|
axes |
Tuple[str, ...]
|
Tuple of axis label to use for hardware autofocus. At every event in which
any axis in this tuple is change, autofocus will be performed. For example,
if |
Source code in src/useq/_hardware_autofocus.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
should_autofocus(event: MDAEvent) -> bool
#
Return True
if autofocus should be performed at this event.
Will return True
if any of the axes specified in axes
have changed from the
previous event.
Source code in src/useq/_hardware_autofocus.py
77 78 79 80 81 82 83 84 85 86 87 |
|