0% found this document useful (0 votes)
817 views

CODEV Ch5

The document discusses various analysis options in CODE V for evaluating optical system performance. These include diagnostic options like ray tracing and spot diagrams, geometrical options like spot diagrams and MTF calculations that ignore diffraction, and diffraction-based options like MTF, PSF, and wavefront analysis that account for the wave nature of light. It provides examples of when different analysis options would be useful and gives a partial list of the major analysis feature types available in CODE V.

Uploaded by

Sadegh Sobhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
817 views

CODEV Ch5

The document discusses various analysis options in CODE V for evaluating optical system performance. These include diagnostic options like ray tracing and spot diagrams, geometrical options like spot diagrams and MTF calculations that ignore diffraction, and diffraction-based options like MTF, PSF, and wavefront analysis that account for the wave nature of light. It provides examples of when different analysis options would be useful and gives a partial list of the major analysis feature types available in CODE V.

Uploaded by

Sadegh Sobhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Menu

Search

Chapter 4
See How It Works: Analysis

Once a lens is defined, analysis options let you measure its performance in various
ways. These range from simple ray tracing, to spot diagrams, to wave-based
calculations such as MTF, RMS wavefront error, point spread function (PSF), and
even diffraction beam propagation. Most of these CODE V options have graphics.
Input and output examples for selected features are shown in this chapter. A guide to
supplied analysis macros is also included.

Contents

Analysis Options in CODE V.....................................................................................78


Diagnostic Analysis ....................................................................................................84
Geometrical Analysis..................................................................................................99
Diffraction Analysis..................................................................................................104
Analysis Macros .......................................................................................................116
Multilayer Coating Design .......................................................................................118

CODE V Introductory User’s Guide 77


Chapter 4 See How It Works: Analysis
Menu

Analysis Options in CODE V


Search The performance of an optical system can be specified and described in many ways.
CODE V has several categories of analysis, each with a number of options.

Note: Most analysis features are true CODE V options (executed with a GO in the
Command Window). However, some are actually LDM commands that run with a
single command, while others are really macros. These distinctions are only
important for command use, and they are noted with comments in the command
listings in Appendix A, “Commands for Examples” on page 251.

Diagnostic Analysis
Diagnostic analysis features can help you understand the details of an optical
system under design. They found in the Analysis > Diagnostics menu, and are
based on real or paraxial ray tracing presented in various ways. Here are a few
examples of when you would use particular diagnostics:
• Paraxial ray trace (FIO) can show you where pupils and intermediate images
are located.
• Real ray trace (RSI, SIN) displays specific ray paths in great detail, helping
you determine aperture sizes and evaluate problems with reference rays that can
prevent other calculations from running.
• Field curves (FIE) are plots of field-dependent aberrations, specifically
astigmatism and distortion.
• Gaussian beam trace (BEA) shows the behavior of “slow” beams, typically in
laser systems. They provide information on beam waists and spot sizes.
• Pupil maps (PMA) can show you the distribution of OPD (optical path
difference) in the exit pupil. They can also show pupil intensity and ray failure
locations.
• Field maps (FMA) present various analysis results as a grid of field points,
helping you to visualize the variation of performance across the field of view or
image format.
• Footprint plots (FOO) show the extent of rays from all fields and zoom
positions on a designated surface. They can help to identify undesired clipping
by undersized apertures.

78 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Some diagnostic features were used in earlier chapters. Additional features will be
demonstrated in this chapter. There are more features on the Diagnostics menu,
Search some of them very specialized (e.g., biocular FOV plots only apply to certain visual
display systems such as head-up displays). See the CODE V Reference Manual or
help for more information.

Tip: The easiest way to learn about a feature on the Analysis menu is to select it
from the menu, displaying its input dialog box. Then hit the F1 key to display
context-sensitive help for the feature. Many help topics have multiple pages. Use
the double arrow buttons (>> and <<) to move through the pages that relate to your
topic.

Geometrical Analysis
Image options evaluate total system performance in various ways, usually by
tracing a grid of rays to simulate an input beam or wave front. Geometrical analysis
ignores diffraction effects, so in geometrical terms, a perfect system can have an
image spot size of zero, even though diffraction causes even perfectly corrected
systems to have a finite spot size.

Note: The geometrical and diffraction analysis features of CODE V are based on
grids of rays. It is important to trace enough rays for good sampling across the pupil
of the system. Defaults will usually work, but if there are non-spherical surfaces,
obscurations, or other special features, you may wish to trace more rays. Most
options have a feature called number of rays across diameter (NRD) that controls
the ray density.

Here is a partial list of geometrically based options:


• Spot diagram (SPO) shows the ray-based geometrical shape of the image
distribution for each field point. It gives a good visual impression of image
quality.
• Radial Energy Analysis (RAD) is a quantitative analysis of the spot diagram,
giving the diameters containing specified percentages of energy.
• Detector Analysis (GDE) calculates geometric ray throughput as well as the
amount of energy (rays) falling on detectors of specified size and positions.

CODE V Introductory User’s Guide 79


Chapter 4 See How It Works: Analysis
Menu

