Mini Guide for Basic Commands in the XXX Program

Albert Fisher

Steve Navarro

svn Id of xml source file : $Id: mini_notice.xml 356 2008-04-23 09:07:27Z pinsard $

Revision History
Revision 0.0May 29, 2000
French release by Sébastien Masson
Revision 0.1July, 2002
Translation by Albert Fisher
Revision 0.2July 20, 2006
HTML to XML/Docbook migration by Françoise Pinsard
Revision 1.0August, 2006
Major update by Steve Navarro
Revision 1.1September, 2006
Review by Sébastien Masson
Revision 1.2April 2008
migration from DocBook 4.2 to Docbook 5.0

Table of Contents

1. Launching XXX
1.1. idl> xxx
1.2. idl> xxx, /separate
1.3. idl> xxx, restore = 'file.dat'
1.4. idl> xxx, 'file.nc'
1.5. idl> xxx, 'file.nc', keywd1 = …, keywd2 = …
1.6. idl> xxx, 'file.nc', 'initgrid'
1.7. idl> xxx, 'file.nc', 'initgrid', keywd1 = …, keywd2 = …
1.8. idl> xxx, 'file.nc', 'initgrid', 'arg1, arg2, …'
2. Description of XXX window
2.1. Plot type list
2.2. The menu bar made up of 3 sub-menus
2.3. OK button
2.4. Page Layout
2.5. List of variables
2.6. List of open files
2.7. Command text
2.8. Calendar
2.9. Define the domain
2.10. Specify your plot
3. Mouse Actions
3.1. In the graphics window on a horizontal plot
3.2. Create multiple plots on the same sheet and make them interact
4. What should I do when it breakdown

1. Launching XXX

There is several ways to launch XXX which we will detail in the next sections:

    idl> xxx
    idl> xxx, /separate
    idl> xxx, restore = 'file.dat'
    idl> xxx, 'file.nc'
    idl> xxx, 'file.nc', keywd1 = …, keywd2 = …
    idl> xxx, 'file.nc', 'initgrid'
    idl> xxx, 'file.nc', 'initgrid', keywd1 = …, keywd2 = …
    idl> xxx, 'file.nc', 'initgrid', 'arg1, arg2, …'
  

1.1. idl> xxx

A window will open with 3 parts to consider.

Figure 1. Window xxx 1

Window xxx 1

1

Data file name

2

Grid initialization method

3

Grid initialization parameters


1.1.1. Data file name

The name of the data file. It can be typed directly in the window provided, or selected with the help of the browse button.

1.1.2. Grid initialization method

For visualising grilled data, you need to define the grid on which are located the data. By default, automatic grid construction with initncdf.pro is checked. This means that the grid will be defined by using the informations contained in the data file (through the IDL prodecure initncdf) without needing any other auxiliary file. If you checked grid construction with other IDL batch or procedure, this means that you don't want to use the default initncdf procedure to define the grid and you will provide your own IDL procedure or the so-called IDL batch file (a file which is called by using @, see IDL documentation).

1.1.3. Grid initialization parameters

This third part allows you to specify the name, the argument and the keywords of the routine you want to use to initialize the grid. By default the name of the procedure is initncdf, its argument will be automatically defined so you cannot change them. If you checked grid construction with other IDL batch or procedure, you have to select the name of the IDL procedure or batch file and its suitable arguments and keywords. Note that if you select an IDL batch file you cannot give any parameter or keyword.

Figure 2. Window xxx 1

Window xxx 1


Once these two lines have been completed, click on let's go.

For example, we choose the IDL batch file tst_initlev. Compare the result with automatic grid construction with initncdf.pro checked. Cf Figure 18, “temperature of the ocean at depth 125 meters without proper land/sea mask”

Figure 3. Oceania at 125 meters of depth with proper grid initialization

Oceania at 125 meters of depth with proper grid initialization


1.2. idl> xxx, /separate

This is the same as the simple Section 1.1, “idl> xxx” except that once the xxx window open, you will have 2 separate windows (command and plotting window) instead of one.

1.3. idl> xxx, restore = 'file.dat'

