dodal.devices.oav.snapshots.snapshot_image_processing#

Functions

compute_beam_centre_pixel_xy_for_mm_position(...)

Compute the location of the beam centre in pixels on a reference image.

draw_crosshair(image, beam_x, beam_y)

Draw a crosshair at the beam centre coordinates specified.

dodal.devices.oav.snapshots.snapshot_image_processing.draw_crosshair(image: Image, beam_x: int, beam_y: int)[source]#

Draw a crosshair at the beam centre coordinates specified.

Parameters:
  • image (Image) – The image to draw the crosshair onto. This is mutated.

  • beam_x (int) – The x-coordinate of the crosshair (pixels).

  • beam_y (int) – The y-coordinate of the crosshair (pixels).

dodal.devices.oav.snapshots.snapshot_image_processing.compute_beam_centre_pixel_xy_for_mm_position(sample_pos_mm: tuple[float, float], beam_pos_at_origin_px: tuple[int, int], microns_per_pixel: tuple[float, float]) tuple[int, int][source]#

Compute the location of the beam centre in pixels on a reference image.

Parameters:
  • sample_pos_mm (tuple[float, float]) – x, y location of the sample in mm relative to when the reference image was taken.

  • beam_pos_at_origin_px (Pixel) – x, y position of the beam centre in the reference image (pixels).

  • microns_per_pixel (tuple[float, float]) – x, y scaling factor relating the sample position to the position in the image.

Returns:

x, y location of the beam centre (pixels).

Return type:

Pixel