About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/taskmonitor.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 taskmonitor Context: gui

Synopsis

GUI to run a task as a background process and display the output

Syntax

taskmonitor "task to execute"

Description

Taskmonitor is a graphical user interface (GUI) intended to allow another GUI application to run a task in the background but still display the standard error and standard output. Although designed to be launched from toolagent, it may be invoked from the command line and used as a stand-alone tool.

Taskmonitor takes a command to execute as input. Commands which contain white space or more than a single word must be enclosed in quotes. It executes the task as a background process and pipes the standard error and standard output of the task to a scrollable text window in the GUI. Since the task is run as a background process, there is no way for user input to be entered and thus should not be used to execute interactive programs. This means that CIAO tools may need to be run with "mode=h" set to avoid prompts for parameter values, as discussed in the examples below. Taskmonitor acts as a "dumb" terminal, which may influence the output of the program it is given to run.

Taskmonitor does not utilize a parameter file itself, but loads in the session parameter file ciao.par when it starts.

Window Layout

The taskmonitor layout contains three menus, two scrollable windows and a set of informational/control buttons. The menus allow users to print out the output from the tool, save the output to a text file, search in the output, run other tools (via the analysis menu), and exit the GUI. The top window contains the command which taskmonitor is running. Under that is a scrollable window which displays the executing tasks stderr and stdout. The final part of the display is the "Status" field, which reports on the state of the tool (is it running or has it finished?), and a set of buttons - "Find", "Print", "Save As", and "Exit - which mirror the functions available in the menu bar.

The Analysis menu

The "Analysis" menu item was added to taskmonitor in CIAO 3.0 and allows the user to run other tools (both command-line and GUI). The contents of this menu are user configurable and is described further in "ahelp analysis-menu".

Example 1

taskmonitor ps

This example illustrates how taskmonitor may be used to execute a simple command and display the output. Since the command was a single word, quotes around the command are unnecessary.

Example 2

taskmonitor "dmlist mydata.fits opt=header,subspace mode=h" &

This example launches taskmonitor to run dmlist and display the header and subspace information for the file mydata.fits. By setting the mode parameter to 'h', the parameter interface's querying of auto-params is disabled, allowing parameter driven tools to be executed in a non-interactive mode. The & puts the taskmonitor process into the background to free up the shell it was invoked from so the user may perform other commands. Since the command to execute contained whitespace characters, the entire command was enclosed in quotes.

Example 3

taskmonitor "dmstat 'evt2.fits[sky=region(ds9.reg)][cols energy]' sig-"
&

Here we run dmstat on a filtered events file - restricting the calculation to only the energy column - and set the sigma parameter to no. The first parameter (infile) is quoted because it contains a space and note that we can still use shortcuts like "sig-" provided by the parameter library (see "ahelp parameter"). Since dmstat ha only one automatic parameter, and this is specified in the command string, we did not need to set mode=h to stop for prompting of other parameter values.

Example 4

taskmonitor "ahelp -b PARAM dmstat" &

Here we run the ahelp tool to display just the PARAMETER section of the dmstat ahelp file. Since taskmonitor acts like a dumb terminal there is no ability to control the output as there is at the command line, although you can use the scroll bar to view all the text.

Example 5

taskmonitor "ahelp -n 130 -b QEXAMPLELIST aconvolve" &

Similar to the previous example but this time we pass several options to the ahelp command.

CHANGES IN CIAO 3.0.2

The Status field

When the program which taskmonitor is running has finished the "Status" field will now report either

Success

if the program ran successfully or

Failure - exit status=1

if the program failed (the "exit status" value need not be 1).

Using a fixed-width font

The default font used by taskmonitor - as specified by the "taskmonitor*fontlist" line in the file $ASCDS_INSTALL/config/system/CXCdefaults - has been changed to use a fixed-width font. This means that output from programs which use spaces for alignment - such as the output of ahelp - will be readable.

To change the font used by taskmonitor, create (or update) a file called .CXCdefaults in your home directory and include in it the following line

  taskmonitor*fontList:  -adobe-courier-medium-r-normal-*-12-*-*

The text to the right of the ":" defines the font to use: in the example above we show the value used in CIAO 3.0.2; previous versions of CIAO used

-adobe-helvetica-bold-r-normal-*-12-*-*

and the "xfontsel" program can be used to select other choices. See "ahelp gui" for more information on how to configure the appearance of CIAO GUIs.

Handling of command-line arguments on Linux

Prior to CIAO 3.0.2, passing command-line arguments to a task using taskmonitor on Linux - such as

  unix% taskmonitor "ahelp -n 100 -b PARAM acis_process_events"

- would report an error message from the "getopt" command and the command not executing correctly.

CHANGES IN CIAO 3.0

Analysis Menu

The "Analysis" menu is a user-confurable set of commands that can be called from the GUI. See "ahelp analysis-menu" for more information.

Searching

Taskmonitor now allows user's to search for a word or phrase in the output text of a command using either the "Find" item in the "Edit" menu or the "Find" button at the bottom of the window.

Reporting exit status

The "Status" field now reports the exit status of a tool (where 0 generally means successful completion and non-zero an error occurred).

Default Print/Save As options

The default print and "Save As" options have been changed to include both the command and the results text (prior to CIAO 3.0 it was just the results text).

Window/label changes

The title of the window has been changed from "TaskWindow" to "TaskMonitor". The "Dismiss" button has been re-named "Exit" and the "Save" button re-named to "Save As" to match the look of other CIAO GUIs.

XPA ACCESS POINT AND COMMANDS

As with most of the CIAO GUIs, taskmonitor has an XPA access point which can be used to control its behaviour: currently this is limited to closing down the application. See "ahelp session" for more information on how the CIAO GUIs use XPA.

The default name is "taskmonitor", with further instances being called "taskmonitor2", "taskmonitor3", ... (the "-xpa" command-line option can be used to override this naming scheme). Taskmonitor understands the following commands when sent via XPA:

  unix% xpaget taskmonitor

  exit:           Exit the current application
                  options: None
  quit:           Synonym for "exit"

ANALYSIS MENU AND COMMAND-LINE OPTIONS

The Analysis menu can be configured using a simple text file which uses the same format as the DS9 Analysis menu; for more details see "ahelp analysis-menu". Taskmonitor has several command-line options, although they are not needed by most users:

Option Description
-iconic Starts taskmonitor in an iconified/hidden state, if allowed by the window manager.
-nosession Do not attatch this taskmonitor to the current CIAO session.
-toolmenu <file> Use <file> rather than the system default file for defining the Analysis menu.
-xpa <name> Sets the XPA access point of taskmonitor to <name>.

Bugs

See the bugs page for this tool on the CIAO website for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



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