class documentation

Base class for planners that operate on a rectangular grid.

Method moves_between Return displacement in grid-move units as a numpy array [dx_moves, dy_moves].
Method select_nearby_focus_site Return a focused site near the given position to estimate Z for the next move.
Method _adjacent_positions Undocumented
Method _intermediate_position 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_next_location_and_z_estimate Return the next location to scan and its estimated z-position.
Method get_visited_location Return the scan location from the history that matches the input position.
Method mark_location_visited Mark the location as visited.
Method position_planned Return True if input scan position position is planned.
Method position_visited Return True if input scan position has been visited before.
Property focused_locations Property to access a copy of the focused_locations.
Property focused_locations_xyz Property to access a copy of the focused_locations.
Property imaged_locations Property to access a copy of the imaged_locations.
Property path_history Property to access a copy of the path_history.
Property remaining_locations Property to access a copy of the remaining_locations.
Property scan_complete Return True if there are no locations left to scan.
Method _grid_to_future_locations Flatten a 2D grid of coordinates into flat list of FutureScanLocation objects.
Method _initial_location_list Set the initial list of locations for this scan planner.
Instance Variable _initial_position Undocumented
Instance Variable _path_history Undocumented
Instance Variable _remaining_locations Undocumented
def moves_between(self, starting_pos: 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
starting_pos:XYPos | np.ndarray | FutureScanLocation | VisitedScanLocationthe position to measure from
ending_pos:XYPos | np.ndarray | FutureScanLocation | VisitedScanLocationthe position to measure to
metric:DistanceMetricHow the distance is calculated. See DistanceMetric
Returns
floatUndocumented
def select_nearby_focus_site(self, next_position: XYPos) -> XYZPos | None: (source)

Return 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
next_position:XYPosThe XY position where the next image will be taken.
Returns
XYZPos | NoneThe XYZ tuple of the closest and most recent focused site, or None if no focused locations exist.
def _adjacent_positions(self, xy_pos: XYPos) -> XYPosList: (source)

Undocumented

def _intermediate_position(self, xy_pos1: XYPos, xy_pos2: XYPos) -> XYPos: (source)

Return an (x,y) position halfway between two input positions.

def _parse(self, planner_settings: dict | None = None): (source)
_dx: int = (source)

Undocumented

_dy: int = (source)

Undocumented