elliptical_mask

laserbeamsize.masks.elliptical_mask(image, xc, yc, dx, dy, phi)[source]

Create a boolean mask for a rotated elliptical disk.

The returned mask is the same size as image.

Parameters:
  • image – 2D array

  • xc – horizontal center of beam

  • yc – vertical center of beam

  • dx – ellipse diameter for axis closest to horizontal

  • dy – ellipse diameter for axis closest to vertical

  • phi – angle that elliptical beam is rotated [radians]

Returns:

masked_image – 2D array with True values inside ellipse