module documentation

File contains functions used to measure the stage against the camera.

This includes:

  • Finding the centre of motion
  • Measuring the range of motion
Class CamStageTracker Class for tracking camera and stage movement together.
Class ParasiticMotionError Custom exception raised when parasitic motion is detected.
Class StageMeasurementThing A class used to measure the range of motion of the stage in X and Y.
Constant BIG_STEP Undocumented
Constant DETECT_MOTION_TOL Undocumented
Constant MEDIUM_STEP Undocumented
Constant PARASITIC_MOTION_TOL Undocumented
Constant SMALL_STEP Undocumented
Function _axis_from_movement_dict Return the axis that a given movement dictionary moves in.
Function _parasitic_motion_detected Compare desired movement to measured offset, report if parasitic motion was detected.
BIG_STEP: int = (source)

Undocumented

Value
200
DETECT_MOTION_TOL: float = (source)

Undocumented

Value
0.65
MEDIUM_STEP: int = (source)

Undocumented

Value
50
PARASITIC_MOTION_TOL: float = (source)

Undocumented

Value
0.1
SMALL_STEP: int = (source)

Undocumented

Value
20
@overload
def _axis_from_movement_dict(movement: Mapping[str, float], return_other: Literal[False]) -> str:
@overload
def _axis_from_movement_dict(movement: Mapping[str, float], return_other: Literal[True]) -> tuple[str, str]:
@overload
def _axis_from_movement_dict(movement: Mapping[str, float]) -> str:
(source)

Return the axis that a given movement dictionary moves in.

For example: _axis_from_movement_dict({"x": 10, "y":0}) will return x.

Parameters
movement:Mapping[str, float]The movement dictionary.
return_other:boolIf True return a tuple with the first value being the movement axis and the second being the other axis. Default is False
Returns
str | tuple[str, str]The movement axis (and optionally the other axis) as strings.
def _parasitic_motion_detected(movement: Mapping[str, float], offset: Mapping[str, float]) -> bool: (source)

Compare desired movement to measured offset, report if parasitic motion was detected.

Parameters
movement:Mapping[str, float]The movement dictionary in image coordinates.
offset:Mapping[str, float]The offset calculated from correlation.
Returns
boolTrue if too much parasitic motion is detects. False if movement is as expected.