LaserPath

class raytracing.LaserPath(elements=None, label='')

Bases: MatrixGroup

The main class of the module for coherent laser beams: it is the combination of Matrix() or MatrixGroup() to be used as a laser path with a laser beam (GaussianBeam) at the entrance.

Usage is to create the LaserPath(), then append() elements and display(). You may change the inputBeam to any GaussianBeam(), or provide one to display(beam=GaussianBeam())

Parameters:
  • elements (list of elements) – A list of ABCD matrices in the imaging path

  • label (string) – the label for the imaging path (Optional)

inputBeam

the input beam of the imaging path is defined using this parameter.

Type:

object of GaussianBeam class

showElementLabels

If True, the labels of the elements will be shown on display. (default=True)

Type:

bool

showPointsOfInterest

If True, the points of interest will be shown on display. (default=True)

Type:

bool

showPointsOfInterestLabels

If True, the labels of the points of interest will be shown on display. (default=True)

Type:

bool

showPlanesAcrossPointsOfInterest

If True, the planes across the points of interest will be shown on display. (default=True)

Type:

bool

Notes

Gaussian laser beams are not “blocked” by aperture. The formalism does not explicitly allow that. However, if it appears that a GaussianBeam() would be clipped by finite aperture, a property is set to indicate it, but it will propagate nevertheless and without diffraction due to that aperture.

display(beams=None, comments=None)

Display the optical system and trace the laser beam. If comments are included they will be displayed on a graph in the bottom half of the plot.

Parameters:
  • inputBeam (object of GaussianBeam class)

  • inputBeams (list of object of GaussianBeam class) – A list of Gaussian beams

  • comments (string) – If comments are included they will be displayed on a graph in the bottom half of the plot. (default=None)

Methods

__init__([elements, label])

display([beams, comments])

Display the optical system and trace the laser beam.

Inherited Methods

append(matrix)

This function adds an element at the end of the path.

backFocalLength()

The focal lengths measured from the back vertex.

backwardConjugate()

With an image at the back edge of the element, where is the object ? Distance before the element by which a ray must travel to reach the conjugate plane at the back of the element.

displayHalfHeight()

A reasonable height for display purposes for an element, whether it is infinite or not.

effectiveFocalLengths()

The effective focal lengths calculated from the power (C) of the matrix.

flipOrientation()

Flip the orientation (forward-backward) of this group of elements.

focalDistances()

This is the synonym of effectiveFocalLengths()

focusPositions(z)

Positions of both focal points on either side of the element.

forwardConjugate()

With an object at the front edge of the element, where is the image? Distance after the element by which a ray must travel to reach the conjugate plane of the front of the element.

fromFocusToFocus()

A simple method to obtain a MatrixGroup that includes all three matrices to travel from the front focus, through the lens, and then to the back focus.

fromStruct(theStruct)

frontFocalLength()

The focal lengths measured from the front vertex.

hasFiniteApertureDiameter()

True if ImagingPath has at least one element of finite diameter

insert(index, element)

This function is used to insert a matrix at a specific index.

intermediateConjugates()

This function calculates the position and the magnification of the conjugate planes.

load(filePath[, append])

A MatrixGroup saved with save() can be loaded using this function.

magnification()

The magnification of the element

mul_beam(rightSideBeam)

This function calculates the multiplication of a coherent beam with complex radius of curvature q by an ABCD matrix.

mul_matrix(rightSideMatrix)

This function is used to combine two elements into a single matrix.

mul_ray(rightSideRay)

This function does the multiplication of a ray by a matrix.

opticalInvariant(ray1, ray2[, z])

The optical invariant is a quantity that is conserved for any two rays in the system.

pointsOfInterest(z)

Any points of interest for this matrix (focal points, principal planes etc...)

pop(index)

This function is used to remove a matrix at a specific index.

principalPlanePositions(z)

Positions of the input and output principal planes.

profileFromRayTraces(rayTraces[, z])

save(filePath)

A MatrixGroup can be saved using this function and loaded with load()

toStruct()

trace(inputRay)

Trace the input ray from first element until after the last element, indicating if the ray was blocked or not.

traceMany(inputRays[, useOpenCL])

This function trace each ray from a group of rays from front edge of element to the back edge.

traceManyNative(inputRays)

This function trace each ray from a group of rays from front edge of element to the back edge.

traceManyOpenCL(inputRays)

This function trace each ray from a group of rays from front edge of element to the back edge.

traceManyThrough(inputRays[, progress, ...])

This function trace each ray from a list or a Rays() distribution from front edge of element to the back edge.

traceManyThroughInParallel(inputRays[, ...])

This is an advanced technique to gain from parallel computation: it is the same as traceManyThrough(), but splits this call in several other parallel processes using the multiprocessing module, which is os-independent.

traceThrough(inputRay)

Contrary to trace(), this only returns the last ray.

transferMatrices()

The list of Matrix() that corresponds to the propagation through this element (or group).

transferMatrix([upTo])

The transfer matrix between front edge and distance=upTo

Attributes

Struct

determinant

The determinant of the ABCD matrix is always frontIndex/backIndex, which is often 1.0.

forwardSurfaces

A list of surfaces that represents the element for drawing purposes

hasPower

If True, then there is a non-null focal length because C!=0.

isIdentity

isImaging

If B=0, then the matrix represents that transfer from a conjugate plane to another (i.e. object at the front edge and image at the back edge).

largestDiameter

Largest finite diameter in all elements

surfaces