Getting Started

with CoherentOptics v 3.5.1

This program is based upon a program made for Classic Mac called FFTVision that was written over a period of years for use in the research program of Professors Jeffrey Davis and myself at San Diego State University. You can see how we have used the program by consulting the optics literature. This new program is written from scratch for the Cocoa environment in Objective C, and is still used in the optics research as SDSU. This program can read and write the two major file types of the old program. It is free, the author only asks that you give some feedback if it doesn't act as expected.

If you use it in preparing a publication some recognition would be nice.

e-mail: don.cottrell@sdsu.edu

Since the 2.0 incarnation of the program does all of its calculations in double precision.
Since the 3.0 incarnation the program is able to handle symbolic values in many script fields.
These values of these symbols are calculated in the "Rescale Icon" and can be viewed by opening the "Symbol Defs" icon.

CoherentOptics is a program for constructing optical filters and for simulating the passage of coherent light of one color and polarization (usually) at a time. This simulated propagation through an optical system, uses Fresnel optics, but no ray tracing. I hesitate to point out that you can build holograms since this produces false expectations.

Try looking at the file "What Does it Do ". (You may need click "Open PDF in Preview".)

One of the most important operations is to just carry an image forward through space. To do this you have three options. The first is called the "direct propagation" option. It applies a version of Fresnels equation for the paraxial approximation which makes an attempt to include the effect of the pixel size in the calculation. This works quite well and approximates the laboratory experience quite well, however it is quite slow. The second option is much faster and makes use of an Inverse Fourier transform, multiplication by a duel lens function, and finally another Fourier transform. This is very fast. The third option is included in an Icon within the scripting language implementing the chirp transform. It is actually a modification of option two and also runs fast.

The program is capable of handling several documents at the same time. Each document and its associated windows are color coded with a color dot to somewhat decrease confusion. If you click in the color dot of a window nearly all windows with the same color dot will be brought forward.

Each document has a main window labeled by its array size and dominated by a pane which contains a display of the information contained in an array of double precision floating point complex numbers. These are usually imagined as embodying the real and imaginary parts of one polarization of the electric field of a flat plane of light.

In these views I have chosen to represent high values as black and low (or negative) values as light.

If the display has been set to display the real part (as is the case above) the values in the real part of the big array are mapped onto the screen in the following way. The largest magnitude either positive or negative is searched out and all values scaled so that 0 is given a gray value of 127 and the largest magnitude is given a gray value of 255 if it is positive or 0 if it is negative. All other values are mapped proportionaly onto integer values from 0 (black) to 255(white). If the screen is displaying "magnitude" or "magnitude squared" there are no negative values so 0 is mapped to 0 and the maximum value to 255. Note that the "set display maximum" checkbox if checked opens a text box into which you can enter a number overriding the maximum magnitude search described in the second sentence of this paragraph, and specefying the value to which the desplay will be scaled.

Notice that below the word "Histogram" is a box labeled "show 0 to 255 only". If you check this value a value of 157.8 in the real part, for example, will be plotted as a gray value of 157. A value of more than 255 will be plotted as gray value 255 and a value below 0 will be given a gray value of 0. This is rarely what you want, but can be very useful at times. This box is put on the histogram window so that you can better understand the weirdness that results.

As you can see the drawer has a histogram showing the number of pixels in each or 256 bins. The rightward extension of the lines represent the log of the number of pixels within the bin. the first red line corresponds to 10 and the second to 100 etc.

As you move the mouse over the image in the big window you see the coordinates under the mouse and the value stored in the big array in turns of the real part, imaginary part, and the calculated magnitude and phase angle.

You will also see that most of the buttons have hints associated with them, which will pop up if the cursor lingers over the item.

The pop up menu at the top (which says "real part") can be changed to display other options.

The "put into real part" box at the left side of this window, encloses a set of buttons which cause that which is displayed upon the screen to be entered into the real part of the array. The choice of buttons determines the mode of this entry. If you want to enter into the imaginary part you must manipulate the data after entry into the real part. (details later)

You should also be aware that if you paste an image onto the screen or load a binary or image file it will be displayed on the screen but not automatically entered into the big array. In this case the screen does not reflect the contents of the underlying complex array. You must enter the screen.

The drawing tools, which are available on the drawer, permit drawing directly into the screen. Since nearly all operations such as a Fourier transform only operate on the big array it is necessary to "enter" the screen contents into the complex array.

Curious how to clear the screen? Use -K, if you want to clear the big array as well hit -K then -E.

* Image files can be sent directly to the real part of the big array. Set the preferences.
During execution of a script the image is only sent to the screen if required by the "show" icon. If the image is already in the screen buffer, use the "show hidden screen" option.

PREFERENCES

On the "CoherentOptics" menu there is a preferences option. You can use this to set up the default setting of the Zonal Lens generator and the Direct Propagation window.
The third page of thepreferences pemits you to set several behaviors. The program sends some calculations to several threads which can then run concurrently in several cores. You can set the number of threads created in this window.

SCRIPTING LANGUAGE

The scripting language was created because we users keep getting lost in the complex steps required to create filters and simulate some systems. It permits you to select operations by dragging them into the script window and connecting them to each other in sequence. This is the way that I usually use this progrma.