BAIT: pformat command

NAME

pformat - to print formatted lists of keyword values.

SYNOPSIS

pformat [symbol,%s[,default]] .. files

DESCRIPTION

This program reads the files on the command line, which may be either pseudo or true FITS files, and extracts the values of the specified keywords. The required format specifier is similar to that used by the printf() function. An optional default value for the symbol may be specified. This value is used if the symbol is not present in the file, otherwise the program will not write a line to stdout but instead write a message to stderr.

If the the symbol is a arabic number then the program prints out the specified field from the first card after the END statement. This stupid feature is only available for pseudo FITS files.

There are two strange exceptions: the keyword `file_id' is interpreted as the name of the file stripped of the leading path and trailing extension just like the reqid (see example). and the keyword `file_name' is interpreted as the name of the file with full path and extension.

EXAMPLES

The command:

pformat object,%-7s datid,%s filters,%4s exptime,%.0f *.fts

Would print out lines like:

dark Dec36xdr U 600

NGC6689 Dec37emw
R 120
NGC6703 Dec37epv
R 120
NGC7448 Dec37erh
R 120
NGC7479 Dec37esw
R 120 NGC224 Dec37euf R 120

The command

pformat object,%-7s observer,%-9s,anon exptime,%.1f Mar*.fts

Prints out lines like:

Orion Forenzi 23.0
Gammag anon 34.5
OrionH3 Stevens 30.0

The command

pformat file_id,%8s observer,%-9s,anon ~bait/targets/*.rqs

Prints out lines like:

Mar3axdf Henry_Forenzi
Mar3cydf anon
May4cydf Stevens

BUGS

pformat only prints out keyword values from the first stanza of a pseudo fits file.