Tutorial #9
Focusing in depth

This exercise is to study the development of a beam as it progresses.
We start by producing a simulated axicon on a phase only display and then looking down field at a large sample of distances using the "direct propagation" module to give a computed simulation at each distance.. At each of these distances we save a vertical sample through the center of the display and add it to an accumulation of such samples. This results in a kind of longitudinal slice of the beam through its center.

Making the Axicon

We will construct the phase of the axicon in the real part and then placing 1 in the imaginary part we use the polar to rect transform to produce a representation of the light emerging from the light valve operated in phase only mode.

Drag icons to a 512 document script window to make the following . The default setting of the R coordinate icon is to put R into the real part. This is what we want. The rescale icon should be set to multiply by 0.2 + i0 and add 0 + i1 the "Polar to Rect" icon has no settings. You can set the display icon to whatever you want. Run it.

Note that we would display the phase on a light valve to carry out the experiment, but for the simulation we leave the real and complex parts of the axicon as they are. We will save the result in a clip icon and make a loop involving the direct propagation icon the display icon and another clip icon in recall mode.

I have not closed the loop at this stage because we want to run a test. Run the script using defaults. You get a dark screen with a light hole in the center. Not what we want, so go back to the rescale icon and change 0.2 to -0.2. and run again. Ok I hope. Save you work to a file so we can open a spread sheet program and build a list of distances.

The table consists of a single column of numbers which are propagation distances in mm.
1000
1050
1100
...
2000
T here 21 entries in all. The tutorial files folder already has a file in it called "1m to 2m 5cm steps.csv" if you don't want to make one up.

Return to the scripting window. Double click on the "direct propagation" icon and check the "batch file" box. Click on the "hide" button. A file selection sheet now comes up asking you to select a text file. Choose the one you just made. Close the loop by drawing an arrow from the display icon to the lower clip icon (which pastes). Now run the script. Not much to see is there. The pattern is very stable over large distances. Try other values in the "rescale" icon. Try changing the display mode in the "display" icon. Go back to the "direct propagation" icon and also select "show progress" after the hide button is clicked you do not have to re-select the file. So just click "Cancel." Now when you run the script you see the numbers from the text file at the bottom of the script window.

The depth of focus folder contains a file called "vertical line.CoOpF" (Coherent Optics Float) witch along with "dot at -1 0.CoOpB" (Binary) we will soon use.

Add icons and connections to make the script at left. The blue file icon multiplies the result of the direct propagation by the vertical line. The two new clip icons are to accumulate the slices made by the vertical line slice of the image. The rightmost clip adds the accumulation to the new slice. The shifter at the bottom moves the whole thing one pixel left (set dot icon to x = -1 y = 0). The lower clip icon captures the new accumulation. Which is then shown by the display icon.

The green branch icon is used to skip the rightmost clip on the first pass. So set it to make one pass (1) and never return (-1). When direct propagation icon runs out of distances it branches to the bell.

You may want to replace the axicon by putting a lens icon before the first clip with a focal distance within the range to see the results. You don't need to erase the axicon to do this. Just skip it.