Diffraction Analysis
Diffraction-based calculations take into account the wave nature of light. With the
Search
exception of the Beam Synthesis Propagation (BSP) and Beam Propagation (BPR)
options, all diffraction-based calculations use conventional ray tracing up to the exit
pupil of the system, at which point OPD values are calculated for the ray grid, along
with the shape (due to apertures) and transmission (due to apodization, polarization
effects, and pupil aberration) of the pupil. This pupil function is then transformed to
give the desired result (MTF, PSF, etc.).
The BSP and BPR options work differently and can properly consider diffraction
effects at surfaces prior to the exit pupil. See the CODE V Reference Manual for
discussion and examples of these options.
Here is a partial list of diffraction-based options. With the exceptions of beam
propagation and coupling efficiency, diffraction-based options are polychromatic,
using the wavelengths and spectral weights defined in the LDM.
• MTF is used to determine the frequency response of the system. Characteristics
such as sharpness and resolution can be related to MTF.
• Point Spread Function (PSF) calculates the image of a point object. Several
other calculations are actually derived from the PSF, including Line Spread
Function (LSF), Encircled Energy, and Detector Energy.
• Wavefront Analysis (WAV) calculates the polychromatic RMS wavefront error
and also performs best-focus calculations based on the wavefront.
• 2D Image Simulation (IMS) simulates the appearance of a 2D input object as it
is imaged through the optical system defined in CODE V.
• Partial Coherence (PAR) is a specialized but powerful option, used mainly to
analyze microlithography systems, though it can be applied to other projection
systems that use partially coherent illumination.
• Beam Propagation (BPR) uses special methods to translate between ray and
wavefront representations throughout the optical system (not only at the exit
pupil). Free-space beam propagation is important in systems with slow beams
and spatial filters, among other cases. Careful attention to sampling is important
with BPR.
• Beam Synthesis Propagation (BSP) uses a highly accurate, beamlet-based
diffraction propagation method for optical field propagation and includes
diffraction effects through the entire optical system.
• Fiber Coupling Efficiency (CEF) is another specialized option based on the
PSF. It is used to determine the amount of energy coupled from an optical
system into a single-mode optical fiber.

80 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Other Analysis
As with other categories, this is not a complete list of the available features. Select
Search
any item from the menu and press F1 to see help on that feature.
The Analysis > Fabrication Support menu includes several analysis options
related to fabrication:
• Fabrication Data Tables (FAB) is a utility for displaying fabrication-related
data, including aspheric sag tables and displays of interferogram (.INT) files.
• Cost analysis (COS) evaluates blocking factors, glass cost, and other factors to
estimate the relative cost of one design compared to another.
• Weight (WEI) calculates the volume and weight of the optical elements.
The Analysis > System menu items concern non-imaging properties of a lens
system:
• Spectral analysis (SPE) can combine various spectral response curves (filters,
detectors, etc.) into a single set of spectral weights that can be applied to the
lens.
• Spectral transmission (TRA) calculates system transmission, including the
effects of optional multilayer coatings.
• Ghost and Narcissus image analysis (GHO, NAR) are paraxially based options
for evaluating unwanted secondary images.
• Illumination (LUM) uses Monte Carlo methods to evaluate illuminance from
point or extended sources of various types.
There are also features for the analysis of tolerancing effects (see Chapter 5), as
well as many special purpose analysis macros supplied with CODE V.

CODE V Introductory User’s Guide 81


Chapter 4 See How It Works: Analysis
Menu

The Role of Apertures in Analysis


Analysis calculations can be broken into two important categories according to
Search
their use of surface apertures:
• Calculations that ignore apertures. These include most of the diagnostic
analysis features, plus Automatic Design (not an analysis option, but an
important one to understand). These features either use the pupil size and
vignetting factors to define the sizes of beams, or in a few cases, they do not
depend on beam sizes at all.
• Calculations where apertures are essential. These include all of the options
on the Geometrical and Diffraction sub-menus, as well as the diagnostic options
Pupil Map, Field Map, Footprint Plot, Catseye Plot, and Biocular FOV Plot.
This is an important distinction.

Tip: A rule of thumb for knowing if an analysis option uses surface apertures is
whether it traces a grid of rays. If it traces a grid of rays, it will use apertures, and
it will probably include an input for Number of Rays Across Diameter (NRD).

If apertures are used in an analysis option you are running, you should be sure that
you have an appropriate set of apertures defined. What is appropriate? You should
have a user defined aperture on one or more critical (ray limiting) surfaces other
than the stop. If you do not have user-defined apertures, you should at least verify
that the default apertures make sense for your lens. If you have only a single field
point, or if there are surfaces with an intermediate focus nearby, the default
apertures may cause problems.

Clear Aperture Control (CA command)


Assuming you have user-defined apertures on critical surfaces, you can still have
problems with CODE V-calculated default apertures in a few places (especially
surfaces near images, intermediate or final). The best solution to this is to turn off
default aperture checking with the Clear Aperture Control, also called the Apertures
Used control.

82 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

This control is set on a per-lens basis (i.e., it cannot be set globally for all lenses),
and the safest setting is User-Defined Only.
Search
1. Choose the Lens > System Data menu, and go to the System Settings page in
the System Data window.
2. Choose User-Defined Only from the Apertures Used dropdown list.

The command for this is CA APE.


For more information about the important subject of apertures in CODE V, see
Chapter 10 in this guide, as well as “Defining Apertures” on page 9-4 in the
CODE V Reference Manual.

