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. :type sample_pos_mm: tuple[float, float] :param sample_pos_mm: x, y location of the sample in mm relative to when the reference image was taken. :type beam_pos_at_origin_px: tuple[int, int] :param beam_pos_at_origin_px: x, y position of the beam centre in the reference image (pixels) :type microns_per_pixel: tuple[float, float] :param microns_per_pixel: x, y scaling factor relating the sample position to the position in the 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. :type image: Image :param image: The image to draw the crosshair onto. This is mutated. :type beam_x: int :param beam_x: The x-coordinate of the crosshair (pixels) :type beam_y: int :param beam_y: 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. :type sample_pos_mm: tuple[float, float] :param sample_pos_mm: x, y location of the sample in mm relative to when the reference image

was taken.

Parameters:
  • beam_pos_at_origin_px (tuple[int, int]) – 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.

Return type:

tuple[int, int]

Returns:

x, y location of the beam centre (pixels)