Subject: logical variables

From: jwright at cfht.hawaii.edu (Jim Wright)
Date: Sat, 19 Sep 1992 00:19:27 GMT

An excerpt from the NOST 100-0.2f FITS Draft Standard, dated May 14, 1991:

| 5.3.2.2 Logical Variable
|
| If the value is a logical constant, it shall appear as a T or F in
| column 30.

(This is the entire section !)

I would like to initialize all cards to values that show the card has not
yet been filled out, and then put in the real values.  For example,

LAMPON   =                     ?          / lamp on during exposure

And then at exposure time fill out the card with "T" or "F".  This way it
is very obvious if the card contains valid data or not.  Is this acceptable?

Yes, not putting the card in until the time it is filled out is best.  But
that is not an option for us.  The entire FITS header is built before an
exposure and individual cards are given their values during the course of
the exposure.

--
Jim Wright
jwright at cfht.hawaii.edu
Canada-France-Hawaii Telescope Corp.

---

From: leb at Hypatia.gsfc.nasa.gov (Lee E. Brotzman)
Date: Sat, 19 Sep 1992 04:29:52 GMT

>(This is the entire section !)
                     ^^^^^^^
Actually its a sub-sub-sub-section and this is a standard, not human-readable
text.  :-)

>is very obvious if the card contains valid data or not.  Is this acceptable?

The 'T' in FITS is for Transport.  Until you try to transport the FITS file,
anything goes.  Your internal processing of the FITS file, and especially
intermediate results, are not important.  Do whatever is the most efficient and
reasonable for your application.  If you try to transport the FITS header with
question marks instead of valid boolean 'T' or 'F', however, FITS readers the
world over will throw up all over your file.

I'm working on a program that extracts records from one FITS table and puts them
into another FITS file.  Obviously, I don't know the number of records I'm
going to extract until I am done, so I put a 0 in the NAXIS2 record in the
extension header.  Then when I have finished the extraction I reposition the
file pointer to the appropriate record position and fill in the proper number
of records that were extracted.  The intermediate file is in violation of the
standard, and if the program aborted for some reason before it filled in the
NAXIS2 record, and I tried to palm off the file as correct, I would be
violating the standard. 

The bottom line is, use templates for filling out FITS headers, make sure you
complete the template, and perhaps include a post-processing step that will
strip out -- with appropriate warning messages -- unfilled records.

--
-- Lee E. Brotzman                    Internet:  leb at hypatia.gsfc.nasa.gov
-- Hughes STX                         DECNET:    NDADSA::BROTZMAN
-- National Space Science Data Center BITNET:    ZMLEB at GIBBS
-- NASA Goddard Space Flight Center