Note: The examples in the following sections use various CODE V Sample lenses.
To keep the descriptions shorter, only the file names are given. You can use the
File > Open menu to locate these lenses in the installation directory (subdirectory:
lens), or use the New Lens Wizard to open each lens. You can also open the lens
with the RES command in the Command Window. For example:
RES CV_LENS:eyepiece.len.

CODE V Introductory User’s Guide 83


Chapter 4 See How It Works: Analysis
Menu

Diagnostic Analysis
Search This section contains examples of several diagnostic features.

Paraxial Ray Trace (FIO)


Paraxial or first-order ray tracing is a linearized approximation of real ray behavior.
Although the computer now makes it easy to trace real rays, there are a number of
properties that still make paraxial ray tracing useful. System properties such as EFL
(effective focal length) are defined in paraxial terms. Paraxial ray slopes and
coordinates are linearly related to curvatures and thickness values, making them
useful for solves, which specify thickness or curvature indirectly in terms of
paraxial ray properties.
Paraxial ray trace tables show only two rays, the paraxial marginal ray (from center
of object to edge of entrance pupil) and full-field paraxial chief ray (from top of
object to center of entrance pupil). Any other paraxial ray data can be derived from
these two rays.

How to Use
1. Open the lens file CV_LENS:eyepiece.len and make a picture with the
Quick 2D - Labeled button.

This is an Erfle eyepiece lens, and it is set up in the standard form for such
lenses, “backwards,” with the eye position as the aperture stop at the left.

84 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

2. Choose the Analysis > Diagnostics > Paraxial Ray Trace menu.
The Paraxial Ray Trace dialog box is displayed.
Search

3. Click OK in the dialog box, accepting the default surface range (object to
image).

Although the lens picture shows real rays (not paraxial), look at the picture as you
interpret the data in the paraxial ray table.
• The stop is in front for this lens, so the EP (entrance pupil) data and stop
surface data are identical in this case.
• The marginal ray height (HMY) at surface 1 (Stop) is 10 mm, which is half of
the EPD. The object distance is infinite, so this ray is collimated at s1 (parallel
to Z axis), and its marginal slope angle (UMY) is therefore zero. HMY is zero
only at the image surface, so there are no intermediate images in this system.
• The paraxial chief ray height (HCY) is zero at the stop, as it would be at any
pupil surface (all other HCY values are non-zero, so there are no intermediate

CODE V Introductory User’s Guide 85


Chapter 4 See How It Works: Analysis
Menu

pupils in this lens, and exit pupil data is not shown). The entering slope of the
chief ray (UCY) is 0.577350, which is the tangent of 30°, the maximum semi-
Search field angle for this lens.
• The paraxial chief ray slope (UCY) at the image surface is small (0.02), which
indicates that the lens is nearly telecentric in image space (chief rays from all
fields nearly parallel to axis ). A solve on chief ray slope (0.0) is one way to
specify image-side telecentricity.
Paraxial ray trace data is very basic, but it is quite useful in understanding and
specifying the performance of a lens.

Real Ray Trace (RSI, SIN)


Sometimes tracing a few single rays can help you to figure out problems with
apertures, edges, etc. Analysis > Diagnostics > Real Ray Trace controls which
rays are traced, various options on defining them, and the format of the ray output.
This feature does not have any graphical output, but you can use the View Lens
option as a visual aid, placing the same single rays on lens drawings to help you
interpret the tabular output.

Defining Single Rays


Single rays are defined by their position on the object surface (where they start) and
their position in the entrance pupil (where they enter the lens). The position on the
object is given either as X and Y fractions of the maximum object height in each
direction (X,Y), or by specifying one of the fields defined with the lens data (F1,
F2, etc.). The pupil position is similar – it is defined as X and Y fractions of the
paraxial pupil radius, or by choosing one of the reference rays from a pre-defined
field (e.g., R1 chief ray, R2 +Y marginal ray, etc.). Note that if you specify a field
number and reference ray number, the vignetting factor for that reference ray will
be applied. Vignetting factors are never used when relative field or pupil
coordinates are specified.

How to Use
1. Open the lens CV_LENS:eyepiece.len.
2. This is the same lens used for the paraxial ray trace example above, allowing
comparison of real and paraxial data if you choose the right real rays. We will
trace the real full-field chief ray since this corresponds to the paraxial chief ray.
This ray is shown for reference on a lens drawing below. Since VIEW is not the
point of this discussion, we will save space by giving you the commands to

86 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

create this plot. Type this line in the Command Window and press the Enter
key:
Search VIEW ; RFR NO; RSI F3 0 0 ; NBR SUR SA ; GO

3. Choose the Analysis > Diagnostics > Real Ray Trace menu.
The Real Ray Trace dialog box is displayed.

4. Click the Relative Pupil checkbox, and enter 0.0 for X and 0.0 for Y.
These are the default values, the center of the pupil, which defines a chief ray.

CODE V Introductory User’s Guide 87


Chapter 4 See How It Works: Analysis
Menu

5. Choose F3 from the Field Number dropdown.


This is one of the predefined fields, the alternative to entering relative field
Search
coordinates, which would be (X=0, Y=1).
6. Click OK.

