class ScanPlanner: (source)
Known subclasses: openflexure_microscope_server.scan_planners.SmartSpiral
Constructor: ScanPlanner(initial_position, planner_settings)
A base class for a scan planner.
This should never be used directly for a scan, it should be subclassed.
Each subclass should implement at least the methods with NotImplementedError set:
- _parse() - to parse the planner_settings dictionary, saving values to class
- variables
- _initial_location_list() - Sets the list of locations for the scan to follow
For a simple scan pattern this should be sufficient. For more complex ones that dynamically adjust the path it is suggested to override mark_location_visited() calling super().mark_location_visited() at the start of the method so that all locations are adjusted.
When subclassing be sure to use enforce_xy_tuple and enforce_xyz_tuple on any user data before running.
| Method | __init__ |
Set up lists for the path planning, and scan history. |
| Method | closest |
Return the xyz position of the closest site where focus was achieved. |
| 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 | 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 | _initial |
Set the initial list of locations for this scan planner. |
| Method | _parse |
Parse any settings sent to this planner and store them if needed. |
| Instance Variable | _initial |
Undocumented |
| Instance Variable | _path |
Undocumented |
| Instance Variable | _remaining |
Undocumented |
openflexure_microscope_server.scan_planners.SmartSpiralSet up lists for the path planning, and scan history.
Return the xyz position of the closest site where focus was achieved.
The most recently taken image is returned in the case of a tie.
Returns None if there if no focussed locations are present
| Parameters | |
xyXYPos | The xy_position which the returned position should be closest to. |
| Returns | |
XYZPos | None | Undocumented |
openflexure_microscope_server.scan_planners.SmartSpiralReturn the next location to scan and its estimated z-position.
Note z-position may be None! This indicates that the current z, position should be used.
XYPos | XYZPos | FutureScanLocation) -> VisitedScanLocation:
(source)
¶
Return the scan location from the history that matches the input position.
openflexure_microscope_server.scan_planners.SmartSpiralMark the location as visited.
| Parameters | |
xyzXYZPos | the x_y_z position |
imaged:bool | true if an image was taken, false if not (due to background detect) |
focused:bool | true if autofocus completed successfully |
openflexure_microscope_server.scan_planners.SmartSpiralSet the initial list of locations for this scan planner.
This is called on initialisation.
For a simple grid scan/snake scan this would be all locations to move to.
| Returns | |
list[ | A list of FutureScanLocation objects with all planned locations. |
openflexure_microscope_server.scan_planners.SmartSpiralParse any settings sent to this planner and store them if needed.