In that case xxx window will open directly in the same state as it was when the file file.dat was created. see ???.

1.4. idl> xxx, 'file.nc'

In this case, the xxx window directly open the data file file.nc and build the grid automatically with the IDL procedure initncdf. For example:

    idl> xxx, 'Levitus98_1m_01_12_Temperature_Pot_1x1.nc'
  

1.5. idl> xxx, 'file.nc', keywd1 = …, keywd2 = …

In this case, the xxx window directly open the data file file.nc, build the grid automatically with the IDL procedure initncdf and use the keywords keywd1 = …, keywd2 = … in the call of initncdf. For example:

    idl> xxx, 'Levitus98_1m_01_12_Temperature_Pot_1x1.nc', useasmask = 'votemper', missing_value = 31.0720
  

1.6. idl> xxx, 'file.nc', 'initgrid'

In this case, the xxx window directly open the data file file.nc and build the grid directly with the IDL procedure or batch file initgrid

    idl> xxx, 'Levitus98_1m_01_12_Temperature_Pot_ORCA2.nc', 'tst_initorca2'
  

1.7. idl> xxx, 'file.nc', 'initgrid', keywd1 = …, keywd2 = …

In this case, the xxx window directly open the data file file.nc, build the grid directly with the IDL procedure initgrid and use the keywords keywd1 = …, keywd2 = … in the call of initgrid.

1.8. idl> xxx, 'file.nc', 'initgrid', 'arg1, arg2, …'

In this case, the xxx window directly open the data file file.nc, build the grid directly with the IDL procedure initgrid and use the string 'arg1, arg2, …' to specify the input arguments in the call of initgrid.

2. Description of XXX window

Figure 4. Window xxx 2

Window xxx 2

1

Plot type

2

Menu

3

OK

4

Page layout

5

Variables list

6

Files list

7

Command text

8

Calendar

9

Domdef

10

Spefications


2.1. Plot type list

Allows specification of the type of plot desired.

Figure 5. Different plot types available

Different plot types available


Note

If the type plt is selected, the selection of plot type is made by mouse. Cf Section 3.1, “In the graphics window on a horizontal plot”

2.2. The menu bar made up of 3 sub-menus

2.2.1. File sub-menu

Figure 6. The File menu

The File menu


  • Open: to open a new file. Same procedure as during the Section 1.1, “idl> xxx”. The new file can be on a different grid, with different variables, with a different time base …

  • New XXX: to open a second XXX window identical to the first one.

  • Quit: to close the XXX window.

2.2.2. Save As sub-menu

Figure 7. The Save As menu

The Save As menu


  • Postscript: to save the plotting window in Postscript format

  • Animated gif: to create an animation of the plotting window.

    Note

    The creation of an animation is only possible if none of the plots have a time axis, and if the plots are all on the same time base (calendar). On the other hand, animations of horizontal and vertical plots, with different color palettes (for those not on an X-terminal), are possible.

    Note

    The creation of animations has a tendency to saturate the video memory of X-terminals, crashing the entire program …

  • Gif: to save a gif of the plotting window.

  • IDL procedure: to save the command history that has created the plot in an IDL procedure that can be re-executed later. For example if I save the commands in xxx_figure.pro file, when ever I want, I can then launch a new IDL session and type:

    idl> @init
    idl> xxx_figure
    

    and I'll obtain the saved figure.

    idl> xxx_figure,/post
    

    or

    idl> @ps
    

    will then create a Postscript file of the figure.

  • RESTORE kwd of xxx: to save the xxx widget (all buttons and parameters stored in memory …) in a binary file in order to quit xxx and relaunch it later like in Section 1.3, “idl> xxx, restore = 'file.dat'” and get exactly the same configuration.

  • Print to prompt: lists in the IDL window the command history that created the last plot. Useful primarily for debugging…

2.2.3. Flag options sub-menu

Figure 8. The Flag option menu