Compare this table to the previous paraxial ray trace table on page 85. Y corre-
sponds to HCY (paraxial chief ray Y height), and TANY (tangent of the angle
between the ray and the Z axis in the YZ plane) corresponds to UCY (paraxial
chief ray slope angle). X coordinates are zero since this ray lies in the YZ plane.
LENGTH is measured along the ray for each surface segment.
Note that the ray heights (Y vs. HCY) are similar but not the same – paraxial ray
tracing is only an approximation for lenses with finite field and aperture. Parax-
ial ray slopes are very different (TANY vs. UCY), although the starting value is
the same (0.57735, the tangent of 30°). The difference between the real and
paraxial ray heights on the image is distortion – about 8% in this case (check
this with the Analysis > Diagnostics > Field Curves menu, results not shown).

88 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Output Format (ROF)


The output shown above is the default display, but there are many more parameters
Search
that can be displayed. The Output Format tab in the Real Ray Trace dialog box
lets you choose what to display from a large list. In the screen shot below, L and M
direction cosines have been added, and the N direction cosine is about to be added.
When you change the format (ROF command), you must re-run the ray trace to see
the new format.

In command form, the ray you just traced is RSI F3 0.0 0.0 (RSI means
relative single ray). The online Help has information on the many other options for
tracing single rays through this dialog box and in command form. Pressing F1 with
the dialog box open is a good starting point.

Ray Aberration Curves (RIM)


Ray aberration curves plot transverse aberration (vertical coordinate; measured in
lens units on the image surface) against position in the normalized aperture stop or
entrance pupil (horizontal coordinate; typically not labeled, the endpoint
representing 100% of the normalized stop or pupil). These curves are sometimes
called “ray fan plots” or “rim ray plots,” and this is the origin of the CODE V
command name, RIM.

CODE V Introductory User’s Guide 89


Chapter 4 See How It Works: Analysis
Menu

Description
All fields and wavelengths are plotted as a single display (one for each zoom
Search
position in zoomed systems). Tangential (Y-Z plane) and sagittal (X-Z plane) fans
of rays are traced from each field. Any vignetting is indicated by stopping the
plotted curve at the point in the entrance pupil where vignetting takes place.
The shape of the aberration curves can help to identify the types and amounts of
aberration that are present. For example, a parabolic shape is characteristic of coma,
while the slope of the curve at the origin is an indication of defocus, and of field
curvature if it varies with field.

How to Use
1. Open the lens file CV_LENS:telephot.len.

2. For a quick default plot with no inputs, click the Quick Ray Aberration Plot
button on the Quick Analysis toolbar.

This actually runs a macro which produces an automatically scaled ray aberra-
tion plot (output not shown), and also displays tabular ray fan data on the Text
tab of the output window (from the ANA option).
3. For the general case, choose the Analysis > Diagnostics > Ray Aberration
Curves menu.
The Ray Aberrations Curves dialog box is displayed.

90 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Search

4. Click OK to accept the default settings and run the option.


The following output is generated in a tabbed output window.

RIM does not automatically scale to fit the data—it uses standard default values
(0.05 for systems in mm), regardless of how this looks! This means that you are

CODE V Introductory User’s Guide 91


Chapter 4 See How It Works: Analysis
Menu

not likely to think that a poor system is well-corrected, but this is a small advan-
tage (you should always zoom in with the mouse to be sure of the scale on any
Search analysis graphic). Recall that the Quick version does auto-scale (thanks to a hid-
den macro), so you can always use that if you prefer.
5. Click the Modify Settings button and enter 0.2 in the field labeled Scale
(Aberration/Inch), then click OK.
Note that the term Aberration/inch refers to the plotting scale on a full-size
hardcopy plot. This label does not change with system dimensions, though the
data and plot labels will use the correct system dimensions (usually mm).

Note lower pupil


vignetting

The 0.2 mm/inch plot looks a little more reasonable. The separated off-axis curves
for the three wavelengths show chromatic aberration (lateral color). The
downward-opening off-axis curves show mainly coma. You can look in any of the
optical design reference books for discussions on how to interpret ray aberration
curve shapes in terms of aberrations.

Pupil Map (PMA)


The Pupil Map (PMA) option displays optical path difference (OPD) and a few
other quantities as a function of position in the exit pupil. This grid of wave
aberration data is the basic input to diffraction analysis features such as MTF and
PSF, but it is considered a diagnostic analysis because it provides information about
aberration as well as pupil shape, which is derived indirectly (by ray tracing) from
surface aperture data.

92 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

How to Use
1. Open the lens CV_LENS:maksutov.len
Search

This is a catadioptric (reflecting/refracting hybrid) objective, essentially a


reflecting telephoto lens. It has a central obscuration and only one wavelength,
which is a good thing with PMA, since it produces separate outputs for every
wavelength, field, and zoom position.
2. Choose the Analysis > Diagnostics > Pupil Map menu.
The Pupil Map dialog box is displayed.

3. On the Display tab, keep the default setting Wave aberration map.

CODE V Introductory User’s Guide 93


Chapter 4 See How It Works: Analysis
Menu

Search Note: This is one of five quantities that can be displayed, including pupil intensity
(PIN) and ray failure map (RAC). The latter is a very useful display when you find
that rays are being blocked unexpectedly (e.g., when you note that the number of
rays traced is unusually low in some option such as MTF).

4. On the Output Controls tab, click the Compact output box (this removes
blank lines from the text maps).

