# Experimental Concerns for Beam Measurement¶

Scott Prahl

Mar 2021

Many mistakes can be made when making a beam measurement. This notebook collects a number of these.

The ISO 11146 standard recommends masking the image with a rotated rectangular mask around the center of the image. This notebook explains how that was implemented and then shows some results for artifically generated images of non-circular Gaussian beams. As noise increases, the first-order parameters (beam center) are robust, but the second-order parameters (diameters) are shown to be much more sensitive to image noise.

If laserbeamsize is not installed, uncomment the following cell (i.e., delete the initial #) and execute it with shift-enter. Afterwards, you may need to restart the kernel/runtime before the module will import successfully.

[1]:

#!pip install --user laserbeamsize

[2]:

import imageio
import numpy as np
import matplotlib.pyplot as plt

try:
import laserbeamsize as lbs

except ModuleNotFoundError:
print('laserbeamsize is not installed. To install, uncomment and run the cell above.')
print('Once installation is successful, rerun this cell again.')

pixel_size_µm = 3.75               # microns
repo = "https://github.com/scottprahl/laserbeamsize/raw/master/docs/"


## Image of beam is saturated¶

[3]:

sat_img = imageio.imread(repo + "k-200mm.png")
lbs.beam_size_plot(sat_img, pixel_size=pixel_size_µm)


## Image of beam is too close to margins¶

[4]:

margin_img = imageio.imread(repo+"TEM00_300mm.pgm")>>4

options = {'pixel_size': pixel_size_µm, 'units': "µm"}
lbs.beam_size_plot(margin_img, **options)


## Image has artifacts, example 1¶

With the standard color map it is not obvious why the vertical dimension is nuts.

[5]:

art1_img = imageio.imread(repo+"TEM00_150mm.pgm")

options = {'pixel_size': pixel_size_µm, 'units': "µm"}
lbs.beam_size_plot(art1_img, **options)


Cropping the beam allows a reasonable fit to be obtained. However, in the image on the top right below, the integration rectangle extends beyond the image. Thus the result is not ISO 11146 compliant.

[6]:

lbs.beam_size_plot(art1_img[420:620,550:750], **options, cmap='gist_ncar')


## Image has artifacts, 2¶

Here a small artifact above the primary beam image (perhaps a reflection) dramatically changes the vertical beam diameter.

[7]:

art2_img = imageio.imread(repo+"sb_259mm_10.pgm")
lbs.beam_size_plot(art2_img, pixel_size=pixel_size_µm,cmap='gist_ncar')


Cropping the image produces much more reasonable values for the diameters.

[8]:

lbs.beam_size_plot(art2_img[365:565,543:743])


## Image of beam has too much noise¶

The background is nearly half of the central beam intensity. Although subtracting the background kind of worked, the offset affects the fitted gaussian and makes the diameter too wide.

[9]:

noise_img = imageio.imread(repo+"k-800mm.png")
lbs.beam_size_plot(noise_img, pixel_size=pixel_size_µm)

[ ]: