Ray Tracing

This package implements a set of components to perform ray tracing for common optical systems.

Characterizing rays

BatchedRay(origin, direction, wl[, ...])

A class representing a batch of rays, which means both the origin and direction are tensors with the last dimension as 3, representing three coordinates x, y and z.

NoValidRayError

Error meaning that valid rays vanish.

Optical surfaces

paraxialize(surfaces, wl)

Returns the equivalent paraxial system of a collection of surfaces at given wavelengths.

surface_types([name_only])

Returns a list of accessible subclasses of Surface in lexicographic order.

CoaxialContext(surface, surface_sequence[, ...])

A subclass of Context for coaxial systems.

CoaxialSurfaceSequence([surfaces, ...])

A subclass of SurfaceSequence to contain coaxial surfaces.

Context(surface, surface_sequence[, upward_in])

A class representing the context of a Surface in a list of surfaces.

RayCollector([iterable])

A subclass of list that stores rays.

Surface([material, aperture, reflective, ...])

Base class for optical surfaces in a group of lens.

SurfaceSequence([surfaces, ...])

A sequential container of surfaces.

Apertures

AnnularAperture([inner_r, outer_r])

Annular aperture with an inner radius and an outer one.

Aperture(*args, **kwargs)

Base class for aperture shapes.

BoundedAperture(*args, **kwargs)

A base class for bounded apertures, but the bounds may be infinite here.

CircularAperture([radius])

Circular aperture with radius radius.

DummyAperture(*args, **kwargs)

A dummy aperture that never blocks any ray.

Specific surface types

AsphericalRadialPhase([roc, conic, ...])

CircularStop([aperture, move_ray, d])

Stops whose aperture is circularly symmetric.

Conic([roc, conic, material, aperture, ...])

Conic surfaces.

EvenAspherical([roc, conic, coefficients, ...])

Even aspherical surfaces.

Fresnel([roc, conic, coefficients, ...])

Fresnel lens surface.

Grating([material, aperture, period, ...])

Grating surface.

Planar([material, aperture, reflective, d])

Planar surface.

PolynomialPhase(a, b, material[, aperture, ...])

A planar surface imparting a phase shift to incident rays, parameterized as follows:

Spherical([roc, material, aperture, ...])

Spherical surfaces.

Stop([aperture, move_ray, d])

This type of surfaces only blocks rays outside the aperture and does not change their energy or direction.

ThinLens(fl1[, material, aperture, fl2, ...])

A model for thin lens.

Zernike([roc, conic, a, z, norm_radius, ...])

Ray-tracing-based optical systems

CoaxialRayTracingSystem provides some methods to simulate, optimize, analyze and visualize coaxial optical systems modeled in a sequential manner. It is an optical system model used in most cases. See the following page for documentation related to it.

Configuration for determining ray-surface intersection

IntersectionConfig([max_iteration, ...])

Configuration for intersection-determination algorithm.