5. On the Color Display tab, make sure that Color Display is checked and
Interferogram fringes is NOT checked.

Note that there are other tabs, including one used to produce Zernike polyno-
mial fits to the wave front data. The other tabs are not needed in the example.
6. Click OK to run PMA.

94 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Search

PMA produces a text tab, plus one 3D projection plot and one shaded raster plot
for each field point. The text output includes large maps (64 x 64 block of data
embedded in 128 x 128 grid, by default) as well as wave front fitting informa-
tion at the bottom of each field's block of data (RMS with tilt and focus
removed).

The text map is very detailed, but the graphical versions are easier to interpret. The
3D projection plot gives an idea of the shape of the wave front. The shaded raster
display gives the same information in color-coded form and clearly shows the pupil
shape and central obscuration.
The PMA option is very useful, especially in conjunction with diffraction (wave-
based) calculations such as MTF and PSF.
CODE V Introductory User’s Guide 95
Chapter 4 See How It Works: Analysis
Menu

Footprint Plot (FOO)


Footprint refers to the shape of the illuminated region of any surface that is defined
Search
by the outlines (boundary) of rays from all field and zoom positions. The Footprint
Plot option (FOO) defines surface apertures that will pass all the rays from all fields
and zooms without clipping (or with only planned clipping). It also has a grid mode
that functions as a multi-field spot diagram available on any surface.

How to Use
1. Open the lens file CV_LENS:scanlens.len
This is a 3-position zoom model of an f-theta scan lens (zoom will be discussed
in Chapter 9). A 3D picture will be helpful.
2. Choose the Tools > Macro Manager menu to locate the supplied macro
QuickView.seq under Sample Macros / Utilities. Then click the Run button.
The input dialog box for the macro is displayed. This is a useful macro to add to
the toolbar (Tools > Customize menu).

3. Change the settings of the macro dialog to match the preceding picture and click
OK to run the macro.

96 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

The following output is generated.

Search

The numbered, 3D lens picture (from the VIEW option) will help you interpret
the results from FOO.
4. Choose the Analysis > Diagnostics > Footprint Plot menu.
The Footprint Plot dialog box is displayed.

5. Double-click the End Surface cell under Designated Surface Range and
change it to Image. This will make footprint plots on all surfaces.

CODE V Introductory User’s Guide 97


Chapter 4 See How It Works: Analysis
Menu

6. On the Graphics Controls tab, choose a color from the list under Draw
Aperture Limits.
Search

7. Click OK.
The following output is generated.

The footprint plot for surface 4 is shown. Note that the rectangle represents the
rectangular aperture on the surface (see Review > Apertures). The beams from
each of the three zoom (scan) positions are circular and don't appear to be clipped
by any of the apertures in the system.

98 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Geometrical Analysis
Search Although most of CODE V is based on geometrical ray tracing, only a few options
that trace grids of rays, honor surface apertures, and ignore diffraction effects are in
the geometrical analysis category.

Spot Diagram (SPO)


Spot diagrams (SPO option) show the geometrical structure of the image. They are
particularly useful for non-diffraction-limited systems. Doing a spot diagram in
color (each wavelength plotted in a different color, which is the default behavior)
can also contribute to an understanding of chromatic aberrations.

How to Use
1. Open the lens CV_LENS:telephot.len
This is the same lens used in the earlier ray aberration plot example.

2. Choose the Analysis > Geometrical > Spot Diagram menu.


The Spot Diagram dialog box is displayed.

CODE V Introductory User’s Guide 99


Chapter 4 See How It Works: Analysis
Menu

Although automatic scaling is the default, you can set a scale factor, change the
number of rays traced, and change the labeling and color-coding.
Search
3. The defaults are OK in this case, so click OK to run the SPO option.
The following output is generated.

The primary output of SPOT is the graphical output. By default, an evenly-spaced


rectangular grid of rays in the entrance pupil is traced to the image surface for all
LDM-defined wavelengths, fields, focus positions, and active zoom positions. You
can also choose a circular or quasi-random (Sobol) grid of rays. The various field
positions are plotted vertically, while multiple focal positions (if defined in LDM)
are plotted horizontally.
A table showing the number of rays attempted and the numbers reaching the image
surface is displayed in the Text tab. The difference represents rays blocked by
apertures and obscurations. Also listed are: the centroid data (position of the
centroid with respect to the chief ray) and the minimum RMS spot size diameter;
the displacement of the 100% spot center from the chief ray and the minimum
100% spot size diameter; and the number of rays in the grid used to compute the
spot sizes.

100 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Through-Focus Spot Diagrams


By defining through-focus parameters in the LDM (choose the Lens > System
Search
Data > Through Focus menu), you can display through-focus spot diagrams. Up
to 18 focal positions may be plotted in this manner. SPOT will automatically plot
the through-focus positions if they are defined in the LDM. The following example
is for 5 positions starting at -1 mm in steps of 0.5 mm.

Radial Energy Analysis (RAD)


Use the Radial Energy Analysis option (RAD) to calculate the fraction of energy
enclosed in circles of minimum radius – the radial energy distribution of the
geometrical spot diagram at each field. You may relate this to the size of the
detector that will be used, perhaps with a goal such as 80% of encircled energy
within the detector diameter.

