plot_image_and_fit

laserbeamsize.display.plot_image_and_fit(o_image, pixel_size=None, vmin=None, vmax=None, units='µm', crop=False, colorbar=False, cmap='gist_ncar', corner_fraction=0.035, nT=3, iso_noise=True, **kwargs)[source]

Plot the image, fitted ellipse, integration area, and semi-major/minor axes.

If pixel_size is defined, then the returned measurements are in units of pixel_size.

This function helpful when creating a mosaics of all images captured for an experiment.

If crop==True then the displayed image is cropped to the ISO 11146 integration rectangle.

If crop is a two parameter list [v, h] then v and h are interpreted as the vertical and horizontal sizes of the rectangle. The size is in pixels unless pixel_size is specified. In that case the rectangle sizes are in whatever units pixel_size is .

All cropping is done after analysis and therefosre only affects what is displayed. If the image needs to be cropped before analysis then that must be done before calling this function.

Parameters:
  • o_image – 2D array of image with beam spot

  • pixel_size – (optional) size of pixels

  • vmin – (optional) minimum value for colorbar

  • vmax – (optional) maximum value for colorbar

  • units – (optional) string used for units used on axes

  • crop – (optional) crop image to integration rectangle

  • colorbar (optional)

  • cmap – (optional) colormap to use

Returns:

xc – horizontal center of beam yc: vertical center of beam dx: horizontal diameter of beam dy: vertical diameter of beam phi: angle that elliptical beam is rotated [radians]