Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://www.adass.org/adass/proceedings/adass94/blackburnj.ps
Äàòà èçìåíåíèÿ: Tue Jun 13 20:43:32 1995
Äàòà èíäåêñèðîâàíèÿ: Tue Oct 2 02:53:31 2012
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: ï ï ï ï ï ï ï ï ï
Astronomical Data Analysis Software and Systems IV
ASP Conference Series, Vol. 77, 1995
R. A. Shaw, H. E. Payne, and J. J. E. Hayes, eds.
FTOOLS: A FITS Data Processing and Analysis Software
Package
J. K. Blackburn 1;2
NASA Goddard Space Flight Center, Code 664.0, Greenbelt, MD 20771
Abstract. FTOOLS, a highly modular collection of over 110 utilities
for processing and analyzing data in the FITS (Flexible Image Transport
System) format, has been developed in support of the HEASARC (High
Energy Astrophysics Science Archive Research Center) at NASA's God­
dard Space Flight Center. Each utility performs a single simple task such
as presentation of file contents, extraction of specific rows or columns,
appending or merging tables, binning values in a column or selecting
subsets of rows based on a boolean expression. Individual utilities can
easily be chained together in scripts to achieve more complex operations
such as the generation and displaying of spectra or light curves. The
collection of utilities provides both generic processing and analysis util­
ities and utilities specific to high energy astrophysics data sets used for
the ASCA, ROSAT , GRO , and XTE missions. A core set of FTOOLS
providing support for generic FITS data processing, FITS image analysis
and timing analysis can easily be split out of the full software package
for users not needing the high energy astrophysics mission utilities. The
FTOOLS software package is designed to be both compatible with IRAF
and completely stand alone in a UNIX or VMS environment. The user
interface is controlled by standard IRAF parameter files. The package is
self documenting through the IRAF help facility and a stand alone help
task. Software is written in ANSI C and fortran to provide portability
across most computer systems. The data format dependencies between
hardware platforms are isolated through the FITSIO library package.
1. Introduction
The FTOOLS software project began in late 1991 (Pence 1992) as part of a
goal to standardize high energy astrophysics data sets to the FITS (Wells et al.
1981) format at NASA's HEASARC. The earliest releases of FTOOLS consisted
of a collection of tools for creating, viewing, and manipulating data sets using
the FITS format. Today, the FTOOLS software has grown into a collection of
subpackages supporting not only generic manipulation of FITS formatted data,
1 Hughes STX Corporation, 4400 Forbes Blvd., Lanham, MD 20706
2 HEASARC
1

2
IRAF Main Routine
(spp code)
Application Subroutines
(ANSI FORTRAN & C source code)
ANSI
Files
FITS
Files
FORTRAN
I/O
FITSIO
I/O
machine/environment independent layer
environment dependent layer
HOST Main Routine
(C code)
machine/environment independent layer
User Interface
Parameter File
IRAF HOST
IRAF HOST
IRAF Parameter Interface
(STSDAS Library) HOST Parameter Interface
(XPI Library)
machine dependent layer
environment
Unix, VMS, IRAF
Make, make.com, mkpkg
ANSI C & FORTRAN
development
libraries
core package
subpackages
FTOOLS, FITSIO, XPI, PGPLOT, SmallXAN
fimage, futils, time
asca, caltools, gro, heasarc, rosat, xte
(...a subpackage for your project)
Figure 1. FTOOLS Task and Package Design.
but also tools for data analysis of high energy astrophysics missions using the
FITS standard such as ASCA, GRO , ROSAT , and now XTE.
1.1. Portability
In the design of the FTOOLS, portability was given the highest consideration.
The software specifications called for ANSI fortran and C as the base lan­
guages. To bind the differences in these languages between supported archi­
tectures, the C macro package Cfortran develop by Burkhard Burows and
distributed by CERN is used. The FTOOLS design also required a common
user interface in the three most popular environments used by the astronom­
ical community today, UNIX, VMS and IRAF. Under UNIX and VMS, the
FTOOLS are referred to as stand­alone or ``Host'' to distinguish this environ­
ment from IRAF. However, the user interface to the FTOOLS is identical in all
environments. To achieve this cross environment support, a user interface based
on the IRAF parameter file was adapted. This particular interface provides for
command line assignment of any or all parameters, range checking, defaults and
user prompts. By isolating the interface to the data and parameter files files to
standardized subroutines common to all environments, the differences in making
FTOOLS for UNIX, VMS and IRAF are resolved by linking to the appropri­
ate libraries such as IRAF or the stand­alone XPI parameter interface. This is
illustrated to the left in Figure 1.
1.2. Open Development
The FTOOLS software package is layered into a collection of subpackages sup­
porting a generic (or core) set of tools and a collection of subpackages for specific
missions in high energy astrophysics. These subpackages are layered over the
necessary libraries and environments that the FTOOLS build under. This is
illustrated to the right in Figure 1. By having this layering, additional subpack­
ages supporting new missions or even the particular needs of an individual user
or project can easily be plugged into the FTOOLS package with minimal edits
to underlying layers.

