plot_image_and_fit
- laserbeamsize.display.plot_image_and_fit(o_image: ndarray, pixel_size: float | None = None, vmin: float | None = None, vmax: float | None = None, units: str = 'µm', crop: bool | list = False, colorbar: bool = False, cmap: str = 'gist_ncar', corner_fraction: float = 0.035, nT: float = 3, iso_noise: bool = True, **kwargs) tuple[float, float, float, float | None, float][source]
Plot the image, fitted ellipse, integration area, and 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 therefore 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) show the color bar,
cmap – (optional) colormap to use
corner_fraction – (optional) the fractional size of corner rectangles
nT – (optional) how many standard deviations to subtract
iso_noise – (optional) if True then allow negative pixel values
kwargs – additional arguments passed through to beam_size
- Returns:
xc, yc, d_major, d_minor, phi