Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1238 from DiamondLightSource/1227_add_edge_logging
Browse files Browse the repository at this point in the history
#1227 add edge logging
  • Loading branch information
DominicOram committed Mar 8, 2024
2 parents c266699 + 9817425 commit 5cc4de0
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 5cc4de0

Please sign in to comment.