crop_image_to_integration_rect

laserbeamsize.image_tools.crop_image_to_integration_rect(image: ndarray, xc_px: float, yc_px: float, d_major: float, d_minor: float | None, phi: float, mask_diameters: float = 3) tuple[ndarray, float, float][source]

Return image cropped to integration rectangle.

The integration rectangle is centered on (xc_px, yc_px) and has a length mask_diameters * d_major and width=max_diameters * d_minor. The rectangle is rotated by phi radians.

Since the image is being cropped, the center of the beam will move.

Parameters:
  • image – image of beam

  • xc_px – horizontal center of beam

  • yc_px – vertical center of beam

  • d_major – major axis (i.e, major diameter)

  • d_minor – minor axis (i.e, minor diameter)

  • phi – angle between major axis and horizontal axis [radians]

  • mask_diameters – multiplier for major/minor diameters

Returns:

cropped_image – cropped image new_xc: x-position of beam center in cropped image new_yc: y-position of beam center in cropped image