3
1.3. On­line Help
On­line help is available for each of the tasks distributed with the FTOOLS.
Under IRAF, help is obtained just as with any other IRAF task. Under the
stand­alone Host FTOOLS, a specialized FTOOL named fhelp is used to access
the on­line help database. In both cases, simply follow the appropriate help com­
mand with the name of the FTOOLS task. The on­line help presented provides
a usage, description, list of options (through the parameters) and examples.
2. Example
As an example of the use of the FTOOLS, consider a FITS data set of photon
events from an supernova remnant made by an X­ray imaging telescope which
has within its field of view a calibration source. First the structure of the FITS
dataset needs to be determined. This is accomplished with the fstruct task.
Using the Host FTOOLS this would look like
ftools.gsfc.nasa.gov kent[1] % fstruct raw.evt
No. Type EXTNAME BITPIX Dimensions(columns) PCOUNT GCOUNT
0 PRIMARY 32 0 0 1
1 BINTABLE EVENTS 8 30(12) 55753 0 1
2 BINTABLE STDGTI 8 16(2) 139 0 1
From this it is determined that the photon events are located in the first
extension, which is a FITS binary table extension with 55753 rows (events).
Now determine the format of the table using the flcol task to list the names of
the columns
ftools.gsfc.nasa.gov kent[2] % flcol raw.evt+1
———Column—Names—————————Formats——————————Units———
TIME 1D s
X 1I pixel
Y 1I pixel
PHA 1I channel
PI 1I channel
RISE—TIME 1I
There are several columns in this data set. Using the X and Y columns,
basic statistics can be learned about these columns with the fstatistic task or
an image can be built up from the photon list using the f2dhisto. Using the
PHA column and the fhisto task a quick­look spectrum can be made and viewed
with fplot (see spectrum to the left in Figure 2).
Now through the use of these FTOOLS tasks one determines that the su­
pernova remnant is centered at (114,129) in the pixel space of the image with
a radius of 40 pixels. Using the fselect task to select out only the photons
associated with the supernova and the background and then the fhisto task on
the resulting supernova events, the spectrum on the right in Figure 2 having no
calibration peak is binned and then viewed.

4
counts
channel channel
counts
Figure 2. Raw spectrum on left showing supernova remnant with
calibration source and the spatially filtered spectrum to right.
ftools.gsfc.nasa.gov kent[3] % fselect raw.evt+1 snova.evt
Name of output FITS file[] snova.evt
Selection Expression[] sqrt((X­114)**2 + (Y­129)**2) ! 40
ftools.gsfc.nasa.gov kent[4] % fhisto snova.evt+1 spec.fits PHA 1
The FTOOLS distribution comes complete with a User's Guide which has
a short tutorial going into more detail about using FTOOLS. Other references
discussing FTOOLS are found in Blackburn & Pence (1994). The IRAF docu­
mentation are also available to learn more on the FTOOLS software package.
3. Distribution
The FTOOLS software package is available to the public with access to the
Internet. It is distributed as a compressed tar file through anonymous ftp from
legacy.gsfc.nasa.gov. In the directory software/ftools/release you will find
the a README file, release notes, source code, reference data for ASCA data
analysis, and documentation covering the installation, usage, and development
of the FTOOLS software. Further information on the FTOOLS can be found
on the World Wide Web at the FTOOLS Home Page 1 .
Acknowledgments. I am grateful to all the members of the FTOOLS
group at the HEASARC for the effort they have made in bringing together
under one paradigm, a significant and useful astronomical software package.
References
Pence, W. 1992, Legacy ­ The Journal of the HEASARC, 1, 14
Wells, D. C., Greisen, E. W., & Harten, R. H. 1981, A&AS, 44, 371
Blackburn, J. K., & Pence, W. 1994, Legacy ­ The Journal of the HEASARC,
4, 5
1 http:://heasarc.gsfc.nasa.gov/0/docs/software/ftools/ftools menu.html