4.10. Paraxial Analysis

4.10.1. Overview

A ray transfer matrix analysis object, the TMA, provides paraxial analysis features for a lens or lens setup. Available properties include focal lengths, nodal points, optical powers and more. They are calculated for a specific wavelength and the current state of the geometry.

4.10.2. Defining the Analysis Geometry

Group/Raytracer

From a Raytracer, the TMA for the full geometry is calculated with the method tma().

tma = RT.tma()

The function optionally takes a wavelength in nanometers as argument, for which the properties are calculated:

tma = RT.tma(780)

Analyzing a Group follows the same procedure:

G = ot.presets.geometry.arizona_eye()
tma = G.tma()

Single Lens

The analysis is also available for a single Lens:

front = ot.CircularSurface(r=5)
back = ot.SphericalSurface(r=5, R=-25)
n = ot.presets.refraction_index.K5
L = ot.Lens(front, back, n=n, d=0.5, pos=[0, 0, 10])

tma = L.tma()

While a single Lens defines the subsequent ambient medium through Lens.n2, it has no knowledge on the preceding one. Normally it would be determined by either the Raytracer or the previous lens. The same applies to the n0 medium of the Raytracer, which defines all otherwise unspecified Lens.n2 media To explicitly define it for the TMA, we can provide a n0 parameter to it. Otherwise it defaults to \(n = 1\).

n0 = ot.RefractionIndex("Constant", n=1.1)
tma = L.tma(n0=n0)

Multiple Lenses

Without a specific geometry, the TMA can also be created by providing a list of lenses.

back2 = ot.SphericalSurface(r=5, R=-25)
front2 = ot.CircularSurface(r=5)
n2 = ot.presets.refraction_index.F2
L2 = ot.Lens(front, back, n=n2, de=0.5, pos=[0, 0, 16])

Ls = [L, L2]
tma = ot.TMA(Ls)

As with a single lens, set the previous ambient medium (and the medium for all undefined Lens.n2) the n0 parameter.

tma = ot.TMA(Ls, n0=n0)

4.10.3. Paraxial Properties

The following table provides an overview of supported TMA properties. Details on their definition and calculation are documented in Section 5.5, while more information on the different definitions for focal lengths and powers are found in Section 5.5.10.

Table 4.15 Properties of a TMA object

Variable

Type

Unit

Meaning

n1

float

-

refractive index value before the lens setup

n2

float

-

refractive index value after the lens setup

vertex_points

tuple[float, float]

mm

front and back position of vertices of the system

d

float

mm

thickness, distance between vertex points

abcd

numpy.ndarray, shape (2, 2)

-

ABCD matrix

principal_points

tuple[float, float]

mm

principal points (z-positions)

nodal_points

tuple[float, float]

mm

nodal points (z-positions)

optical_center

float

mm

optical center (z-position)

focal_points

tuple[float, float]

mm

focal points (z-positions)

focal_lengths

tuple[float, float]

mm

focal lengths

focal_lengths_n

tuple[float, float]

mm

focal lengths, scaled with refractive index

powers

tuple[float, float]

dpt

optical powers of the system

powers_n

tuple[float, float]

dpt

optical powers, scaled with the refractive index

efl

float

mm

effective focal length of the system

efl_n

float

mm

effective focal length, scaled by the refractive index

bfl

float

mm

back focal length

ffl

float

mm

front focal length

wl

float

nm

wavelength for the analysis

Accessing the properties as follows:

>>> tma.efl
30.645525910383494
>>> tma.abcd
array([[ 0.9046767 ,  6.50763158],
       [-0.03263119,  0.87064057]])

Image and object distance, as well as entrance and exit pupil, are available through the methods described further down below.

4.10.4. Calculating Image and Object Distance

The method image_position calculates the image position for a given object position:

>>> tma.image_position(-50)
72.87925720752206

Both input and output values are absolute positions in millimeters at the optical axis.

Conversely, an object position from a known image position is calculated with object_position:

>>> tma.object_position(100)
-33.84654855214077

In both cases, infinite values (-np.inf, np.inf) are valid inputs to the function:

>>> tma.object_position(np.inf)
-16.93123809931588

It is equivalent to the position of the first focal point:

>>> tma.focal_points[0]
-16.93123809931588

Analogously, the magnification factors at the image/object plane are found with:

>>> tma.image_magnification(-57.3)
-0.7591396036811361
>>> tma.object_magnification(18)
0.8640542105175426

A positive factor corresponds to an upright image, a negative to an inverted one. A magnitude larger than one implies magnification, a smaller number a size decrease.

Details on the implementation are described in Section 5.5.12.

Besides TMA.abcd <optrace.tracer.transfer_matrix_analysis.TMA.abcd>, which defines the system from vertex to vertex, the class also provides a convenient matrix_at, which calculates the ABCD matrix for an additional given object and image distance:

>>> tma.matrix_at(-60, 80.2)
array([[ -1.16560585, -19.55567495],
       [ -0.03263119,  -1.40538498]])

4.10.5. Calculation of Entrance and Exit Pupils

Methods for calculating the entrance and exit pupil position and magnifications are also available. Details on their computation are found in Section 5.5.14.

The following example loads the paraxial eye model from legrand_eye() and creates the TMA object:

eye = ot.presets.geometry.legrand_eye()
aps = eye.apertures[0].pos[2]
tma = eye.tma()

The method pupil_position requires an aperture stop position argument and returns a tuple of entrance and exit pupil position along the optical axis. The provided aperture position can lie inside, behind or in front of the optical system.

>>> tma.pupil_position(aps)
(3.037565216550855, 3.6821114369501466)

The method pupil_magnification calculates the corresponding pupil magnifications:

>>> tma.pupil_magnification(aps)
(1.1310996628960361, 1.0410557184750733)

4.10.6. Limitations

Pupil sizes, numerical apertures, f-numbers and airy disk diameters are not available due to current limitations of the TMA design.