Chandra X-Ray Observatory
Skip to the navigation links
Last modified: 22 Dec 2014


Introduction to Peg

CIAO 4.7 Science Threads



The Parameter Editor GUI (peg) is an application which allows the user to easily view and modify the values in a parameter file. The tool may then be run from peg, or the values can simply be saved for a future analysis session.

Related Links:

Last Update: 22 Dec 2014 - Reviewed for CIAO 4.7; minor edits.


Getting Started

For illustration, this thread utilizes the ObsID 1843 (ACIS-I, G21.5-0.9) data that was downloaded in the How to Download Chandra Data from the Archive thread.

If this is your first time using CIAO, please read the Starting CIAO thread to ensure that your environment is configured properly.

Unlike the CIAO tools, peg does not have a parameter file. The GUI preferences - set from the "Edit → Preferences" menu - are stored in $HOME/.pegrc. The options are described in the ahelp file. The images in this thread were made with the peg preferences set to the default values.

Why does my GUI look different?

The CIAO GUIs use the default GTK theme specified on each user's machine to determine how the GUI is displayed (e.g. gray background with selected items in blue). Your GUI may look different than the one shown in screenshots in this thread, but the functionality is the same.

The help file on guis has instructions on how to change the default theme.

Launching peg

There are several options for starting up peg, both from the command line and from the GUI itself:

  • Do not give any arguments:

    unix% peg &

    The editor is launched without any file loaded, as shown in Figure 1.

    [Thumbnail image: The main window of the GUI is empty and the status window indicates that no file was loaded.]

    [Version: full-size]

    [Print media version: The main window of the GUI is empty and the status window indicates that no file was loaded.]

    Figure 1: GUI before loading a parameter file

    Open the desired parameter file via the "Open" dialog box from the "File" menu.

    A list of recently accessed files is maintained by peg and can be found in the "File → Open List" submenu. This displays a list of up to the last 10 files viewed; selecting any of the files reloads it. When storing the recently-viewed files, the path is considered part of the filename.

  • Specify a tool name:

    unix% peg dmlist &

    This loads the parameter file dmlist.par that is in the $PFILES path, either the user's local copy or, if that does not exist, the CIAO default copy. The Parameter Files section of the Introduction to CIAO thread has information on the $PFILES environment variable.

  • Specify a parameter file and (optional) path:

    unix% peg /some/directory/dmlist.par &

    This loads a specific copy of dmlist.par.

Once a parameter file is loaded, the GUI displays the parameters for that file. Figure 2 shows peg displaying dmlist.par. If there are any parameter values currently set in the file, they are loaded into the appropriate fields.

[Thumbnail image: The main window of the GUI is displays the parameters for the tool dmlist.]

[Version: full-size]

[Print media version: The main window of the GUI is displays the parameters for the tool dmlist.]

Figure 2: Peg GUI after loading a parameter file

The status window displays the full path of the parameter file which was loaded (/soft/ciao/param/dmlist.par).

The Basic Display

The GUI contains three main sections: the parameter file window, the command execution panel, and a status window.

The parameter file window (top) shows all the parameters in the chosen file. Required parameters are italic and hidden parameters are unformatted by default; other style options (color, bold, etc.) may be set and saved in the preference file. A parameter that can take a file as input will have a "Browse" button next to the field, so that the filename (and optional path) may be entered.

The command execution panel contains the "Command Line" box (described below) and six buttons:

  • Run & Exit: run the tool and exit peg.

  • Run: run the tool, but do not exit peg.

  • Save: save the updated values to the parameter file.

  • Punlearn: reset all the entries to the default values; see ahelp punlearn for more information.

  • Tool Help: opens an xterm window and displays the help file for the current tool. Other help options are available from the "Help" menu.

  • Quit: exit peg.

The status window across the bottom of the application provides various feedback messages.

Running Tools

To run a tool from peg, first set the desired parameters. In this example, we have set the following:

Figure 3 shows the GUI with the values entered.

[Thumbnail image: The infile, opt, rows, and verbose parameters are set for the tool dmlist]

[Version: full-size]

[Print media version: The infile, opt, rows, and verbose parameters are set for the tool dmlist]

Figure 3: Setting the parameters to run dmlist

The infile field takes a file, opt and rows are string fields, and verbose takes an integer within a set range (0-5).

