Stop scan planner plots erroring if there are no secondary locations

This commit is contained in:
Julian Stirling 2025-11-28 10:13:19 +00:00
parent 90be139575
commit dfe7fb6c42
2 changed files with 5 additions and 2 deletions

View file

@ -67,7 +67,10 @@ def visualise_scan(sample: FakeSample, planner: scan_planners.ScanPlanner) -> Fi
ax.add_artist(sample.patch)
xh, yh = zip(*planner.path_history, strict=True)
xi, yi, _zi = zip(*planner.imaged_locations, strict=True)
xs, ys, _zs = zip(*planner.secondary_locations, strict=True)
if planner.secondary_locations:
xs, ys, _zs = zip(*planner.secondary_locations, strict=True)
else:
xs, ys, _zs = [], [], []
# convert history to numpy array so can calculate quiver arrows
xh = np.array(xh)