RayTracing API Reference

A simple module for ray tracing with ABCD matrices. https://github.com/DCC-Lab/RayTracing

Create an ImagingPath(), append matrices (optical elements or other group of elements), and then display(). This helps determine of course simple things like focal length of compound systems, object-image, etc… but also the aperture stop, field stop, field of view and any clipping issues that may occur.

When displaying the result with an ImagingPath(), the objectHeight, fanAngle, and fanNumber are used if the field of view is not defined. You may adjust the values to suit your needs in ImagingPath().

Create a LaserPath() to analyse gaussian beams using the complex radius of curvature q and the same matrices.

The class hierarchy can be obtained with python -m raytracing –classes

Matrix

Matrix([A, B, C, D, physicalLength, ...])

A matrix and an optical element that can transform a ray or another matrix.

Aperture(diameter[, NA, label])

An aperture of finite diameter, null thickness.

CurvedMirror(R[, diameter, label])

A curved mirror of radius R and infinite or finite diameter.

DielectricInterface(n1, n2[, R, diameter, label])

A dielectric interface of radius R, with an index n1 before and n2 after the interface

DielectricSlab(n, thickness[, diameter, label])

A slab of dielectric material of index n and length d, with flat faces

Lens(f[, diameter, label])

A thin lens of focal f, null thickness and infinite or finite diameter

Space(d[, n, diameter, label])

Free space of length d

ThickLens(n, R1, R2, thickness[, diameter, ...])

A thick lens of first radius R1 and then R2, with an index n and length d

MatrixGroup

MatrixGroup([elements, label])

MatrixGroup: A group of Matrix(), allowing the combination of several elements to be treated as a whole, or treated explicitly as a sequence when needed.

ImagingPath

ImagingPath([elements, label])

ImagingPath: the main class of the module, allowing the combination of Matrix() or MatrixGroup() to be used as an imaging group with an object at the beginning.

Ray

Ray([y, theta, z, isBlocked, wavelength])

A vector and a light ray as transformed by ABCD matrices.

Rays

Rays([rays])

A source or a detector of rays

ObjectRays(diameter[, halfAngle, H, T, z, ...])

A set of rays used for objects.

UniformRays([yMax, yMin, thetaMax, ...])

A list of rays with uniform distribution.

RandomRays([yMax, yMin, thetaMax, thetaMin, ...])

A list of rays with Random distribution.

LambertianRays([yMax, yMin, M, N, I])

A list of rays with Lambertian distribution.

RandomLambertianRays([yMax, yMin, maxCount])

A list of random rays with Lambertian distribution.

RandomUniformRays([yMax, yMin, thetaMax, ...])

A list of random rays with Uniform distribution.

Compact Rays (GPU-ready)

compact.CompactRay(raysSource, index)

A view into a shared buffer that behaves like a Ray.

compact.CompactRays([...])

A contiguous buffer holding many rays, ready for GPU transfer.

compact.CompactRaytrace(compactRays, ...)

A view into a slice of a CompactRays buffer representing one ray trace.

compact.CompactRaytraces(compactRays, ...)

A collection of all ray traces from a GPU computation.

Ray Traces

RayTrace([rays])

A single ray trace: the path of one ray through an optical system.

RayTraces([rayTraces])

A collection of ray traces from tracing multiple input rays.

Laser Path

LaserPath([elements, label])

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.

Gaussian Beam

GaussianBeam([q, w, R, n, wavelength, z])

A gaussian laser beam using the ABCD formalism for propagation of complex radius of curvature q.

Components

System2f(f[, diameter, label])

The matrix group of a 2f system can be defined using this function.

System4f(f1, f2[, diameter1, diameter2, label])

The matrix group of a 4f system can be defined using this function.

Axicon

Axicon(alpha, n[, diameter, label])

This class is an advanced module that describes an axicon lens, not part of the basic formalism.

Specialty Lenses

AchromatDoubletLens(fa, fb, R1, R2, R3, tc1, ...)

General Achromat doublet lens with an effective focal length of fa, back focal length of fb.

Objective(f, NA, focusToFocusLength, ...[, ...])

Olympus

olympus.LUMPlanFL40X()

Olympus 40x immersion objective

olympus.XLUMPlanFLN20X()

