Saturday, June 11, 2011

Tcl in NASA

fitsTcl: TCL interface to FITS Files


fitsTcl is an extension to the TCL language, providing simple access to astronomical data stored in FITS file format. fitsTcl implements a TCL interface to the CFITSIO library, developed by the HEASARC (High Energy Astrophysics Science Archive Research Center) at the NASA Goddard Space Flight Center. fitsTcl is primarily distributed as part of the fv FITS file editor. It is also available by itself below. The latest version is 2.3, released July, 2009. This is identical to the version in the most recent release of fv (version 5.3, released July, 2009).

XSPEC and tcl/tk

XSPEC uses the Tool Command Language (tcl) to process command input. Because tcl is a full scripting language, this interface allows users to write complex scripts with loops, branching, etc., which utilize XSPEC commands. In this section of the help file we describe how to use those features of tcl necessary to give the user similar functionality to that available in previous versions of XSPEC, and to give information on the details of our tcl implementation that may be useful to experienced tcl users. For a description of tcl, see, for example, "Practical Programming in Tcl and Tk", B. Welch, (1997, Prentice Hall).
Tk, tcl's companion graphical user interface (GUI) toolkit, is also loaded by XSPEC on startup. It is planned that future versions of XSPEC will provide an optional GUI side-by-side with the command line interface (CLI). Although XSPEC does not currently use tk, its presence allows users to write XSPEC scripts with graphical interfaces using Tk commands.

XImage and Tcl Scripting

Tcl Scripting

Tcl is a scripting language which provides new capabilities to the ximage command line beyond the program-specific commands, allowing for example if-branching and looping which was previously unavailable to ximage scripts.
This page is a primer for Tcl scripting in ximage and contains only basic Tcl commands. For a full reference of all Tcl commands, see the Tcl manual (Use command "puts $tcl_patchLevel" in ximage to determine version).

LHEATcl Plugin API

The LHEATcl Plugin is an enhanced version of the TCL Plugin version 2.0 source release. The version number of the current LHEATcl release is 2.0 despite the fact that it is the first official release in order to match the version number of the TCL plugin that it "descends" from. The LHEATcl Plugin adds the following extra features to the plugin:
  • The dash patch : This adds several missing things to the Tk canvas widget. These include dashed and stippled outlines, the "visitor" patch to allow easier extension of canvas capabilities, and postscript output for images. See the dash patch home page for details.
  • FitsTcl: This adds the ability to read and write FITS files. It is essentially a Tcl interface to cfitsio
  • POW: A scientific curve and image plotting and interface widget which uses the Tk canvas with several extensions to produced curve plots, images, contours, histograms, etc. Since y using the Tk canvas, user input can be done almost any way you wish.
  • The LHEA orbit library. This is currently under development and in release 2.0, only three functions are present which are built into the POW library, but in future releases, this will be a separate package adding spacecraft orbit calculation utility routines.
Follow the links above to get in depth information on any of the LHEATcl components. Documentation for the original Tcl plugin is here. What follows is a brief description of how the plugin works followed by some sample tclets.

Maki - XRS FOV and Multi-Mission Observing Windows


Maki is a tool designed to serve two purposes: investigating instrument Fields of View (FOV's), and viewing multi-mission observing windows.
Maki allows the user to plot a detector FOV onto a FITS image, further allowing the user to investigate different roll angles. This is useful, for example, for the case of an observation of an extended target which requires a specific roll angle. Maki allows the user to see when the target is observable for the given roll angle.
While previous versions of Maki allowed users to overlay FOV's directly via Skyview, the current version does not support this functionality. Further, at this time, Maki has only been built and tested on Linux and Solaris. We are working to port Maki to other platforms. If you do not have access to Linux or Solaris machines, please drop us a note.

No comments: