CAOS Application Builder -  tutorial

 
 



 
 
 

The aim of this tutorial is to help the user building a simple simulation with CAOS (the "Code for Adaptive Optics Systems"). The example taken here highlights the effect of angular anisoplanatism. This is in order to practice using the CAOS Application Builder (the graphical programming environment) together with the Software Package CAOS (the set of adaptive optics modules).
 
 
 



 

Step 1.

First of all, be sure to set the environmental variables needed by the package as described on the installation guide. Change your directory to the one stated as "working directory" during the installation process. Start IDL and type "caos_init" and then "worksheet" at the IDL prompt. The CAOS Application Builder interface appears:


 
 


 

Step 2.

To put the ATMosphere module in the simulation, choose the item "ATM" from the "Modules" menu. The pointer changes his shape from an arrow to a square. Click on one of the rectangles in the Application Builder interface, and the icon representing the ATM module is drawn in the chosen rectangle.

The ATM module generates the turbulent atmosphere layers for the simulation.


 

Step 3.

In order to compare the effects of the angular anisoplanatism, one can compare the wavefronts propagated through the atmosphere from an on-axis source and from an off-axis one. You need two SRC (SouRCe) modules, two GPR (Geometrical PRopagator, one for each source) modules, and a WFA (WaveFront Adder) module to compute the difference between the two simulated wavefronts. Operating in similar manner as you have done for the ATM module in the previous step, you obtain something equivalent to what is represented in the next figure:
 


 

where you have also added some DIS (DISplay) modules to display the wavefronts.


 

Step 4.

Now you need to set the data flow within the Application Builder . Just do it connecting an output of a module (the right-most side of the icon) with an input of an other module (the left-most side of the icon). Only outputs and inputs with the same color code can be connected together, in order to avoid the mismatching of data types.  The grey color of the input of the DIS modules means that their input data type is "generic", i.e. they can be connected to any other module. Note that once the link between the output of a module and the input of DIS is set, the input color of the latter changes into the color associated to the data of the first one. To connect two modules with a link, just click with the mouse left-button on the output of the first one (release always the button: don't drag), click on the points where you like to insert a corner on the path, and finally click on the input of the second one. You obtain something like the next figure:

Note that each output accepts more then one link, but each input must have only one link.
If you want to remove a link, choose "Delete" from the "Edit" menu, the cursor will change into an up-arrow. Click on the input side of the module icon related to the link to delete, and the link will disappear. If you want to delete a module, choose "Delete" as before and click  on the module itself. The module will disappear together with its links (if any).

Step 5.

Before entering the parameter data for the modules, save the project: choose "Loop Control" from the "Utilities" menu to enter the number of iterations to perform during the simulation (10, as instance) and store the project code using the "Save Project" command from the "File" menu. A project name is requested, change the default one (newproject)  into "tutorial", as instance. A new folder named "tutorial" is created in the "Projects" sub-directory of the working directory. The simulation code is generated (the project.pro and mod_calls.pro files) and it is stored in the "tutorial" folder. In the same folder the module parameters will be saved (see next steps). Note that the project name is used to create a directory, so don't use white spaces or characters that the operative system cannot handle for directory names.

Step 6.

Now you can set the parameters for each module. Click on the middle of a module icon to set its parameters. Clicking on ATM you obtain the following GUI (Graphical User Interface):

You can see the help of the module for more informations about each item in the GUI (only the left side of the GUI of module ATM is shown here).

The fields having the label enclosed between parenthesis are calculated fields and cannot be modified. They are used to give some useful information to the user.

Select "temporal evolution" in order to simulate time evolving  turbulence. The atmosphere will be evolved by the time step set in the "time-base [s]" field for each iteration (at the opposite the "statistical averaging" choice will produce a new independent statistical realisation for each iteration). Set 2 in the box where the "number of turbulent layers" is asked for and hit return. The table of the layer parameter settings change. Edit the height of each layer and the Cn^2 ratio (the fraction of total power associated to the layer - the sum of this column must be equal to 1).

You have for instance:

Press the "Save parameters" button.

Now the parameters for ATM are saved in the "./Project/tutorial/" directory, and the outline of the ATM icon changes his color to green. That is to remind you that the parameters for that module have been already set.

Step 7.

Set the parameters for all the other modules.  The parameters settings for the modules SRC (upper one), and SRC (bottom one), is shown below:
 

This set an on-axis natural star.


 

This set an off-axis natural star (10 arcsec far from the previous one).


 

This set the diameter and the central obscuration of the telescope in order to propagate rays from the first source to the telescope through the atmosphere.

You need to do it a second time in order to define the same telescope parameters for the propagation of rays from the second source to the telescope.
 

This set the parameters of a display window of the wavefront propagated from the off-axis NGS. You can set a user-defined title that helps you keeping track of the different items displayed during the program running.
You need to set-up in the same way the parameters of the  other display modules. After that you need only to input parameters for the wavefront adding module. This is done working on the GUI reported below. Parameters are set in order to compute the difference between the two wavefronts, allowing a simple evaluation of the angular anisoplanatism effect.


 

At the end you fix the parameters of the last DIS module that shows the difference between the two wavefronts as displayed below:


 
 



 

Step 8.

After the parameters for all the modules are set, all the icons become green.
 


 

You need to save the project every time you want to modify a link, add or remove a module or change the number of iterations, but you don't need to save the project again whenever you change the parameters of a module.


 

Step 9 (the last one!).

Run the code typing at the IDL prompt ".r ./Projects/tutorial/project.pro"... and enjoy the simulation!
 
 



 
 

ATTENTION: the project can run even if the CAOS Application Builder is not running. You can close the Application Builder to free some memory and then run the project or you can start a new session of IDL and run a project saved in a previous IDL session without starting again the Application Builder. In all cases always run the command "caos_init" at the IDL prompt before running the project.