Subject: Binary Table Character Strings 2 Cents

From: [email-masked]
Date: Tue, 15 Dec 92 15:59:40 PST

On the handling of character strings in FITS binary tables,
here are the questions I see:

  1. How should FITS represent "b bytes composed of n strings
     of w characters each"  (b = n * w) ?
 
      (A) "TFORM = nAw"
 
      (B) "TFORM = bAw"
 
      (C) "TFORM = bA" and "TDIM = '(w,n)'"

  2. What should "TFORM = wA" mean?
 
      (A) w characters of unspecified structure
 
      (B) one string of w characters
 
      (C) w strings of one character each (any or all may be nulls)

  3. Should strings be allowed to be null terminated ?
 
      (A) yes, remaining bytes in string length are ignored
 
      (B) no, must blank fill

The most logical (best) to me is "A" for each of the above.
 
However, we have no existing binary table files at this time,
and I suspect this is not the case for all institutions.
There are probably existing archives of FITS binary table
files that are inconsistent with the "A" choices above.
If so, I'd be willing to support any of the other choices.
Is there a way to get a list of any such archives ?
 
 Bob Narron

---

From: [email-masked] (William Pence)
Date: Wed, 16 Dec 92 11:40:55 EST

>       (C) "TFORM = bA" and "TDIM = '(w,n)'"

My FITSIO software was originally written to support (A).  However, when it appeared
that the European FITS committee had voted to approve the binary table definition
document in its current form, then I modified FITSIO to only support the (B) format
which is in compliance with the binary table definition document.  This change occurred 
with version 3.21 of FITSIO which was released in July 1992.  Note that under this
convention I interpret TFORM = 'nA' to mean the same thing as TFORM = 'nAn'

>       (C) w strings of one character each (any or all may be nulls)

In the absence of any other information or conventions, I think this should mean
that the field contains one string, which is either blank filled or null terminated.

>       (A) yes, remaining bytes in string length are ignored

The current draft of the binary table definition document states that "A character
string may be terminatated before its explicit length by an ASCII NULL character".
I see no reason to change this.
 
> Is there a way to get a list of any such archives ?

I'm not aware of any archival FITS data which has used anything other than the
simple TFORM = 'nA' for ASCII character columns in binary tables.

I think the main objection that has been raised to this convention is
that it is not general enough and does not define how to specify arrays
of terminated strings.  This is what we still need to work on.

-Bill Pence