The Flag option menu


  • Portrait/Landscape: changes the configuration of the plot.

  • Overlay: to plot contours of a different field on top the one represented as color-filled contours. It is necessary to relaunch the entire plot to make this work!

  • Vecteur: to plot a vector field on top of contours. Only works on horizontal plots (plt.pro). As for Overlay, a relaunch of the entire plot is necessary.

  • Longitude / x index: switches longitude labeling of the plot sub-domain from degrees to indexes following i.

  • Latitude / y index: switches latitude labeling of the plot sub-domain from degrees to indexes following j.

Caution

Careful, a selected option remains selected until it is re-clicked.

2.3. OK button

Click on this OK button is required to make a new plot appear

2.4. Page Layout

Specify the number of columns and rows for plots on the sheet of paper.

Figure 9. Number of Column

Number of Column


Figure 10. Example: For 2 columns and 2 rows

Example: For 2 columns and 2 rows


2.5. List of variables

You can choose the variable to work on.

Figure 11. Example of different variables available

Example of different variables available


2.6. List of open files

You can choose the file to work on.

Figure 12. Example of list of open files

Example of list of open files


2.7. Command text

To specify in the widget part number 7 the computation you want to do on the data

Note

In all cases bellow, the name given to a field (a, b, c, …) is of no importance.

2.7.1. Linear calculation

If you want to make basic linear computation (like difference between fields, add/multiply by a constant …), you can simply put the following commands: a - bnumb1*aa + numb or any command with the following format numb1*a + numb2*b + numb3*c … + numb where numb1, numb2, … correspond to numbers and a, b, c … will be the data to read.

2.7.2. Any kind of computation

