21 Examine Specified FITS Keywords

Often you will want to know the value of a given FITS keyword for each of a set of FITS files. It is straightforward to find the value of a keyword for a single file, but doing so manually can be tedious if have dozens (or hundreds) of files. Script fitsinfo.csh addresses this problem and gives the value of a named keyword for each of a set of FITS files.

Each FITS file is examined in turn and KAPPA application fitslist is used to list the contents of the header cards to a text file. The Unix utility grep is then used to extract the line for the required keyword from the file and this line is appended to the output file.

You give the script a list of input files (wild-cards are permitted), the required keyword (which must be in upper case) and the name of the output file in which the results are to be written.

Example

To find the value of keyword EQUINOX for all the FITS files in the current directory type:

  % fitsinfo.csh ’*.fit’ EQUINOX fitsdetails.txt

The values found are written to file fitsdetails.txt.