rayoptics.raytr package

Package for optical ray tracing and calculations

The raytr subpackage provides core classes and functions for optical ray tracing and analyses. These include:

  • Base level ray tracing, raytrace

  • Calculation of wavefront aberration, waveabr

  • Specification of aperture, field, wavelength and defocus, opticalspec

  • Higher level ray tracing, in terms of aperture, field and wavelength, trace

  • Functions setting vignetting and clear apertures and support for pupil exploration, vigcalc

  • Tracing of fans, lists and grids of rays, including refocusing of OPD values, analyses

  • Exception classes for reporting ray trace errors, traceerror

  • Sample generation for ray grids, sampler

The overall optical model is managed by the OpticalModel class

class RayPkg(ray, op, wvl)

Bases: tuple

Ray and optical path length, plus wavelength


optical path length between pupils


list of RaySegs


wavelength (in nm) that the ray was traced in

class RaySeg(p, d, dst, nrml)

Bases: tuple

ray intersection and transfer data


ray direction cosine following the interface


geometric distance to next point of incidence


surface normal vector at the point of incidence


the point of incidence