optiland.wavefront.reference_geometry#
Reference Geometry Module
This module defines the geometry for the reference surface used in wavefront analysis. It supports both spherical (focal) and planar (afocal) references.
Kramer Harrison, 2026
Classes
|
Planar reference geometry (for afocal systems). |
Abstract base class for reference geometries. |
|
|
Spherical reference geometry (for focal systems). |
|
Reference sphere of infinite radius (exit pupil at infinity). |
- class PlanarReference(point: tuple[float, float, float], normal: tuple[float, float, float])[source]#
Planar reference geometry (for afocal systems).
- Parameters:
point – (x, y, z) point on the plane.
normal – (nx, ny, nz) normal vector of the plane.
- path_length(rays: RealRaysT, n_medium: float) BEArrayT[source]#
Return
n_medium * tfor the backward rayposition - t * direction.tis signed: negative when the plane lies ahead of the ray. A ray parallel to the plane has no intersection and returns NaN, unless it lies in the plane, where it returns zero (the ray’s own position).
- class ReferenceGeometry[source]#
Abstract base class for reference geometries.
- abstractmethod path_length(rays: RealRaysT, n_medium: float) BEArrayT[source]#
Calculates optical path length from ray positions to the reference.
- Parameters:
rays – The rays at the image surface (containing x, y, z, L, M, N).
n_medium – The refractive index of the medium.
- Returns:
The optical path length correction.
- class SphericalReference(center: tuple[float, float, float], radius: float)[source]#
Spherical reference geometry (for focal systems).
- Parameters:
center – (x, y, z) coordinates of the sphere center.
radius – Finite sphere radius. Either sign describes the same sphere; intersections use its magnitude. The stored value retains its sign.
Note
Positions, center, refractive index and directions must be finite, and direction vectors must have nonzero norms. Zero vectors and infinite radii are unsupported. For physical optical distances,
path_lengthrequires unit direction cosines._relative_path_lengthnormalizes directions internally without modifying the rays.- path_length(rays: RealRaysT, n_medium: float) BEArrayT[source]#
Return
n_medium * tfor the backward rayposition - t * direction.The supplied direction vector is used unchanged. Thus
tis a geometric distance only for unit directions; scaling a direction by a positive factor dividestby that factor. Radius sign has no effect. Choose the first nonnegative root, or the larger root if both are negative. A negative discriminant is clamped to zero.
- class TelecentricSphericalReference(center: tuple[float, float, float], sampling_radius: float)[source]#
Reference sphere of infinite radius (exit pupil at infinity).
In an image-space telecentric system the exit-pupil reference sphere is centred on the image point and has an infinite radius. Its optical path difference is the limit
R -> infofSphericalReference:n_medium * (u . (P - C))for a ray throughPwith unit directionu, up to a constant common to every ray. A plane reference is not this limit: it measures along the ray to one plane, not to the far sphere.The pupil sample points still need a finite surface.
path_lengthandradiustherefore use a finite sampling sphere with the same centre; it affects where the samples are placed, not the OPD.- Parameters:
center – (x, y, z) coordinates of the image point.
sampling_radius – Finite radius of the sphere on which the pupil samples are placed.
- path_length(rays: RealRaysT, n_medium: float) BEArrayT#
Return
n_medium * tfor the backward rayposition - t * direction.The supplied direction vector is used unchanged. Thus
tis a geometric distance only for unit directions; scaling a direction by a positive factor dividestby that factor. Radius sign has no effect. Choose the first nonnegative root, or the larger root if both are negative. A negative discriminant is clamped to zero.