The lens database is retained in CODE V's "active memory" and includes all the optically relevant information describing the one optical system you are currently working on. For a large or complex lens, the lens database can contain hundreds of pieces of data to describe features as diverse as surface curvatures, multilayer coatings, field angles, interferogram data, and fabrication tolerances. Note that in general, instructions on how the lens should be analyzed or optimized are not considered to be part of the description of the lens itself and will not be included in the lens database.
In addition to information entered by you to define an optical system, CODE V may need additional data to complete its definition. Glass data is the most common example of this. When you request an optical material by name (BK7, SILICA, etc), CODE V uses its extensive databases of optical materials to get detailed information on index of refraction and other optical properties. See Chapter 2A, "Entering/ Changing Data - Materials" for details on using optical materials and Chapter 10, "GLD - Glass Catalog Data" for a~ditional information on the glass databases.
If you think of your lens data as a database, you can see the need for a database management program to create, modify, or display this data. This is the function of CODE V's Lens Data Manager (or LDM for short). The LDM is an interactive program that lets you quickly create lens data, modify it, delete it, display it in various ways, and save it in files. As an aid in setting up lens systems, the LDM can also make simple lens drawings and perform basic analysis (single rays, third-order aberration, etc.). Another way to think of this is as a specialized lens "data editor," different from a general purpose text editor in that it "understands" the structure of the lens data. This entire chapter is devoted to the LDM and to the details of creating, modifying, and displaying all of the many types of data that CODE V can handle.
Although most changes to the lens database are made by the LDhI, a few of CODE V's specia~purpose options can also make changes. When you optimize a lens with the AUT option (Chapter 3), AUT changes the lens database as it alters variables to improve the image quality of the-lens. ENY (environmental analysis, Chapter 8) changes the lens database to simulate the effects of temperature and pressure ch~ies.-Tolerancing options (TOR, TOD, TOL - Chapter 6) calculate fabrication tolerances and add these to the lens database (you can also enter or modify tolerances directly in the LDM). The other options of CQDE V generally perform calculations based on the lens database but do not modify the lens data.
Like-all of CODE V, the LDM can operate in two basic "modes," command mode and GUI mode. In command mode, the prompt CODE V> indicates-that the LDM is ready to accept commands to modify or display parts of the lens database (e.g., the command THI S6 5.3 will change the thickness following surface 6 to 5.3, while the command SUR S1..5 will display surface related data for surfaces 1 to 5). lids ehapll~ has details of all the LDM commands and many examples of their use.
In GUI mode, tables showing the various parts of lens data are displayed on screen, and you can modify lens data by simply typing new values in the appropriate tables. This "full screen" mode makes it possible to change data and see the effects of changes without the use of commands. Extensive examples of LDM use in GUI mode can be found in the CODE V Test Drive and CODE V Introductory User's Guide manuals.
In addition to its role as a data editor or database manager, the LDM also serves as the top level or "home base" for running CODE V. As shown in the diagram below, CODE V has two basic levels, the LDM and the Options. When you enter CODE V, you start out in the LDM, and from here you can create a lens, restore one from a file, modify it, etc. After a lens is defined, you can run any of the Options, launching the option from the LDM (by typing the name of the option in command mode, or by choosing the option from a menu in screens).
Each option has its own set of commands and screen operations. Once you have entered an option, only commands or screen operations defined by that option will be valid - LDM operations are not allowed. After entering commands or screen operations for an option, you can either execute the option (i.e., tell it to perform the requested calculations) or cancel it. To execute the option, you type the command GO (or Go Toolbar button in GUI). To cancel the option, type CAN (Cancel or Lens Data Toolbar buttons in GUI). In either case, control is returned to the LDM.
For details on these and other issues for operating CODE V, please see Chapter 1A, "Operating CODE V."
Lens data post-processing refers to additional checks and calculations that are done by the LDM after you enter or change data. Such steps are needed to insure that lens data is complete and valid before extensive calculations are attempted. Some post-processing is done whenever any change is made, while other, more extensive post-processing is done on an as-needed basis. Examples of simple post-processing include calculating first-order solves and retrieving index of refraction data from a glass catalog. More extensive post-processing is done before entering an option. This includes tracing reference rays and calculating values for default apertures.
There are several potential sources of lens data. Although you can have any number of lenses stored in disk files for rapid retrieval by CODE V, the lens database (CODE V's "memory") can hold data for only one lens at a time. Creating or restoring a new lens will destroy any data in memory (i.e., a previous lens), so be sure to save this data to a file if it has value. There is a partial exception to this "one lens" rule in the form of the LDM COPY command that allows you to extract part or all of a lens stored in a file and insert that data in the current lens database (see Chapter 2A, "Entering/Changing Data - Surface Shape and Position - Inserting, Deleting, and Copying Surfaces").
You can interactively create a new lens at any time in a CODE V session. The LEN command initializes the lens database to prepare for new lens entry, removing any previous lens database from active memory (in GUI, choose Clear Lens from the File menu).
Lenses that have been saved in .LEN files can be restored at any time. This includes lenses in your own local directory, lenses in other directories or subdirectories (provided you have privileges needed to access these directories), and CODE V standard lenses. Restoring a lens immediately updates the CODE V lens database, replacing any lens previously in memory. Lens files (filename.LEN) are binary files that are specific to your operating system (VMS, Sun/Unix, or PC). Because they are binary files, .LEN files can be read into CODE V very quickly. They cannot, however, be edited with a text editor, nor can they easily be transferred to other types of computers. For information on saving and restoring lens data, see Chapter 2E, "Saving and Restoring Lens Data."
You can define a lens by reading LDM commands from a sequence or macro (.SEQ) file. You can create such a file directly by using a text editor, by transferring it from another computer (e.g., with a terminal emulator), or with the CODE V WRL (write lens) command. Because a .SEQ file is a standard text file, it is also very easy to transfer lens data in this form to other computers. Sequence files are read into CODE V with the immediate command IN (this command works only in command mode). See Chapter 10, "Defaults and Utilities," for information on IN and other immediate commands.
ORA supplies a starting library of various lens types to use as examples and starting points. Their use is discussed in Chapter 1A, "Operating CODE V - Lenses Supplied with CODE V."
ORA also supplies lens prescriptions for a large number of standard lens components (singlets, doublets, and others) from several suppliers of optical parts. These can be used on a standalone basis, or more often as "building blocks" to construct more complex lens systems. Their use is discussed in Chapter IA, "Operating CODE V - Lenses Supplied with CODE V."
Excerpted from the CODE V Reference Manual. (c) Copyright 2002 by Optical Research Associates. Excerpted by permission of Optical Research Associates. All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from Optical Research Associates.
Maintained by John Loomis, last updated 24 June 1999