laserbeamsize.display Module

A module for generating a graphical analysis of beam size fitting.

Full documentation is available at <https://laserbeamsize.readthedocs.io>

A graphic showing the image and extracted beam parameters is achieved by:

>>> import imageio.v3 as iio
>>> import matplotlib.pyplot as plt
>>> import laserbeamsize as lbs
>>>
>>> repo = "https://github.com/scottprahl/laserbeamsize/raw/master/docs/"
>>> image = iio.imread(repo + 't-hene.pgm')
>>>
>>> lbs.plot_image_analysis(image)
>>> plt.show()

A mosaic of images might be created by:

>>> import imageio.v3 as iio
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> import laserbeamsize as lbs
>>>
>>> repo = "https://github.com/scottprahl/laserbeamsize/raw/master/docs/"
>>> z1 = np.array([168,210,280,348,414,480], dtype=float)
>>> fn1 = [repo + "t-%dmm.pgm" % number for number in z1]
>>> images = [iio.imread(fn) for fn in fn1]
>>>
>>> options = {'z':z1/1000, 'pixel_size':0.00375, 'units':'mm', 'crop':True}
>>> lbs.plot_image_montage(images, **options, iso_noise=False)
>>> plt.show()

Functions

beam_ellipticity(dx, dy)

Calculate the ellipticity of the beam.

plot_beam_diagram()

Draw a simple astigmatic beam ellipse with labels.

plot_image_analysis(o_image[, title, ...])

Create a visual report for image fitting.

plot_image_and_fit(o_image[, pixel_size, ...])

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

plot_image_montage(images[, z, cols, ...])

Create a beam size montage for a set of images.