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
|
Calculate the ellipticity of the beam. |
Draw a simple astigmatic beam ellipse with labels. |
|
|
Create a visual report for image fitting. |
|
Plot the image, fitted ellipse, integration area, and semi-major/minor axes. |
|
Create a beam size montage for a set of images. |