laserbeamsize.m2_fit Module

A module for finding M² values for a laser beam.

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

This module contains the function M2_fit() designed to determine the beam parameters and their respective errors based on a set of measurements as per ISO 11146-1 section 9, utilizing a non-linear curve fitting method. The function calculates beam parameters such as: - Beam waist diameter (d0) [m] - Axial location of the beam waist (z0) [m] - Full beam divergence angle (Theta) [radians] - Beam propagation parameter (M2) [-] - Rayleigh distance (zR) [m]

>>> import numpy as np
>>> import laserbeamsize as lbs
>>>
>>> lambda0 = 632.8e-9  # meters
>>> z = np.array([168, 210, 280, 348, 414, 480, 495, 510, 520, 580, 666, 770]) * 1e-3
>>> r = np.array([597, 572, 547, 554, 479, 403, 415, 400, 377, 391, 326, 397]) * 1e-6
>>> params, errors, _ = lbs.M2_fit(z, 2 * r, lambda0)
To facilitate interpretation of the results, there is also a M2_report function.

Example:

>>> import numpy as np
>>> import laserbeamsize as lbs
>>>
>>> lambda0 = 632.8e-9  # meters
>>> z = np.array([168, 210, 280, 348, 414, 480, 495, 510, 520, 580, 666, 770]) * 1e-3
>>> r = np.array([597, 572, 547, 554, 479, 403, 415, 400, 377, 391, 326, 397]) * 1e-6
>>>
>>> s = lbs.M2_report(z, 2 * r, lambda0)
>>> print(s)

Functions

M2_fit(z, d, lambda0[, strict, z0, d0])

Return the hyperbolic fit to the supplied diameters.

M2_report(z, dx, lambda0[, dy, f, strict, ...])

Return string describing a one or more sets of beam measurements.