API Reference v9.1.0
Autofocusclass
Module: zaber_motion.microscopy
A generic autofocus device.
The following example illustrates how you can obtain an instance of this type:
from zaber_motion.ascii import Connection
from zaber_motion.microscopy import Microscope
connection = Connection.open_serial_port('COM3')
microscope = Microscope.find(connection)
autofocus = microscope.autofocusRelated Guides:
Index
pProperties
Constructor
Autofocus(provider_id, focus_axis, objective_turret)Creates instance of `Autofocus` based on the given provider id.
Arguments
| Name | Type | Description |
|---|---|---|
| provider_id | int | The identification of external device providing the capability. |
| focus_axis | Axis | The focus axis. |
| objective_turret | Optional[Device] | The objective turret device if the microscope has one. |
Properties
p
p
autofocus.objective_turretOptional[Device] The objective turret device if the microscope has one.p
Methods
m
m
autofocus.get_limit_max(unit = Units.NATIVE)Gets the upper motion limit for the autofocus control loop. Gets motion.tracking.limit.max setting of the focus axis.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | LengthUnits | The units of the limit. |
Return Value
float Limit value.m
autofocus.get_limit_min(unit = Units.NATIVE)Gets the lower motion limit for the autofocus control loop. Gets motion.tracking.limit.min setting of the focus axis.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | LengthUnits | The units of the limit. |
Return Value
float Limit value.m
autofocus.get_objective_parameters(objective)Returns the parameters for the autofocus objective.
Arguments
| Name | Type | Description |
|---|---|---|
| objective | int | The objective (numbered from 1) to get the parameters for. If your microscope has only one objective, use value of 1. Note that the method temporarily switches current objective to get the parameters. |
Return Value
List[NamedParameter] The parameters for the autofocus objective.m
autofocus.get_status()Returns the status of the autofocus.
Return Value
AutofocusStatus The status of the autofocus.m
m
m
autofocus.set_limit_max(limit, unit = Units.NATIVE)Sets the upper motion limit for the autofocus control loop. Use the limits to prevent the focus axis from crashing into the sample. Changes motion.tracking.limit.max setting of the focus axis.
Arguments
| Name | Type | Description |
|---|---|---|
| limit | float | The upper limit of the focus axis. |
| unit | LengthUnits | The units of the limit. |
m
autofocus.set_limit_min(limit, unit = Units.NATIVE)Sets the lower motion limit for the autofocus control loop. Use the limits to prevent the focus axis from crashing into the sample. Changes motion.tracking.limit.min setting of the focus axis.
Arguments
| Name | Type | Description |
|---|---|---|
| limit | float | The lower limit of the focus axis. |
| unit | LengthUnits | The units of the limit. |
m
autofocus.set_objective_parameters(objective, parameters)Sets the parameters for the autofocus objective. Note that the method temporarily switches current objective to set the parameters.
Arguments
| Name | Type | Description |
|---|---|---|
| objective | int | The objective (numbered from 1) to set the parameters for. If your microscope has only one objective, use value of 1. |
| parameters | List[NamedParameter] | The parameters for the autofocus objective. |
m
autofocus.start_focus_loop()Moves the focus axis continuously maintaining focus. Starts the autofocus control loop. Note that the control loop may stop if the autofocus comes out of range or a movement error occurs. Use WaitUntilIdle of the focus axis to wait for the loop to stop and handle potential errors.
m
m