Subject: TNULL's in TABLEs.

From: zarate at scivax.stsci.edu
Date: Fri, 17 Jul 1992 17:13:58 GMT

Hello 

	I would like to ask the opinion of those who have written FITS
programs with TABLE extension, or have good idea what is the interpretation 
of the FITS NOST document when dealing with null strings on overlapping
fields.

	For example: A FITS TABLE descriptors for columns 6,7,8 are:

TTYPE6  = 'Class   '
TBCOL6  =                   54
TFORM6  = 'A5      '
TNULL6  = '*       '

TTYPE7  = 'Type    '
TBCOL7  =                   54
TFORM7  = 'A1      '
TNULL7  = '*       '

TTYPE8  = 'Class_No'
TBCOL8  =                   55
TFORM8  = 'I4      '
TNULL8  = '        '

	The FITS table data in one of the lines that have a null value
is:

	....... *  32

where the '*' is at column 54.

	My thougths about this are as follows:

     1)	The column 6 descriptor specified a width of 5 characters; so the
	data entry for the column is null, right?

     2) The column 7 descriptor specified a width of 1 character; so the
	data entry for the column is null, right?

     3) The column 8 descriptor specified a width of 4 character; so the
	data entry for the column is 32.

	If the above is correct, that this means that a correct null entry
for a 'A5' format is '* &+(' or it has to be '*    '; because '32' is
garbage for the column 6 specification since the fields overlap.
The NOST document in 8.1.2 says "TNULLn Keywords. ....The string is
implicitly blank filled to the width of the field".

Thank you
Nelson Zarate  (nelson at stsci.edu)
Space Telescoope Science Institute
Baltimore MD 21218

---

From: leb at Hypatia.gsfc.nasa.gov (Lee E. Brotzman)
Date: Sat, 18 Jul 1992 20:22:45 GMT

>	The FITS table data in one of the lines that have a null value

Wrong.  The NULL value given for field Class is "*    ", the given field is
"*  32" which doesn't match.

>	data entry for the column is null, right?

Right.  This field matches it's (one character) null value specification.

>	data entry for the column is 32.

Right.  This field has a valid data value.  The null value for field Class_No
is "    " (exactly four blank characters).

>implicitly blank filled to the width of the field".

Personally I think that this is a case of an error in the table data (although
I can't be sure, since the example is taken out of context).  If the Class Type
is NULL, then it seems to me that there shouldn't be a Class Number.  Also, I
think that the header is ill-formed (God, I hope that it isn't one of *my* 
headers from the ADC CD-ROM :-).  Overlapping fields, while legal, can be 
confusing as this case shows.  I think that this table would be better 
specified as:

TTYPE6  = 'Class_Type'
TBCOL6  =                   54
TFORM6  = 'A1      '
TNULL6  = '*       '

TTYPE7  = 'Class_No'
TBCOL7  =                   55
TFORM7  = 'I4      '
TNULL7  = '        '

--
-- 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