So 3569586

Télécharger au format pdf ou txt
Télécharger au format pdf ou txt
Vous êtes sur la page 1sur 2

OSA Optical Design and Fabrication Congress 2021 ©

IW4A.5.pdf
OSA 2021

Image Forming Design and Analysis Using Python


Michael J. Hayford
Independent, 356 E. Greystone Ave, Monrovia, Ca. 91016, USA.
mjhoptics@gmail.com

Abstract: A Python package that supports ray tracing analysis of imaging optics is described. The
modeling system is sequential but includes element and paraxial ray descriptions as well. A y-ȳ
diagram may be used to satisfy first order constraints.

©2021 Michael J. Hayford

OCIS codes: (220.2740) Geometric optical design; (080.1753) Computation Methods; (080.2468) First-order optics

1. Introduction
At the 2017 IODC, David Shafer gave a paper [1], and showed how a catadioptric design form could be improved
by evolving from some elements being used in single pass to them being used double pass. He observed that this
evolution couldn’t occur with a design program’s optimizer because the sequential modeling paradigm doesn’t
support this without additional input from the user.
This comment was a catalyst for reexamining how sequential optical modeling developed and whether it could
be “refactored” to address the modeling issue identified by Shafer without sacrificing the simplicity of sequential
model specification.
To assess the feasibility of these ideas, a software package was developed using the Python language. Python is
very advantageous for prototyping scientific software because of its broad ecosystem of open-source math and
science software packages.
2. Historical Background
The backbone of an image forming optical design program is a sequential model of the optical system. This is the
“radius, thickness, index” type of specification that was used by human computers to ray trace a system. Done by
hand, ray tracing is incredibly laborious, and methods were refined to minimize the amount of computation
necessary. This obsession with computational load was maintained in the transition to electronic computers, which
were both dreadfully slow and extremely limited in memory, not to mention challenging to program successfully.
The watershed point of the transition was the work of Spencer and Murty [2]. They laid out the steps and the
data necessary to trace a ray in general 3D coordinates with no restrictions on ray direction. Given the constraints of
computers 60 years ago, this procedure was implemented in software with the user entering the data in a form that
could be directly saved and used by the ray tracing procedure, i.e., the user interface was suborned to the needs of
the ray trace procedure. For rotationally symmetric optics, this was straightforward and efficient for the user. For
more complicated systems, the user was required to correctly build and validate the model. This could be
challenging.
Fast forward 60 years and computers are vastly more powerful in every metric: speed, RAM, storage, and
displays. This allows the needs of the ray trace procedure to be separated from the data describing the optics. The
layer(s) above the ray trace procedure can be configured to support the modeling operations as well as providing
design and analysis tools.
3. Sequential Optical Model
The vast majority of rotationally symmetric and plane symmetric optical systems can be described as a sequence of
optical interfaces, separated by gaps of material. While seemingly similar to existing specifications, this breakdown
allows both forward and backward propagation through the sequence without any user modification of the data.
The Interface API supports implementation of an optical action, such as refraction, reflection, scatter, diffraction,
etc. The Interface may be realized as a physical profile (a surface) separating the adjacent gaps or an idealized
object, such as a thin lens or 2 point HOE. Interfaces may be tilted and decentered with respect to their adjacent
gaps. Interfaces also support the idea of a boundary outside of which rays are clipped.
The Gap class maintains a simple separation (z translation) and the medium filling the gap. More complex
coordinate transformations are handled through the Interface API.
The ray trace procedure doesn’t operate directly on this data. Instead, a path() function is supplied that generates
a data structure that the ray trace procedure iterates over. This includes the interface, the refractive index following
OSA Optical Design and Fabrication Congress 2021 ©
IW4A.5.pdf
OSA 2021

the interface at the ray trace wavelength, the transformation from the previous interface to the current one, and the z
direction, along the gap, of the light propagation. Alternatively, the ray trace function can be supplied with
alternative paths through the sequence, e.g., to evaluate ghost images, again without modifying the defining
sequence.
4. Element Model
For rotationally symmetric and plane symmetric models, it is straightforward to decompose a sequential
model into an element based one. Gaps that have a non-air medium map to a refracting element. Reflecting
interfaces surrounded by air gaps map to mirrors. Cemented components and Mangin mirrors can be detected
and mapped appropriately as well. Design programs typically do this type of decomposition to draw lens
layouts, so this idea is certainly not new.
To be more useful, the element definitions are built using the relevant parts of the sequential model, e.g.,
a lens element references the profiles used in the sequence, the element thickness references the gap as does
the medium definition. These elements can be used in a very much simplified non-sequential ray trace to
generate a sequence of interfaces and gaps corresponding to the path light would take through the elements.
In this way, as elements are moved into different positions, the sequential model is dynamically updated by
adding or deleting interfaces as needed. The transition from a single pass element to a double pass one is
handled automatically.
5. Paraxial Model
Optical design is not mechanical design, and an element model leaves something to be desired when trying
to create an optical system with a specific set of first order properties. For this, the y-ȳ diagram is provided
for control of the first order properties in detail. A benefit of the y-ȳ representation is that it is ambiguous: a
node on the diagram can represent a thin lens, a lens, a mirror, components or even a complete optical system.
The diagram is set up to allow the user to work at the interface level or the system level or in between,
depending on their needs. The sequence and element models are synchronized with the y-ȳ diagram so that
changes may also be seen in the lens layout. The y-ȳ diagram also affords an easy way to change glass types
while holding the first order properties constant. Replacing diagram nodes with component definitions
provided by optical part vendors can be done as well.
5. Implementation
These ideas have been implemented in an open source, BSD-3 license, Python 3 package called
ray-optics [3]. It can be installed using pip and the Python Packaging Index (pypi) or using conda and conda-
forge. It can be used in a scripting environment (python or iPython), in a Jupyter notebook, using JupyterLab
or as a standalone application that has interactive forms of the lens layout and y-ȳ diagram.
6. Summary
Software for design and analysis of image forming optics was described. It augments sequential optical modeling
with an element based model and paraxial modeling based on the y-ȳ diagram. In addition to analyzing existing
designs, it is suited for layout of optical systems to meet a specific set of first order properties. The software is
written in Python and is available under a permissive open-source license.

[1] David Shafer, “Schmidt’s 1934 Three Lens Replacement for an Aspheric Plate, and Some New Variations,” International Optical Design
Conference 2017, eds P. Clarke, et al., Proc. of SPIE-OSA Vol. 10590, 1059015.
[2] G. H. Spencer and M. V. R. K. Murty, “General Ray-Tracing Procedure,” JOSA 52, 672-678 (1962).
[3] https://github.com/mjhoptics/ray-optics

Vous aimerez peut-être aussi