Olympus XLUMPlanFLN20X (Super 20X) 1.0 NA with large back aperture.

olympus.MVPlapo2XC()

Olympus MVPlapo2XC 0.5 NA with large back aperture.

olympus.UMPLFN20XW()

Olympus UMPLanFN 20XW immersion objective

olympus.XLPLN25X()

Olympus XLPLN25X 1.05 NA

Edmund Optics

eo.PN_33_921()

eo.PN_33_922()

eo.PN_88_593()

eo.PN_85_877()

Nikon

nikon.LWD16X()

Nikon 16x immersion objective

Thorlabs

thorlabs.ACN254_100_A([wavelength])

thorlabs.ACN254_075_A([wavelength])

thorlabs.ACN254_050_A([wavelength])

thorlabs.ACN254_040_A([wavelength])

thorlabs.AC254_030_A([wavelength])

thorlabs.AC254_035_A([wavelength])

thorlabs.AC254_040_A([wavelength])

thorlabs.AC254_045_A([wavelength])

thorlabs.AC254_050_A([wavelength])

thorlabs.AC254_060_A([wavelength])

AC254-060-A

thorlabs.AC254_075_A([wavelength])

AC254-075-A

thorlabs.AC254_080_A([wavelength])

AC254-080-A

thorlabs.AC254_100_A([wavelength])

AC254-100-A

thorlabs.AC254_125_A([wavelength])

AC254-125-A

thorlabs.AC254_150_A([wavelength])

AC254-150-A

thorlabs.AC254_200_A([wavelength])

AC254-200-A

thorlabs.AC254_250_A([wavelength])

AC254-250-A

thorlabs.AC254_300_A([wavelength])

AC254-300-A

thorlabs.AC254_400_A([wavelength])

AC254-400-A

thorlabs.AC254_500_A([wavelength])

AC254-500-A

thorlabs.AC254_050_B([wavelength])

thorlabs.AC508_075_B([wavelength])

thorlabs.AC508_080_B([wavelength])

thorlabs.AC508_100_B([wavelength])

thorlabs.AC508_150_B([wavelength])

thorlabs.AC508_200_B([wavelength])

AC508-200-B

thorlabs.AC508_250_B([wavelength])

AC508-250-B

thorlabs.AC508_300_B([wavelength])

AC508-300-B

thorlabs.AC508_400_B([wavelength])

AC508-400-B

thorlabs.AC508_500_B([wavelength])

AC508-500-B

thorlabs.AC508_750_B([wavelength])

AC5s08-750-B

thorlabs.AC508_1000_B([wavelength])

AC508-1000-B

thorlabs.LA1608_A([wavelength])

LA1608-A

thorlabs.LA1134_A([wavelength])

LA1134-A

thorlabs.LA1131_A([wavelength])

LA1131-A

thorlabs.LA1422_A([wavelength])

LA1422-A

thorlabs.LA1805_A([wavelength])

LA1805-A

thorlabs.LA1274_A([wavelength])

LA1274-A

Materials

Material()

Air()

N_BK7()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-BK7.html

N_SF2()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-SF2.html

SF2()

All data from https://refractiveindex.info/tmp/data/glass/schott/SF2.html

SF5()

All data from https://refractiveindex.info/tmp/data/glass/schott/SF5.html

N_SF5()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-SF5.html

N_SF6HT()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-SF6HT.html

N_SF10()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-SF10.html

N_SF11()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-SF11.html

N_BAF10()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-BAF10.html

E_BAF11()

N_BAK1()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-BAK1.html

N_BAK4()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-BAK4.html

FK51A()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-FK51A.html

LAFN7()

All data from https://refractiveindex.info/tmp/data/glass/schott/LAFN7.html

N_LASF9()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-LASF9.html

N_LAK22()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-LAK22.html

N_SSK5()

All data from https://refractiveindex.info/tmp/data/glass/schott/N-SSK5.html

E_FD10()

All data from https://refractiveindex.info/tmp/data/glass/hoya/E-FD10.html

FusedSilica()

All data from https://refractiveindex.info/tmp/data/main/SiO2/Malitson.html

Zemax reader

ZMXReader(filepath)

Zemax file (ZMX) reader for compound lenses.