class documentation

class CamStageTracker: (source)

Constructor: CamStageTracker()

View In Hierarchy

Class for tracking camera and stage movement together.

The attributes storing data are:

  • stage_coords A list of the the stage coordinates at each measurement location
  • offsets A list of the displacement calculated after movement

Note that different tests use this slightly differently to store the data required.

Method __init__ Define useful data tracked throughout test.
Method find_turning_point Find the turing point from the recorded coordinates.
Method fit_axis Quadratic fit stage z against x or y and return poly1d of fit.
Method predict_z_displacement Predict the z-displacement needed for a given movement.
Method record_movement Record the current position and the measured offset of the last move.
Method record_stage_pos Record the current stage position.
Instance Variable offsets Undocumented
Instance Variable stage_coords Undocumented
Property final_position The last stage coordinate recorded.
def __init__(self): (source)

Define useful data tracked throughout test.

def find_turning_point(self, axis: Literal['x', 'y']) -> Mapping[str, int]: (source)

Find the turing point from the recorded coordinates.

def fit_axis(self, axis: Literal['x', 'y']) -> np.poly1d: (source)

Quadratic fit stage z against x or y and return poly1d of fit.

Note that this considers only one of x and y, and ignores the other coordinate. If this function is used on moves where both x and y are changing, it will give misleading results.

def predict_z_displacement(self, axis: Literal['x', 'y'], stage_movement: Mapping[str, int], stage_position: Mapping[str, int]) -> int: (source)

Predict the z-displacement needed for a given movement.

Parameters
axis:Literal['x', 'y']The axis which is being measured. This must be 'x' or 'y'.
stage_movement:Mapping[str, int]The movement to be performed in stage coordinates.
stage_position:Mapping[str, int]The current stage position in stage coordinates.
Returns
intThe predicted relative z displacement needed to stay in focus.
def record_movement(self, current_pos: Mapping[str, int], offset: Mapping[str, float]): (source)

Record the current position and the measured offset of the last move.

def record_stage_pos(self, current_pos: Mapping[str, int]): (source)

Record the current stage position.

offsets: list[Mapping[str, float]] = (source)

Undocumented

stage_coords: list[Mapping[str, int]] = (source)

Undocumented

@property
final_position: Mapping[str, int] = (source)

The last stage coordinate recorded.