pyoptics.delano

Delano’s y-ybar diagram: first order layout of optical systems.

Delano (1963) plotted the height ybar of the paraxial chief ray against the height y of the paraxial marginal ray. A system of thin lenses (or of surfaces) becomes a polygon: each corner is a lens (a surface), each edge the space between two of them. The diagram holds all first order data of the system: from it the powers, the spacings, the pupils, the cardinal points and the conjugates can be read off, and a system can be built from a polygon drawn by hand. This is how lens designers lay out complex systems such as lithographic projection lenses before any surface is bent.

Conventions

Points are P = (ybar, y), plotted with ybar on the abscissa and y on the ordinate (Delano’s original orientation). The reduced slopes are omega = n u (marginal ray) and omegabar = n ubar (chief ray), with the direction slopes u = dy/dz as in pyoptics.raytrace. The Lagrange invariant is

H = omegabar*y - omega*ybar = n (ubar y - u ybar),

the same as raytrace.Paraxial.lagrange. For two consecutive points the reduced distance tau = t/n of the space between them follows from the area of the triangle they span with the origin,

tau_k = (y_k ybar_(k+1) - ybar_k y_(k+1))/H,

and the power of a corner from the change of direction of the polygon,

phi_k = -(omegabar_(k-1) omega_k - omega_(k-1) omegabar_k)/H,

with the reduced slopes omega_k = (y_(k+1) - y_k)/tau_k of the edges. So far from the origin, a corner with a given bend has a small power, while near the origin a small bend already is a strong lens. Further properties of the diagram:

  • The object point (if finite) and the image point lie on the ybar axis (y = 0), the aperture stop and the pupils on the y axis (ybar = 0). An edge that is parallel to the y axis is a telecentric space (chief ray parallel to the axis).

  • A line through the origin cuts the polygon in conjugate points (planes that are images of each other); the ratio of the distances from the origin is their magnification.

  • The object and image space lines (first and last edges, extended) intersect in the principal points; the line through the origin parallel to the image space line meets the object space line in the front focal point and vice versa.

  • Scaling all marginal ray heights y by a factor scales all lengths by the same factor at the same Lagrange invariant, i.e. the same NA and field (DelanoDiagram.with_length()). Scaling ybar does the same at a different field.

  • The Petzval sum of thin lenses in air is sum(phi_k/n_k), independent of the heights: positive lenses far from the origin (large beams) and negative ones close to it (waists) flatten the field.

DelanoDiagram.from_system() makes the diagram of a raytrace.System (one point per surface vertex), DelanoDiagram.to_system() the thin lens system (raytrace.IdealLens) of a diagram and thicken() a system of real thick lenses with the same first order properties. refine() polishes a hand drawn diagram (Petzval sum, room for the lenses, signs of the powers) and DelanoDiagram.plot() draws it.

The polygon has to wind around the origin in one sense (counterclockwise for H < 0, i.e. object above the axis and marginal ray rising): a step back in angle is a negative distance. A positive lens is a convex corner (the polygon turns towards the origin), a negative lens a concave one.

Reference: E. Delano, “First-order design and the y, ybar diagram”, Appl. Opt. 2, 1251-1256 (1963); R. V. Shack, “Analytic system design with pencil and ruler”, Proc. SPIE 39, 127 (1973).

References

E. Delano, “First-order design and the y, ybar diagram”, Appl. Opt. 2, 1251-1256 (1963).

R. V. Shack, “Analytic system design with pencil and ruler”, Proc. SPIE 39, 127 (1973).

F. J. López-López, “The application of the Delano y-ybar diagram to optical design”, Ph.D. dissertation, University of Arizona (1973).

Classes

CardinalPoints

Cardinal points from the diagram: effective focal length (in the image space medium, efl = rear_focal - rear_principal) and z positions of the focal and principal points (physical lengths along the unfolded axis, z = 0 at the first point of the diagram); infinite for an afocal system.

DelanoDiagram

Polygon of paraxial marginal and chief ray heights (y-ybar diagram).

Pupils

z positions of the aperture stop (the crossings of the polygon with the y axis, an array) and of the entrance and exit pupils (the first and last edges extended to ybar = 0; infinite if telecentric).

Functions

principal_planes

Principal planes of a thick lens in air.

refine

Polish a hand drawn diagram: zero Petzval sum, room for the lenses, powers of the intended signs, close to the sketch.

thick_lens_curvatures

Curvatures of a thick lens in air of power phi, thickness t and Coddington shape factor X = (c1 + c2)/(c1 - c2).

thicken

System of thick singlets with the first order properties of a thin lens diagram.

class pyoptics.delano.CardinalPoints(efl, front_focal, rear_focal, front_principal, rear_principal)

Bases: tuple

Cardinal points from the diagram: effective focal length (in the image space medium, efl = rear_focal - rear_principal) and z positions of the focal and principal points (physical lengths along the unfolded axis, z = 0 at the first point of the diagram); infinite for an afocal system.