Calculations
Radial energy distribution, also known as encircled energy, provides quantitative
spot size information based on a geometrical ray trace spot diagram. An evenly-
spaced rectangular grid of rays in the entrance pupil is traced to the image surface
for all LDM-defined wavelengths, fields, focus positions, and active zoom
positions. Each ray is assumed to carry energy proportional to its wavelength
weight (WTW, in the LDM).

CODE V Introductory User’s Guide 101


Chapter 4 See How It Works: Analysis
Menu

On the image surface, encircled energy is determined by counting the rays


contained within circles of increasing radius. The diameter and position of the
Search circle is varied to find the minimum sized circle containing each specified
percentage of energy.

How to Use
1. Open the lens CV_LENS:telephot.len
This is the same lens used in the earlier ray aberration plot and spot diagram
examples.

2. Choose the Analysis > Geometrical > Radial Energy Analysis menu.
The Radial Energy Analysis dialog box is displayed.

The default assumptions include standard percentages (10, 20, etc.), although
you can override this by entering specific percentages of interest. Scanning in
this context refers to the determination of the center point that minimizes the
size of the circle for each percentage. The defaults are appropriate for this
system.

102 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

3. Click OK to generate the following output.

Search

The text output includes a table for each field point, with additional columns for
through-focus positions if defined in the LDM. Note that spot diameters are
displayed.
Graphical output places all the field points on a single plot. A well-defined core
in the spot diagram will result in a large slope, while a low slope indicates a
large, more diffuse spot.

Note that if you defined through-focus positions for the previous spot diagram
example and did not remove them, you will see additional output. Each focus
position will produce a column in the text output tab as well as its own plot tab.

CODE V Introductory User’s Guide 103


Chapter 4 See How It Works: Analysis
Menu

Diffraction Analysis
Search Diffraction analysis calculations take into account the wave nature of light, so that
even a perfectly corrected system will have a finite image spot size and frequency
response. Four example options are shown here out of a total of twelve Analysis >
Diffraction menu items. Input for other options is similar to these examples, and
the CODE V Reference Manual has full details and more examples.

MTF
The use and interpretation of results for the MTF option were discussed extensively
in Chapter 2 and Chapter 3 of this guide. MTF essentially analyzes the spatial
frequency response of an optical system. Several examples of MTF frequency plots
were shown.
One thing that was not covered was through-focus MTF plots. By this we mean a
plot of MTF at a particular spatial frequency, as a function of focus shift. The focus
shift data must be supplied in the LDM (System Data). Here is a quick example of
the procedure.
1. Open the lens file CV_LENS:cooke1.len.
2. Choose the Lens > System Data menu and go to the Through Focus page.
3. Enter 5 for the Number of Focus Positions, -0.5 for First Focus Position, and
0.25 for Focus Position Increment.
4. Choose the Analysis > Diffraction > MTF menu and enter 75 for the
Maximum Frequency, and 15 for the Increment in Frequency.
5. Click on the Graphics tab and enter data as shown below.

104 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

6. Click OK.
The following output is generated.
Search

Point Spread Function (PSF)


The Point Spread Function option (PSF) gives detailed image structure information
including all diffraction effects. As with all diffraction-based options, the PSF is
calculated from real-ray trace OPDs. This assures that the effects of aberrations,
asymmetries, apertures, obscurations, etc., are all included.

Calculation Considerations
The PSF option first calculates the pupil function from the grid of ray-traced OPDs
calculated in the exit pupil. This pupil function is then embedded in a Fourier
transform grid and a fast Fourier transform (FFT) is used to calculate the PSF.
Because a finite sampling grid is used, care must be taken with aberrated systems to
prevent overflowing the grid when the spot size is large. The default grid size
(128x128) works well for reasonably well-corrected systems. The CODE V
Reference Manual has information on how the grid size parameters interact: see
“Discussion of Input and Computations” on page 21-377 of the CODE V Reference
Manual.

CODE V Introductory User’s Guide 105


Chapter 4 See How It Works: Analysis
Menu

How to Use
1. Open the lens file CV_LENS:threemir.len.
Search
Following is a sample Quick Hidden Line plot showing what this system looks
like.

This is an all-reflecting design, with tilted and decentered rectangular mirrors.


2. Choose the Analysis > Diffraction > Point Spread Function menu.
3. Click the Computation tab and change the focal plane increment to 0.001 mm
and the region of interest to 50.

106 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

You would normally use default values first (0.0006 mm for the grid incre-
ment). You might then change the focal plane increment from the default to a
Search more convenient value. You can usually change within a factor of two, as long
as good sampling is maintained in the pupil (check pupil grid in text output) and
on the image. Region of interest allows “zooming in” on the area of the 128 x
128 grid that contains the interesting data (50x50 grid in this case).
4. Click the Output Controls tab and select Compact output (leave List output
and PSF plot items checked).

5. Click the Color Display tab and click the Color display checkbox, then click
OK.

The text output is shown for one of the five field points (F4). It shows the “raw
data,” relative intensity values scaled to 100, on a grid with 0.001 mm cells,
with the grid center point (65, 65) located at the chief ray.

CODE V Introductory User’s Guide 107


Chapter 4 See How It Works: Analysis
Menu

Search

Graphical output shows the distribution as a 3D projection and as a false-color


raster plot (both shown for F4, the fourth of five fields in this lens).

