[fitsbits] TDIMn

William Pence William.D.Pence at nasa.gov
Tue Aug 31 10:59:29 EDT 2004


Clive Page wrote:
> 
> On Mon, 30 Aug 2004, William Pence wrote:
>>
>>B.3  The "Substing Array" convention
>> 
>>I'm not aware of any software packages or any FITS data files that support
>>or use the full form of this proposed convention, as in these examples:
>> 
>>TFORMn = '30A:SSTR10'      / fixed length 10-char substrings
> 
> I have used this convention myself for FITS files I have generated and
> used internally, but I am not sure that it has been used much in files
> distributed externally.  If one wants a vector column of a numerical data
> type one simply uses e.g. 5E rather than 1E, which is simple to do and
> understand.  The same facility for strings needs the fixed-length
> substring notation, otherwise you just get an array of chars.

If it is only necessary to support arrays of fixed length substrings in a 
FITS binary table column, then the TDIMn convention could be used, and there 
would be no need for the substring conventions.  So instead of

    TFORM2 = '30A:SSTR10'
or
    TFORM2 = '30A10'

one would have:

    TFORM2 = '30A'
    TDIM2  = '(10,3)

where it is understood that the size of the most rapidly varying dimension 
(10 in this case) should be interpreted as the length of each substring. 
This usage is discussed in the B.2 and B.3 appendices to the Nost FITS Standard.

The more complex 'SSTR' convention would only have to be used to support 
arrays of variable length substrings, as in

    TFORMn = '30A:SSTR10/037'

which in this case means that the table column is 30 characters wide and 
contains variable length substrings that are each terminated with a '%' 
percent character (ASCII 037) with a maximum length of 10 characters. 
Examples of the table fields in this case might look like this:

    'Robert%Joe%James%Alexander%Sue'
    'Sally%Thomas%Natalie%Guillaume'

where the first row contains 5 substrings and the 2nd row has 4 substrings. 
  I wonder if there is really much need for this feature for astronomical 
data files?  If VOTables support this sort of data structure (?) then we 
might also need this capability within FITS for data interoperability.

Bill
-- 
____________________________________________________________________
Dr. William Pence                          William.D.Pence at nasa.gov
NASA/GSFC Code 662         HEASARC         +1-301-286-4599 (voice)
Greenbelt MD 20771                         +1-301-286-1684 (fax)





More information about the fitsbits mailing list