Choose "Run" or "Run & Exit" to run dmlist. The status bar records the action:

Tue 06-Jan 11:49:45 executing tool- dmlist  verbose=1 infile="acisf01843N002_evt2.fits"
opt="data" outfile="" rows="1:5" cells="" mode="ql"  

The taskmonitor GUI is launched, displaying the command and any output from the tool. As seen in Figure 4, the results of the run are given in the "Output" window.

[Thumbnail image: The taskmonitor GUI displays the command in the upper window and results in the "Output" window.]

[Version: full-size]

[Print media version: The taskmonitor GUI displays the command in the upper window and results in the "Output" window.]

Figure 4: Tool output displayed in taskmonitor

It is possible to Search, Print, and Save the tool output from taskmonitor. Any issues encountered would be printed to the status window at the bottom of the GUI.

To run the same dmlist command from the CIAO command line:

unix% dmlist acisf01843N002_evt2.fits data rows=1:5 verbose=1

Block    2: EVENTS                         Table        15 cols x 490795   rows

Data for Table Block EVENTS

ROW    time                 ccd_id node_id expno      chip(chipx,chipy) tdet(tdetx,tdety) det(detx,dety)                           sky(x,y)                                 pha        pha_ro     energy               pi     fltgrade grade status[4]

     1  84272491.7915800959    6    0          4    (162,185)  (3037,1887) (     2999.5632324219,     6754.0478515625) (     1516.4484863281,     2857.8146972656)       1413       1360        5585.42968750    383      0    0                                                                                                         00000000000000000000000000000000
     2  84272491.7915800959    6    1          4    (364,292)  (3239,1994) (     3201.9252929688,     6646.9384765625) (     1612.3209228516,     3065.7360839844)       3259       3095        12443.2968750    853    104    6                                                                                                         00000000000000000000000000000000
     3  84272491.7915800959    6    2          4    (521,626)  (3396,2328) (     3358.3686523438,     6312.3784179688) (     1937.8156738281,     3240.25781250)       1100        898      4318.5424804688    296     16    4                                                                                                         00000000000000000000000000000000
     4  84272491.8326200992    7    2          4     (520,19)  (4437,1721) (     4400.3793945312,     6917.9926757812) (     1276.0732421875,     4247.5571289062)        377        362      1778.7789306641    122     16    4                                                                                                         00000000000000000000000000000000
     5  84272491.8326200992    7    0          4    (238,116)  (4155,1818) (     4118.5268554688,     6822.0991210938) (     1387.2509765625,     3971.3754882812)       2755       2698     12297.6308593750    843     10    6                                                                                                         00000000000000000000000000000000

The Command Line Box

The "Command Line" box is part of the the command execution panel. Any text entered in this field is appended to the command that is being executed. It may be used to conveniently change hidden parameters, especially in long parameter files (e.g. acis_process_events).

For example, if you would like to re-run a command, changing only the clobber parameter, simply add "cl+" (or "clobber+" or "clobber=yes") to the Command Line box.

The Analysis Menu

The "Analysis" menu allows you to launch other CIAO tools from within peg; see the Introduction to the Analysis Menu thread for more information.

Closing peg

Peg may be closed by choosing "Quit" from the "File" menu or by clicking the "Quit" button.


22 Dec 2004 reviewed for CIAO 3.2: no changes
01 Dec 2005 reviewed for CIAO 3.3: no changes
01 Dec 2006 updated for CIAO 3.4: minor correction to screen output
10 Jan 2008 updated for CIAO 4.0: remade images because event file has been reprocessed to version N002
15 Jun 2008 updated image display to place figures inline with text
06 Jan 2009 updated for CIAO 4.1: peg was rewritten in GTK, so some cosmetic changes (updated all thread images); the GUI has a preferences file instead of a parameter file; added Why does my GUI look different? section
25 Jan 2010 reviewed for CIAO 4.2: no changes
11 Jan 2011 reviewed for CIAO 4.3: no changes
03 Jan 2012 reviewed for CIAO 4.4: no changes
03 Dec 2012 Review for CIAO 4.5; no changes
10 Dec 2013 Review for CIAO 4.6; no changes.
22 Dec 2014 Reviewed for CIAO 4.7; minor edits.

Last modified: 22 Dec 2014
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: Smithsonian Institution, Copyright © 1998-2014. All rights reserved.