Ximage

Required Adjustments

The prior interface of XIMAGE has been replaced with one based on Tcl, giving the user the opportunity to use all the capabilities of Tcl (looping, etc.) within XIMAGE scripts. The goal for this version was to make the transition to the Tcl version as painless as possible for the user, however, there are some minor adjustments that are unavoidable.

* Shell spawning no longer uses syntax: $command

    Tcl variables use the dollar sign ($) to signify that they should be evaluated, conflicting with the dollar sign's meaning in the prior version of XIMAGE. A command, syscall, exists as a replacement (e.g. syscall ls). A shortcut of preceding the command with '\$' may also be used (e.g. \$ ls).

* The info command becomes iminfo

    An important Tcl command uses the name info, so the prior XIMAGE info command had to be renamed to iminfo.

* The alias command's behavior has changed

    The alias command now only has an effect in the current session. Usage: alias <newcmd> <oldcmd>. If the alias is intended for every XIMAGE session, edit ~/.ximagerc to contain the appropriate alias commands.

* CFITSIO expression syntax must be quoted with {} curly braces

    Tcl uses brackets [ ] to specify commands within a command to be evaluated. To prevent the brackets from a CFITSIO expression being mishandled, quote the argument containing them with curly braces. In Tcl, curly braces do not allow any evaluation inside them, while double-quotes do allow evaluation

    read rp1002.evt[EVENTS][regfilter("smcirc.reg")]
    becomes
    read {rp1002.evt[EVENTS][regfilter("smcirc.reg")]}

Minor Differences

There are some additional differences that are important to be aware of. They do not require any adjustment on the user's part, however, as backwards-compatibility has been preserved.

* Delimiting with slashes no longer necessary

    The prior syntax of XIMAGE was command/qualifier=value. The new parser no longer requires the slashes to be present (i.e. "command qualifier=value"), however, continued use of the prior syntax will work as the slashes are automatically stripped by the parser.

* The parser is now case-sensitive

    The prior XIMAGE parser could not handle filenames with uppercase letters or it would lose the case given for labelling. This limitation no longer exists.

* An alternative to the %1% syntax for script arguments is available

    Although, existing scripts which use the %1% method will work as they always did, Tcl provides a much nicer way of performing these tasks. Writing a proc is recommended. For example:

    proc smthout {file sigma} {
       read $file
       smooth sig=$sigma
       write
    }

    Essentially this makes a custom command in XIMAGE to perform the desired task. Note: a file containing a proc must be sourced (i.e. "source file.tcl"). For custom commands to be available in every XIMAGE session, place the .tcl files in a directory called ~/.ximage


Ximage Home Page Xanadu Home Page Xanadu ftp site

Please send reports of errors to : xanprob@athena.gsfc.nasa.gov
HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: Wednesday, 29-Mar-2006 14:32:09 EST

HEASARC Staff Scientist Position - Applications are now being accepted for a Staff Scientist with significant experience and interest in the technical aspects of astrophysics research, to work in the High Energy Astrophysics Science Archive Research Center (HEASARC) at NASA Goddard Space Flight Center (GSFC) in Greenbelt, MD. Refer to the AAS Job register for full details.