Skip to content

Commit

Permalink
Merge pull request DiamondLightSource/hyperion#1238 from DiamondLight…
Browse files Browse the repository at this point in the history
…Source/1227_add_edge_logging

DiamondLightSource/hyperion#1227 add edge logging
  • Loading branch information
DominicOram authored Mar 8, 2024
2 parents 27a9573 + e9b888f commit d41cb3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hyperion/experiment_plans/oav_grid_detection_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ def grid_detection_plan(
# only use the area from the start of the pin onwards
top_edge = top_edge[tip_x_px : tip_x_px + grid_width_pixels]
bottom_edge = bottom_edge[tip_x_px : tip_x_px + grid_width_pixels]
LOGGER.info(f"OAV Edge detection top: {list(top_edge)}")
LOGGER.info(f"OAV Edge detection bottom: {list(bottom_edge)}")

# the edge detection line can jump to the edge of the image sometimes, filter
# those points out, and if empty after filter use the whole image
filtered_top = list(top_edge[top_edge != 0]) or [0]
filtered_bottom = list(bottom_edge[bottom_edge != full_image_height_px]) or [
full_image_height_px
]
LOGGER.info(f"OAV Edge detection filtered top: {filtered_top}")
LOGGER.info(f"OAV Edge detection filtered bottom: {filtered_bottom}")
min_y = min(filtered_top)
max_y = max(filtered_bottom)
grid_height_px = max_y - min_y
Expand Down

0 comments on commit d41cb3b

Please sign in to comment.