108 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Wavefront Analysis (WAV)


RMS (root mean square) wavefront (WAV) error is a useful figure of merit for
Search
certain types of optical systems. The WAV option traces a regular grid of rays
through the entrance pupil from each field and in each defined wavelength,
calculating an OPD for each ray. The polychromatically weighted RMS is
calculated for this grid of rays from each field.

Note: OPD (optical path difference) is the difference in optical path length between
a particular ray and a reference ray (normally the chief ray). For a perfect spherical
wavefront, OPD will be zero for every point in the pupil. OPD is normally
expressed as number or fraction of the wavelength.

Calculations
In the default mode (best focus, BES), focal shifts and lateral shifts are calculated
that will minimize the RMS wavefront error. This is done separately by field and
also on a composite basis (“average” best focus over field and zoom). Other
calculation options are the RMS at the nominal focus (NOM), or through-focus
(THR), using the focal position data defined in the LDM. The current focal position
value can also be replaced (RFO) with the WAV-determined best focus. You can use
this to refocus the lens, or click the Quick Best Focus button on the Quick Analysis
toolbar to do the same thing with no further input. WAV uses any Gaussian or other
apodization data defined in the LDM, typically used to simulate laser input beams.
You can also change the number of rays used in the calculation, the relative field
weights for composite calculations, and zoom coupling codes (see the CODE V
Reference Manual).

How to Use
1. Open the lens CV_LENS:cooke1.len.
This lens was used as the MTF example, above.
2. Choose the Analysis > Diffraction > Wavefront Analysis menu.
3. Click the Apply Focus Shift checkbox.

CODE V Introductory User’s Guide 109


Chapter 4 See How It Works: Analysis
Menu

Search

4. Click OK to accept these settings and run the calculation.

Output

WAV output shows the best focus for each field individually, along with the
corresponding RMS value. In the second set of columns (labeled Best Composite
Focus), the field weighted best focus is shown; note that the focus value is the same
for all three fields. This is the focal shift that is added to the image surface defocus.
The field-weighted Composite RMS is also shown.
In addition to the RMS values, well-corrected systems (RMS < 0.1 wave) will also
have values displayed for the Strehl ratio. This is defined as the ratio of the intensity
at the peak of the point spread function (PSF) of the actual system to that of a
corresponding aberration-free PSF. The triplet meets the requirement for the on-
axis field (F1), but zeros are printed for the other fields.

110 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

2D Image Simulation (IMS)


The 2D Image Simulation (IMS) option creates an accurate representation of a 2D
Search
input object as it is imaged through the optical system defined in CODE V.
Simulations include the effects of distortion, aberration blurring, diffraction
blurring, relative illumination, and, optionally, blurring due to detector size. This
feature is highly useful for design evaluations and presentations.

Calculations
In the default mode, IMS generates a grayscale image of a U.S. Air Force
resolution target for the resident lens system. The original target is also displayed.
The semi-diagonal of the object file is mapped to the maximum field of view for the
lens. When using IMS, you can designate the following settings and calculation
options:
• Define the input object. There are a number of sample input object files
provided with CODE V, in the image subdirectory of the CODE V installation
directory. Or, you can designate your own input object file. The input object file
is a bitmap file (.BMP format). You can also define the field size and position of
the input object with respect to one of the four field coordinate systems
supported by CODE V.
• Define the Point Spread Function (PSF) controls. This includes defining
standard PSF controls such as the FFT grid size, number of rays across the
diameter, and the focal plane increment. You can also define the grid of PSFs to
be computed over the object, and optionally enter the detector size to include
detector blurring effects.
• Define the color computation method. This includes polychromatic intensity,
RGB, or three-wavelength color. For example, polychromatic intensity
performs a polychromatic PSF for all system wavelengths. The result is an 8-bit
grayscale image. This is the default.
• Define the output. By default, the object file and image simulation result will be
displayed. You can also choose to display the PSF map, and save the image
simulation result into an output file in bitmap (BMP), JPEG, and Portable
Network Graphics (PNG) formats.
For more details about all these settings, see “IMS - 2D Image Simulation” on
page 21-233 of the CODE V Reference Manual.

CODE V Introductory User’s Guide 111


Chapter 4 See How It Works: Analysis
Menu

How to Use
1. Open the lens CV_LENS:fisheye.len.
Search
The fisheye sample lens is useful for showing how IMS can simulate distortion
effects.
2. Change the Y Angle of the last field of the fisheye lens to 65 degrees (Lens >
System Data window, Fields/Vignetting page). Click the Set Vignetting
button since you changed the field angle value.

3. Choose the Analysis > Diffraction > 2D Image Simulation menu.


4. In the 2D Image Simulation dialog box on the Object Controls tab, the U.S.
Air Force resolution target (default.bmp file) is selected by default in the Object
Filename field. This input object file is useful for this example, so you do not
need to change it.
Note that you can save your own bitmap file as default.bmp in the \image
subdirectory of the CODE V installation directory, and that bitmap will be your
default IMS input object.
5. Click the PSF Controls tab and change the FFT Grid size to 256.

112 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Search

