spacer link to MAST page spacer logo image spacer
link to STScI page

Reading BEFS FITS files in IRAF

The BEFS fits files may be read into IRAF by using STSDAS tasks as described in the following.

The structure of the files may be reconnoitered by first invoking IRAF and then STSDAS and running "catfits" on them. Using as an example the file "BEFS1020.SPD1":

st >   catfits BEFS1020.SPD1


0     BEFS1020.SPD1 BEFS1020.SPD1                 16    ALF CMI
1     BINTABLE      SPECTRUM          12Fx1R
2     BINTABLE      2NDORDER          4Fx1R

This tells us the names of the extension files which are "SPECTRUM" and "2ND_ORDER" and the number of columns in each of the table files. (Running "catfits" on the files SPA1, SPB1, or SPC1 for the other wavelength segments would of course give only the primary and first extension files.)

Reading the Files

To read and manipulate the BEFS FITS files further, load the ttools package. This will read by default the first table extension, so the extension identifier following the file name is not needed in most cases; in cases where the 2ND_ORDER extension is needed this identifier is denoted by "[2]".

Also check to see what version of STSDAS/TABLES your machine is running. If it is earlier than version 2.1, many tasks will not work unless you rename the file extension "fits".

Running IRAF-based Commands

Many IRAF/STSDAS tasks and all ttools may now be run on the BEFS file. To run most of them you must know in advance what the column names are. To see them, type:

tt > tlcol BEFS1020.SPD1

and the 12 column names are printed out (you may use them in lower or upper case).

To plot the spectrum, type:

tt > sgraph "BEFS1020.SPD1[1][r:row=1] wavelength flux_phot"

Note in the TABLES notation the first bracket in the above is optional because the first extension is the default option.