efl

Alias for field number 0

front_focal

Alias for field number 1

front_principal

Alias for field number 3

rear_focal

Alias for field number 2

rear_principal

Alias for field number 4

class pyoptics.delano.Pupils(stop, entrance, exit)

Bases: tuple

z positions of the aperture stop (the crossings of the polygon with the y axis, an array) and of the entrance and exit pupils (the first and last edges extended to ybar = 0; infinite if telecentric).

entrance

Alias for field number 1

exit

Alias for field number 2

stop

Alias for field number 0

class pyoptics.delano.DelanoDiagram(ybar, y, H, n=1.0, labels=None)[source]

Bases: object

Polygon of paraxial marginal and chief ray heights (y-ybar diagram).

Parameters:
ybar, ysequences of length K

Chief and marginal ray heights at the points (object, lenses or surfaces, image) in the order the light meets them.

Hnumber

Lagrange invariant n (ubar y - u ybar).

nnumber or sequence of length K - 1, optional

Refractive index of each space between consecutive points (signed: negative where the light travels in -z behind a mirror). Default 1.

labelssequence of str, optional

Names of the points for plot().

Notes

The reduced distances, slopes and powers follow from the points and H alone (see the module docstring); n only converts reduced to physical distances.

property points

Points (ybar, y), shape (K, 2).

property tau

Reduced distances t/n of the K - 1 spaces.

property thickness

Physical (signed) distances n*tau of the spaces.

property z

z positions of the points (unfolded, z = 0 at the first point).

property length

Total length from the first to the last point.

property slopes

Reduced slopes (omegabar, omega) = n (ubar, u) of the spaces, shape (K - 1, 2).

property power

Powers of the K - 2 inner points (thin lenses or surfaces).

property focal_length

Focal lengths n/phi of the inner points in the medium in front of them (as raytrace.IdealLens.f).

petzval_sum(n_lens)[source]

Petzval sum sum(phi_k/n_k) of thin lenses in air.

Parameters:
n_lensnumber or sequence

Refractive index of the glass of each inner point.

Returns:
Pnumber

Petzval sum (1/radius of the Petzval surface is -n’ P).

property magnification

Lateral magnification between the first and the last point, ybar[-1]/ybar[0] (meaningful if both lie on the ybar axis).

property NA

Numerical apertures |omega| of the first and the last space.

heights()[source]

Paraxial beam radius |y| + |ybar| at every point (the clear semi diameter that the full field needs).

with_length(length)[source]

Diagram with all y scaled such that the total length becomes length (same H, NA, field and magnification).

Parameters:
lengthnumber

New total length (first to last point).

Returns:
DelanoDiagram
plot(ax=None, annotate=True, color='C0', label=None, areas=False, stop=True, signs=True, **kwargs)[source]

Draw the diagram: ybar on the abscissa, y on the ordinate.

Parameters:
axmatplotlib axis, optional

Defaults to the current axis.

annotatebool, optional

Write the labels of the points next to them.

colorcolor, optional
labelstr, optional

Legend label of the polygon.

areasbool, optional

Shade the triangles spanned by the spaces with the origin (their areas are H*tau/2).

stopbool, optional

Mark the crossings with the y axis (aperture stop).

signsbool, optional

Mark positive inner points with filled, negative ones with open circles.

**kwargs

Passed to the plot of the polygon.

Returns:
axmatplotlib axis
pupils()[source]

Stop and pupil positions, see Pupils.

Returns:
Pupils
cardinal_points()[source]

Focal and principal points from the object and image space lines.

Returns:
CardinalPoints
conjugate(k, m)[source]

Point on space k of the polygon that is conjugate to point m.

Parameters:
kint

Index of the space (edge from point k to point k + 1, extended).

mint

Index of a point of the diagram.

Returns:
znumber

z position of the conjugate (on the extended edge k).

magnificationnumber

Lateral magnification from point m to its conjugate.

classmethod from_system(system, field=None)[source]

Diagram of a raytrace.System: one point per vertex, plus the object point and the paraxial image point.

For an object at infinity the first point is a point of object space instead (label “object space”), as far in front of the first vertex as the entrance pupil is from it (or the entrance pupil radius if that is zero), so that the first edge is the object space line.

Parameters:
systemraytrace.System

Centred system (tilts and decentres are ignored, as in its paraxial data).

fieldnumber, optional

Field of the chief ray (default: the maximum field of the system).

Returns:
DelanoDiagram
to_system(wavelength, units='mm', margin=None, stop=None)[source]

Thin lens system of the diagram.

The first point is the object, the last the image (both should lie on the ybar axis), every inner point an raytrace.IdealLens. A plane dummy surface is inserted as the aperture stop where the polygon crosses the y axis.

Parameters:
wavelengthnumber

Wavelength in the length unit.

unitsstr, optional

Length unit of the system.

marginnumber, optional

