class RectGridPlanner(ScanPlanner): (source)
Known subclasses: openflexure_microscope_server.scan_planners.RegularGridPlanner, openflexure_microscope_server.scan_planners.SmartSpiral
Constructor: RectGridPlanner(initial_position, planner_settings)
Base class for planners that operate on a rectangular grid.
| Method | moves |
Return displacement in grid-move units as a numpy array [dx_moves, dy_moves]. |
| Method | select |
Return a focused site near the given position to estimate Z for the next move. |
| Method | _adjacent |
Undocumented |
| Method | _intermediate |
Return an (x,y) position halfway between two input positions. |
| Method | _parse |
Parse any settings sent to this planner and store them if needed. |
| Instance Variable | _dx |
Undocumented |
| Instance Variable | _dy |
Undocumented |
Inherited from ScanPlanner:
| Method | __init__ |
Set up lists for the path planning, and scan history. |
| Method | get |
Return the next location to scan and its estimated z-position. |
| Method | get |
Return the scan location from the history that matches the input position. |
| Method | mark |
Mark the location as visited. |
| Method | position |
Return True if input scan position position is planned. |
| Method | position |
Return True if input scan position has been visited before. |
| Property | focused |
Property to access a copy of the focused_locations. |
| Property | focused |
Property to access a copy of the focused_locations. |
| Property | imaged |
Property to access a copy of the imaged_locations. |
| Property | path |
Property to access a copy of the path_history. |
| Property | remaining |
Property to access a copy of the remaining_locations. |
| Property | scan |
Return True if there are no locations left to scan. |
| Method | _grid |
Flatten a 2D grid of coordinates into flat list of FutureScanLocation objects. |
| Method | _initial |
Set the initial list of locations for this scan planner. |
| Instance Variable | _initial |
Undocumented |
| Instance Variable | _path |
Undocumented |
| Instance Variable | _remaining |
Undocumented |
XYPos | np.ndarray | FutureScanLocation | VisitedScanLocation, ending_pos: XYPos | np.ndarray | FutureScanLocation | VisitedScanLocation, metric: DistanceMetric) -> float:
(source)
¶
Return displacement in grid-move units as a numpy array [dx_moves, dy_moves].
| Parameters | |
startingXYPos | np.ndarray | FutureScanLocation | VisitedScanLocation | the position to measure from |
endingXYPos | np.ndarray | FutureScanLocation | VisitedScanLocation | the position to measure to |
metric:DistanceMetric | How the distance is calculated. See DistanceMetric |
| Returns | |
float | Undocumented |
openflexure_microscope_server.scan_planners.SmartSpiralReturn a focused site near the given position to estimate Z for the next move.
Looks for all previously focused locations that are within the scan step size (self._dx, self._dy) of next_position. Among these nearby focused sites, it returns the most recently imaged one.
This is suitable for raster or snake scans, where the scan may move along a row or column and then jump to a new row/column. If no nearby focused sites exist, returns None.
| Parameters | |
nextXYPos | The XY position where the next image will be taken. |
| Returns | |
XYZPos | None | The XYZ tuple of the closest and most recent focused site, or None if no focused locations exist. |
openflexure_microscope_server.scan_planners.RegularGridPlanner, openflexure_microscope_server.scan_planners.SmartSpiralParse any settings sent to this planner and store them if needed.