class BaseStage(lt.Thing): (source)
Known subclasses: openflexure_microscope_server.things.stage.dummy.DummyStage, openflexure_microscope_server.things.stage.sangaboard.SangaboardThing
Constructor: BaseStage()
A base stage class for OpenFlexure translation stages.
This can't be used directly but should reduce boilerplate code when implementing new stages.
Note that the coordinate system used for the microscope may need to have different axis direction as those used by the underlying stage controller.
A minimal working stage must implement _hardware_move_relative and _hardware_move_absolute actions, which update the _hardware_position attribute on completion, and also should implement set_zero_position.
| Method | __init__ |
Initialise the stage. |
| Method | get |
Return a tuple containing (x, y, z) position. |
| Method | invert |
Invert the direction setting of the given axis. |
| Method | move |
Make an absolute move. Keyword arguments should be axis names. |
| Method | move |
Make a relative move. Keyword arguments should be axis names. |
| Method | move |
Move to the location specified by an (x, y, z) tuple. |
| Method | set |
Make the current position zero in all axes. |
| Class Variable | moving |
Whether the stage is in motion. |
| Instance Variable | axis |
Used to convert coordinates between the program frame and the hardware frame. |
| Property | axis |
The names of the stage's axes, in order. |
| Property | position |
Current position of the stage. |
| Property | thing |
Summary metadata describing the current state of the stage. |
| Method | _apply |
Undocumented |
| Method | _hardware |
Make a absolute move in the coordinate system used by the physical hardware. |
| Method | _hardware |
Make a relative move in the coordinate system used by the physical hardware. |
| Class Variable | _axis |
Undocumented |
| Instance Variable | _hardware |
Undocumented |
openflexure_microscope_server.things.stage.dummy.DummyStage, openflexure_microscope_server.things.stage.sangaboard.SangaboardThingInitialise the stage.
| Raises | |
RedefinedBaseMovementError | if move_relative and/or move_absolute are overridden. It is recommended to override _hardware_move_relative and/or _hardware_move_absolute instead so that all code in the child class uses the hardware reference frame. |
Return a tuple containing (x, y, z) position.
This method provides the interface expected by the camera_stage_mapping.
| Raises | |
KeyError | if this stage does not have axes named "x", "y", and "z". |
Invert the direction setting of the given axis.
| Parameters | |
axis:Literal[ | The axis name (x, y or z) to invert. |
lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[ str, int]):
(source)
¶
Make an absolute move. Keyword arguments should be axis names.
lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[ str, int]):
(source)
¶
Make a relative move. Keyword arguments should be axis names.
lt.deps.CancelHook, xyz_pos: tuple[ int, int, int]):
(source)
¶
Move to the location specified by an (x, y, z) tuple.
This method provides the interface expected by the camera_stage_mapping.
| Parameters | |
cancel:lt.deps.CancelHook | A cancel hook for cancelling the move. This dependency should be injected automatically by LabThings-FastAPI |
xyztuple[ | The (x, y, z) position to move to. |
| Raises | |
KeyError | if this stage does not have axes named "x", "y", and "z". |
openflexure_microscope_server.things.stage.dummy.DummyStage, openflexure_microscope_server.things.stage.sangaboard.SangaboardThingMake the current position zero in all axes.
This action does not move the stage, but resets the position to zero. It is intended for use after manually or automatically recentring the stage.
openflexure_microscope_server.things.stage.dummy.DummyStage, openflexure_microscope_server.things.stage.sangaboard.SangaboardThingWhether the stage is in motion.
openflexure_microscope_server.things.stage.dummy.DummyStage, openflexure_microscope_server.things.stage.sangaboard.SangaboardThingUsed to convert coordinates between the program frame and the hardware frame.
list[ int] | tuple[ int] | Mapping[ str, int]) -> list[ int] | Mapping[ str, int]:
(source)
¶
Undocumented
lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[ str, int]):
(source)
¶
openflexure_microscope_server.things.stage.dummy.DummyStage, openflexure_microscope_server.things.stage.sangaboard.SangaboardThingMake a absolute move in the coordinate system used by the physical hardware.
Make sure to use and update self._hardware_position not self.position.
lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[ str, int]):
(source)
¶
openflexure_microscope_server.things.stage.dummy.DummyStage, openflexure_microscope_server.things.stage.sangaboard.SangaboardThingMake a relative move in the coordinate system used by the physical hardware.
Make sure to use and update self._hardware_position not self.position.