### 3 Tutorial Examples

3.2 A CL example

The following two sections show the same simple example. The first uses the Starlink/ICL and the second the IRAF/CL command languages.

#### 3.1 An ICL example

In order to start PONGO you must first start ICL. This may be done by typing:

% pongo

at C-shell the prompt. Or alternatively by starting ICL then using the pongo command.

In any PONGO session the first action is to open the plotting device. This is done by typing2:

ICL> begplot xw

Where ‘xw’ should be replaced by the name of the plotting device you are intending to use. Note that once you have begun a PONGO session with the BEGPLOT command, the ICL> prompt changes to PONGO>. This is important because the only commands you can use with success at the ICL> prompt are BEGPLOT and DEVICE, all other commands should be typed at the PONGO> prompt. The data may then be read using the command 3. Normally an ‘ordinary’ file name would be used i.e. spectrum.dat. An ICL variable is used here as it is not possible at this time to use an environment variable for accessing formatted files. The actual file is $PONGO_EXAMPLES/tutorial.dat: PONGO> readf data=(TUTORIAL_DATA) xcol=1 ycol=3 all Plotting limits are set up using the range of the data by the command: PONGO> dlimits Axes for the plot may be drawn using: PONGO> boxframe and finally the points may be plotted as asterisk-like symbols and the axes labelled with: PONGO> points 3 PONGO> label ’X axis’ ’Y axis’ ’Plot Title’ Note that the data values are remembered by PONGO and the plot you have just created may be erased and recreated by typing: PONGO> advance PONGO> boxframe PONGO> points PONGO> label To close a device and end a PONGO plot the command ENDPLOT should be used. This is important if you are going to switch to another set of applications such as KAPPA, otherwise the plotting device characteristics will be inaccessible to the second package. #### 3.2 A CL example In order to start PONGO you must first start CL and load the pongo package. In any PONGO session the first action is to open the plotting device. This is done by typing4: po> begplot xw Where ‘xw’ should be replaced by the name of the plotting device you are intending to use. The data may then be read using the command: po> readf data=pongoexamples$tutorial.dat xcol=1 ycol=3 all=yes

Plotting limits are set up using the range of the data by the command:

po> dlimits

Axes for the plot may be drawn using:

po> boxframe

and finally the points may be plotted as asterisk-like symbols and the axes labelled with:

po> points 3
po> label "X axis" "Y axis" "Plot Title"

To close a device and end a PONGO plot the command: ENDPLOT should be used.

2If you have already used PONGO then you should also issue the RESETPONGO command immediately after BEGPLOT.

3Note that the data file name is given as (TUTORIAL_DATA), this uses an ICL variable which is set up when PONGO is initialised

4If you have already used PONGO then you should also issue the RESETPONGO command immediately after BEGPLOT.