If you want to make a computation more complicated than a basic linear you must designate the data you want to read between "" (with anything in between the "). For example:

"a"^2
"a" - abs("b")
grad("a", 'x')

2.8. Calendar

The calendar is made up of two drop-lists, which allow specification of two dates, the beginning and end of a time series, or the period over which to average before plotting.

Figure 13. Example: first plot in January, second plot is from January to December

Example: first plot in January, second plot is from January to December


2.9. Define the domain

A series of widgets that allow specification of the min/max limits of the domain in longitude/x-index, latitude/y-index, and depth in levels or meters.

Figure 14. Domain by default

Domain by default


Figure 15. Change Domain area: zoom on Oceania

Change Domain area: zoom on Oceania


Figure 16. This configuration give us:

This configuration give us:


Figure 17. Change depth area: between depth 125 and 126

Change depth area: between depth 125 and 126


Figure 18. temperature of the ocean at depth 125 meters without proper land/sea mask

temperature of the ocean at depth 125 meters without proper land/sea mask


As you can see, at this depth, we better define a land/sea mask when loading the grid. Cf Figure 3, “Oceania at 125 meters of depth with proper grid initialization”

2.10. Specify your plot

2.10.1. Specify min, max and contour interval

Figure 19. min, max, and contour interval specifications

min, max, and contour interval specifications


You can restore configuration by default by pressing the Default button.

Note

The path of the file definedefaultextra.pro that defines the default values for each variable names is displayed when the cursor hovers over the button Default. This file contains a case statement based on the name of the variable and defining the min, max, contour interval and other keywords that should be used as default for the specified variable. You can copy this file in your own ${HOME}/My_IDL/ directory and easily modify it to suit your favorite default values.

2.10.2. Specify the palette to be used

For the color palette, you can either specify the name or go search for one among the palettes available.

Figure 20. The Color menu

The Color menu


2.10.3. Add any keyword

The “keywords” window allows specification of all desired keywords. There is a few examples of the use of this “keywords” window.

Figure 21. Without any additional keyword

Without any additional keyword


Figure 22. Add /realcont keyword

Add /realcont keyword


Figure 23. Graphic with /realcont keyword

Graphic with /realcont keyword


Figure 24. Add /realcont, map=[90,0,0], /ortho, cell_fill=2 keywords

Add /realcont, map=[90,0,0], /ortho, cell_fill=2 keywords


Figure 25. Graphic with /realcont, map=[90,0,0], /ortho, cell_fill=2 keywords

Graphic with /realcont, map=[90,0,0], /ortho, cell_fill=2 keywords


3. Mouse Actions

3.1. In the graphics window on a horizontal plot

Select a domain and select the horizontal plot (plt), vertical plot (pltz), or the hovmoeller plot (pltt):

The domain we'd like to select for the plot is determined by one of its diagonals, defined therefore by two points. The first point is defined when the mouse button is pushed, then the mouse is moved, and the second point is defined as the mouse button is released (click-drag). The domains are thus defined by a long click (LC). To determine which type of plot should be made of selection, use:

If the plot selector is on plt

  • the left mouse button to create horizontal plots (plt)

  • the middle mouse button to create vertical plots (pltz)

  • the right mouse button to create common hovmoellers for xt and yt cuts (pltt)

In summary:

  • Figure 26. LCL--->plt

    LCL--->plt


    Figure 27. Horizontal Plot

    Horizontal Plot


  • Figure 28. LCM--->pltz

    LCM--->pltz


    Figure 29. Vertical Plot

    Vertical Plot


  • Figure 30. LCR--->pltt

    LCR--->pltt


    Figure 31. Common hovmoeller for xt and yt cuts

    Common hovmoeller for xt and yt cuts


Note

If the plot selector is on something other than plt the indicated plot type is made.

3.2. Create multiple plots on the same sheet and make them interact

Select the number of columns and rows for the page.

Create a first plot. It will appear in the first frame.

To create a plot in another frame double-click in the frame with the middle button (DCM). A black dotted frame will surround the designated frame, the “target” frame. A black frame will surround the first plot. This is the “reference” frame, in other words the one that all the XXX widgets refer to. Change for example the date and create a new plot. With a left button double-click in the first frame, all the widgets change and refer again to the first plot. A double-click with the right button in the second frame will erase the plot.

In summary:

  • Figure 32. DCL--->“reference” frame

    DCL--->reference frame


    Figure 33. The “reference” frame is selected

    The reference frame is selected


  • Figure 34. DCM--->“target” frame

    DCM--->target frame


    Figure 35. The “target” frame is selected

    The target frame is selected


  • Figure 36. DCR--->erase the frame

    DCR--->erase the frame


Here's a series of commands to show how this works.

  1. Load xxx with the command:

        idl> xxx, 'Levitus98_1m_01_12_Temperature_Pot_ORCA05.nc', 'tst_initorca05'
      

  2. Select a 3-D field and create 6 frames for the sheet of paper.

  3. Create a horizontal plot in Frame 1

  4. DCM in frame 2, LCL on the plot in frame 1 to create a horizontal zoom in frame 2.

    DCM in frame 3, LCM on the plot in frame 1 to create a vertical cut in frame 3.

    DCM in frame 4, LCR on the plot in frame 1 to create a hovmoeller in frame 4.

    Figure 37. Frame with four plot

    Frame with four plot


To redo the hovmoeller with the keyword

/nocontour

  1. DCL in frame 4 which now becomes the reference and target frame.

  2. Add the keyword

    /nocontour

    Figure 38. Command text area

    Command text area


  3. Click OK, and the plot is redone.

    Figure 39. The fourth plot with the keyword "nocontour"

    The fourth plot with the keyword "nocontour"


In frame 5, let's create the same plot as in frame 2 except we use pltv instead of plt

  1. DCL on frame 2

  2. DCM on frame 5

  3. Change plt for pltv

  4. Click on OK

    Figure 40. Frame with five plot

    Frame with five plot


4. What should I do when it breakdown

  1. In the IDL window type (as many time you click on a button since a problem occurs in xxx !!!),

    idl> retall
    

  2. In the IDL window, type

     idl> domdef
    

  3. DCR to erase the problem frame.

  4. change the orientation of the plot by pressing Flag optionsPortrait/Landscape. Cf Section 2.2.3, “Flag options sub-menu”

  5. quit XXX cleanly using quit from the File menu. Cf Section 2.2.1, “File sub-menu”

Note

Always avoid if at all possible closing and killing the XXX window, but rather select quit from the File menu. XXX uses a large number of pointers, and want only killing the window will leave a large number of unused variables in memory, which could in the end overflow. To clean up this memory:

 idl> ptr_free, ptr_valid()