Semi diameters of the lenses are margin*(|y| + |ybar|); None (default): unlimited, only the stop limits the aperture.

stopint, optional

Index of the y axis crossing to use as the stop if there are several (default: the first).

Returns:
raytrace.System
pyoptics.delano.refine(diagram, n_lens, min_space=0.0, spaces=None, max_height=None, signs=None, anchor=1.0, deviation=0.1, petzval=1000.0, length=None)[source]

Polish a hand drawn diagram: zero Petzval sum, room for the lenses, powers of the intended signs, close to the sketch.

The inner points move (both coordinates; points on a telecentric first or last edge keep their ybar, so the telecentricity stays). Since the diagram is rescaled to its length (DelanoDiagram.with_length()) after every step, the NA, field and magnification stay those of the sketch. The residuals (least squares) are

  • petzval*(Petzval sum)*length (thin lenses of index n_lens),

  • spaces shorter than min_space and the deviation from target spaces,

  • beam heights |y| + |ybar| above max_height,

  • powers whose sign differs from signs (default: those of the sketch),

  • deviation*(marginal ray deviation y*phi of each lens)/(mean |y*phi|), which spreads the bending of the beam over the lenses,

  • anchor*(distance of the points from the sketch) in units of the largest |ybar| and |y| of the sketch.

Parameters:
diagramDelanoDiagram

Sketch: object first, image last, thin lenses in between.

n_lensnumber or sequence

Glass index of the lenses, for the Petzval sum.

min_spacenumber or sequence, optional

Smallest physical length of each space.

spacesdict, optional

{space index: target length} (e.g. the working distance, -1).

max_heightnumber, optional

Largest beam height |y| + |ybar| (clear semi diameter).

signssequence of +-1, optional

Signs of the lens powers.

anchor, deviation, petzvalnumbers, optional

Weights of the residuals.

lengthnumber, optional

Total length (default: that of the sketch).

Returns:
DelanoDiagram
pyoptics.delano.thick_lens_curvatures(phi, n, t, shape)[source]

Curvatures of a thick lens in air of power phi, thickness t and Coddington shape factor X = (c1 + c2)/(c1 - c2).

X = 0: equiconvex (equiconcave), X = +-1: plano-convex (concave) with the plane side second (X = 1) or first (X = -1), |X| > 1: menisci (X > 1: both centres of curvature in +z for a positive lens).

Parameters:
phinumber

Power (1/f) of the thick lens, nonzero.

nnumber

Refractive index of the glass.

tnumber

Centre thickness.

shapenumber

Shape factor X.

Returns:
c1, c2numbers

Vertex curvatures 1/R1 and 1/R2.

pyoptics.delano.principal_planes(c1, c2, n, t)[source]

Principal planes of a thick lens in air.

Parameters:
c1, c2numbers

Vertex curvatures.

nnumber

Refractive index of the glass.

tnumber

Centre thickness.

Returns:
phinumber

Power.

delta, delta_primenumbers

Distances of the front principal plane from the first vertex and of the rear principal plane from the second vertex (positive in +z).

pyoptics.delano.thicken(diagram, wavelength, material, thickness, shape, units='mm', margin=None, stop=None, n_medium=1.0, length=None, check=True)[source]

System of thick singlets with the first order properties of a thin lens diagram.

Every inner point of the diagram becomes a singlet of the given power, centre thickness and shape factor whose front principal plane lies at the end of the space in front of the thin lens and whose rear principal plane at the start of the space behind it. The paraxial rays outside the glass, and with them the stop, the pupils, the NA, the magnification and the telecentricity, stay those of the diagram; only the distance between the principal planes of each lens (the hiatus) adds to the length. With length, the diagram is scaled (DelanoDiagram.with_length()) such that the thick system has this length from object to image.

Parameters:
diagramDelanoDiagram

Thin lens diagram with the object first and the image last, spaces of index n_medium.

wavelengthnumber

Wavelength in the length unit.

materialtuple, callable, number or list of these

Glass of the lenses: (n_d, V_d), a function n(wavelength_nm) or an index (as for raytrace.Surface), one for all lenses or a list with one per lens.

thickness, shapenumber or sequence

Centre thicknesses and shape factors (see thick_lens_curvatures()), one for all lenses or one per lens.

unitsstr, optional

Length unit.

marginnumber, optional

Semi diameters of the lenses are margin*(|y| + |ybar|) of the paraxial rays at each surface; None (default): unlimited, only the stop limits the aperture.

stopint, optional

Which y axis crossing is the stop (see DelanoDiagram.to_system()).

n_mediumnumber, optional

Index of the spaces between the lenses (as the diagram’s n).

lengthnumber, optional

Object to image distance of the thick system (default: that of the diagram plus the hiatus of the lenses).

checkbool, optional

Raise a ValueError if lenses overlap (negative air spaces) or the stop falls into a lens (default). False returns such systems, e.g. for an optimization that penalizes the overlaps itself.

Returns:
raytrace.System