Picksym -- print a FITS header keyword or value

This program gets a header-line value from a true FITS image, or from a pseudo-FITS file (which is an ASCII text file containing FITS-like keyword=value pairs, one per line).

The syntax is:

   picksym  file=name  [default=xxx]  [nostrip]  symbol  [quiet]  [stanza=n]
The program prints out the value of the symbol, if found, and exits with code 0. If the symbol is not found, but default=xxx is specified, then xxx is printed out and 0 returned. If the symbol is not found and no default is given, then a message is printed to stderr and a non-zero exit code is returned. If quiet is specified, an error message is not printed if the given symbol cannot be found in the file.

Unless the stanza keyword is given, only the first stanza of a request file is searched; with it, any stanza can be specified. For true FITS files, of course, there is only one stanza.

Note that symbols which are surrounded by apostrophes (i.e. string symbols) will have their apostrophes removed unless the nostrip keyword is given; in that case, they will be left as is. Example:

  $ more sample.fts
  SIMPLE  =                    T / file does conform to FITS standard 
  BITPIX  =                   16 / number of bits per data pixel     
  NAXIS   =                    2 / number of data axes              
  NAXIS1  =                 2032                                   
  NAXIS2  =                 2029                                  
  OBSERVER= 'Fred Smith'
  ...

  $ picksym file=sample.fts observer
  Fred Smith

  $ picksym file=sample.fts observer nostrip
  'Fred Smith'

Also note that COMMENTs are handled separately, but in a rational fashion: typing

          picksym file=foo comment
will print out ALL of the comment lines in the first stanza of file "foo".