Leave the Number of Samples in X and Y set to 5. This typically defines the
number of samples in X and Y at which the PSF is computed. CODE V detects
that the fisheye lens has rotational symmetry and automatically selects the
System has Rotational Symmetry checkbox. In this case, IMS performs a
more efficient calculation and uses the maximum of either the number of
samples in X or Y to define a radial link of PSFs, which are used across the
entire field of view.
6. Click the Color Controls tab, and notice that the color computational method is
by default set to Polychromatic Intensity. This will create a polychromatic
PSF for all system wavelengths and corresponding weights. Leave this setting
as is for this example.

CODE V Introductory User’s Guide 113


Chapter 4 See How It Works: Analysis
Menu

Search

The other two color computation methods are:


– RGB, which allows up to 20 wavelengths to define each red, green, and blue
spectral band, resulting in a 24-bit color image. You can also request
grayscale output on the Output Controls tab when using this method.
– 3-Wavelength Color, which maps the first (long), reference, and last (short)
system wavelength with unity weights to red, green, and blue, respectively.
The result is a 24-bit image.
7. Click OK to accept these settings and run the IMS option.

Output
IMS’ default graphical output shows the original input object file on one tab, and
the image simulation of that object on a separate tab, as shown in the following
figures.

114 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Search

Input object

IMS result: Polychromatic


Intensity (8-bit image)

In order to facilitate image orientation analysis, the initial IMS result is displayed
relative to the image surface coordinate system with “Y” up. The “Z” axis will
either be into or out of the screen. Light is always assumed to be traveling towards
the observer.
When interpreting results from displayed graphic images, it is very important to
understand issues related to the gamma associated with the file and display. See
“Gamma Issues for Displaying, Printing, and Saving Files” on page 21-263 in the
CODE V Reference Manual for details. This information is especially important if
the displayed object or IMS result appears overly bright or washed out.

CODE V Introductory User’s Guide 115


Chapter 4 See How It Works: Analysis
Menu

Analysis Macros
Search In addition to the many built-in analysis features, CODE V’s Macro-PLUS
programming language provides a great deal of flexibility for analysis calculations.
Even if you don't want to program your own macros, you can easily make use of the
many ORA-supplied macros. The trick is to know what is there.
If you choose the Tools > Macro Manager menu, a dialog box opens that gives
access to all macros on your computer. In addition to the browse button […], there
is also a tree structure which lists favorite, recent, and sample macros. The sample
macros are broken down into categories, such as diffraction analysis, utilities, etc.

Tip: Although most macros are self contained, a few supplied macros call other
macros and may depend on having a path defined to the macro directory. Typing
the command
PTH SEQ CV_MACRO:
in the Command Window will define this path. You can also place this command
in your defaults.seq file so it will be defined every time you start CODE V.

The following table lists various analysis tasks you might wish to do, pointing you
to supplied macros that may help. The category is listed for information, but if you
know the name of the macro, you can just use the browse button to locate it in the
supplied macro directory, then click the Run button.

Running Supplied Macros


1. Choose the Tools > Macro Manager menu.
2. Locate the macro of interest with the browse button […] or by going to the
category under Sample Macros.
3. Click the Run button
4. If the macro displays a dialog box, fill in the requested information and click
OK to run it.
Note that some macros will run immediately without a dialog box, while a few will
run interactively in the Command Window, with text prompts.

116 CODE V Introductory User’s Guide


Chapter 4 See How It Works: Analysis
Menu

Task or problem Category Macro name(s)


Search
“Ray failure during clear aperture Utilities REFCHECK.SEQ
trace” when running a CODE V option
(which reference rays are failing?)
What are the focal lengths of each 1st Order Analysis FL.SEQ
element in the lens?
Plot a cross-section of PSF results? Diffraction Analysis PSFPLOT.SEQ
Show Airy disk or detector size on a Geometrical Analysis SPOTDET.SEQ
spot diagram?
Plot MTF as a function of field Diffraction Analysis MTFVSFLD.SEQ
position?
How can I plot lateral color? Geometrical Analysis LATCOLOR.SEQ
How can I plot focal length or back 1st Order Analysis FLPLOT.SEQ
focal length vs. wavelength? BFLPLOT.SEQ
How can I make a y-ybar diagram for 1st Order Analysis YYBAR.SEQ
a lens?
How can I reverse the lens to prepare Utilities ILREVERS.SEQ
for illumination or other analysis? (uses FLY command
with added logic)
Plot a macro-calculated quantity vs. Utilities PLOTWL.SEQ
wavelength? (default: CEF)
Plot the combined optical and detector Diffraction Analysis MTFDET.SEQ
MTF?

CODE V Introductory User’s Guide 117


Chapter 4 See How It Works: Analysis
Menu

Multilayer Coating Design


Search CODE V has a feature that you will not find on any menu in the current program.
This feature is called Multilayer Coating Design (MUL), and it is essentially a
program within a program; that is, it’s a multi-section feature for defining, saving,
analyzing, and optimizing multilayer coatings.
This feature is essentially independent of the lens-based features of CODE V,
although coatings defined in MUL can be attached to surfaces in a lens model,
where they will properly affect polarization and transmission calculations. In fact,
this is the main purpose for MUL.
MUL is supported only on the command line at this time. You will find
command-based documentation and examples in the CODE V Reference Manual.
Modifying an existing command example and entering it in a text-based .SEQ
(macro) file is the easiest way to define a coating if you need one.

118 CODE V Introductory User’s Guide

You might also like