class RangeofMotionThing(lt.Thing): (source)
Constructor: RangeofMotionThing(thing_server_interface)
A class used to measure the range of motion of the stage in X and Y.
| Method | __init__ |
Initialise and create the lock. |
| Method | perform |
Measures the curvature of the motion to centre x and y axes. |
| Method | perform |
Measures the range of motion of the stage across the x and y axes. |
| Instance Variable | calibrated |
Undocumented |
| Method | _big |
Take one big move with feed-forward z-correction. |
| Method | _distance |
For a target location in stage coords return the distance in percentage of FOV. |
| Method | _img |
For a target location in stage coords, return the direction in image coordinates. |
| Method | _img |
For a given image percentage and axis return the distance in img coords. |
| Method | _move |
Move the stage and measure the offset between the two positions. |
| Method | _move |
Move the stage against the direction of test unil motion is detected. |
| Method | _move |
Move in one direction until movement per step decreases significantly. |
| Method | _movement |
Return the dictionary for a move in image coordinates. |
| Method | _moves |
Perform medium sized moves with autofocus for z feed-forward. |
| Method | _offset |
Take an image and calculate the offset from an input image. |
| Method | _recentre |
Recentre a single axis. |
| Method | _recentre |
Decide what to do next during recentreing. |
| Method | _set |
Set the self._stream_resolution attribute by reading camera. |
| Method | _stage |
Carry out 3 small moves in a given direction and axis. |
| Class Variable | _autofocus |
Undocumented |
| Class Variable | _cam |
Undocumented |
| Class Variable | _csm |
Undocumented |
| Class Variable | _stage |
Undocumented |
| Instance Variable | _lock |
Undocumented |
| Instance Variable | _rom |
Undocumented |
| Instance Variable | _stream |
Undocumented |
Measures the range of motion of the stage across the x and y axes.
| Returns | |
Mapping[ | Results dictionary separated into keys of each axis and direction. |
Take one big move with feed-forward z-correction.
The size is defined by the BIG_STEP constant.
| Parameters | |
axis:Literal[ | The axis to move in. |
direction:Literal[ | The direction to move in. |
Mapping[ str, int], axis: Literal[ 'x', 'y']) -> float:
(source)
¶
For a target location in stage coords return the distance in percentage of FOV.
| Parameters | |
target:Mapping[ | The target poisiton in stage coordinates |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
| Returns | |
float | Percentage of field of view the stage should move by. |
Mapping[ str, int], axis: Literal[ 'x', 'y']) -> Literal[ 1, -1]:
(source)
¶
For a target location in stage coords, return the direction in image coordinates.
| Parameters | |
target:Mapping[ | The target poisiton in stage coordinates |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
| Returns | |
Literal[ | Direction to move in image coordinates. |
int, axis: Literal[ 'x', 'y']) -> float:
(source)
¶
For a given image percentage and axis return the distance in img coords.
| Parameters | |
fovint | The percentage of field of view the stage should move by. |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
| Returns | |
float | Distance in image coordinates (pixels) |
Mapping[ str, float], perform_autofocus: bool = True, max_autofocus_repeats: int = 0, abs_min_offset: float = 0.0) -> Mapping[ str, float]:
(source)
¶
Move the stage and measure the offset between the two positions.
| Parameters | |
movement:Mapping[ | A dictionary containing the distance to move in image coords. |
performbool | Set to False to disable autofocus after move. Default is True |
maxint | The number of times to repeat the focus if the detected (on-axis) offset is below abs_min_offset. This will only work if abs_min_offset is also set |
absfloat | The absolute minimum (on-axis) offset, under which the autofocus is repeated. |
| Returns | |
Mapping[ | The calculated offset from cross correlation. |
Literal[ 'x', 'y'], direction: Literal[ 1, -1]):
(source)
¶
Move the stage against the direction of test unil motion is detected.
In the case that the stage has reached the end of the motion, this method moves the motor in the opposite direction until reliable motion is detected.
| Parameters | |
axis:Literal[ | The axis in which the stage is moving. This must be 'x' or 'y'. |
direction:Literal[ | The direction in which the stage was moving during the test, this method will move in the opposite direction. |
Move in one direction until movement per step decreases significantly.
This should move until the edge of the stage. Once the edge is reached there will be some movement as there is no hard stop, but it will reduce significantly.
| Parameters | |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
direction:Literal[ | The direction which is being measured. This must be 1 or -1. |
| Returns | |
| Results dictionary containing stage positions, correlations and the final position. |
int, axis: Literal[ 'x', 'y'], direction: Literal[ 1, -1]) -> Mapping[ str, float]:
(source)
¶
Return the dictionary for a move in image coordinates.
This dictionary can be passed directly to csm.move_in_image_coordinates
| Parameters | |
fovint | The percentage of field of view the stage should move by. |
axis:Literal[ | The resolution of the stream from the camera. |
direction:Literal[ | The direction the stage moves. |
| Returns | |
Mapping[ | The movement size in image coordinates |
Literal[ 'x', 'y'], direction: Literal[ 1, -1], n_moves: int = 5):
(source)
¶
Perform medium sized moves with autofocus for z feed-forward.
z-feed forward allows prediction of the z-position as the stage moves. For the feed forward calculation to work an initial number of measurements must be taken.
| Parameters | |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
direction:Literal[ | The direction the stage moves. |
nint | Number of moves to make. Default is 5 which is enough for an initial z estimate. |
Take an image and calculate the offset from an input image.
| Parameters | |
beforenp.ndarray | The image the offset should be calculated with respect to. |
| Returns | |
Mapping[ | The calculated offset as a dictionary in pixels |
Decide what to do next during recentreing.
The algorithm here:
- Estimate turning point location
- Check if distance to point is further than a "BIG_STEP"
- If smaller, move to estimated centre, and return that it is centred
- If larger, return that it is not centred, and the direction to move in.
| Parameters | |
axis:Literal[ | The axis to recentre |
| Returns | |
tuple[ | A tuple. The first value is True for "the stage is now centred" and False for "the stage is not centred". The second value is the direction to move in, this only has meaning if the first value is False. |
Literal[ 'x', 'y'], direction: Literal[ 1, -1]) -> bool:
(source)
¶
Carry out 3 small moves in a given direction and axis.
An image is taken before and after each move to check the stage has moved as far as it should. If the offset (calculated by cross correlation) is less than expected, 3 attempts are made to refocus the image to ensure that image quality is not causing the offset to mistakenly be reported as a low value. If the calculated offset is still too low then this is taken as an indication that the edge has been found.
| Parameters | |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
direction:Literal[ | The direction the stage moves. |
| Returns | |
bool | Undocumented |