Subject: Hierarchical keywords

From: [email-masked] (Don Wells)
Date: Thu, 26 Oct 89 14:54:15 EDT

----- Begin Included Message -----

Date: Thu, 26 Oct 89 13:50:06 EDT
From: "ESOMC0::PREBEN"@cvax.CV.NRAO.EDU
Subject: Hierarchical keywords
To: [email-masked]
X-Vms-Mail-To: NRAO::DWELLS
Message-Id: <[email-masked]>

                 Comments on Hierarchical Keywords in FITS
                -------------------------------------------
                               Preben Grosbol
                                1989-Oct-26

There are several reasons to consider a hierachical concept for keywords
in FITS. The main arguments for a more flexible syntax than the one
offered for basic FITS keywords are:
 1) A total of 8 characters is too limited to give a meaningfull
    description of the content.
 2) The small size of keywords increrase the chance of different 
    institutes using the same keyword with different meaning.
 3) There are not clear definition of the name space for keywords which
    can avoid multi-defined keywords.
 4) The general problem of encoding small arrays as keywords is not solved.

A solution to the three first items was proposed by AIPS (using HISTORY
cards). It was refined with the concept of subject/group reserved
keywords like SNGLDISH for the Single Dish community. A more general
definition for a HIERARCH keyword was then put foreward based on the
AIPS and Single Dish experience.

The main argument against the HIERARCH is number of redundent characters
defining the high levels. This limits the usefull part of the 80 character
card significantly. The suggestion of Bob Hanish to introduce a HKBEGIN
and HKEND keywords to define the hierarchical level and use the basic keyword
syntax for the lowest level would solve the first requirement and make more
efficient usage of the limited space on a FITS keyword card. However, it
makes the present situation even worse for 2) and 3). It would allow
new low-level hierarchical keywords to be placed in column 1-8 where
old FITS readers would mix them with other simple non-standard FITS
keywords. It is MUST be ensured that additions to the FITS standard does
not generate wrong results even for old readers. This was the case with
the General Extensions, Blocking and Floating Point agreements.
Thus, the proposal of Bob Hanish for HKBEGIN/HKEND is NOT acceptable
due to the wrong interpretation of old FITS readers. The new concept
of hierarchical keywords MUST look like comments to old readers.

A number of options will provide acceptable solutions. Two main groups
could be discussed:
 1) The proposal already presented by Grosbol and Wells of type:
        HIERARCH level1 level2 level3 .. .. keyword = value / comment
 or 
 2) A mix of this and the proposal of Hanish:
        HIERARCH BEGIN level1 level2 level3 .. ..
        HIERARCH keyword = value           / comment
        HIERARCH END

where the HIERARCH keyword can be exchanged with any other reasonable
combination of letters. The 'level1' identifiers must be controller
and should either be allocated to subject or groups.

With the choice of a special keyword (e.g. HIERARCH) one can upgrade
the syntax for the remaining of the card. It would be possible to
include a concept of small arrays in one of the following styles:

 1)  HIERARCH ARRAY(4) = 1, 2, 3, 4 / comment
    indicating an array with 4 elements in F77 list format of the type
    of the first element.

 2)  HIERARCH ARRAY(2..4) = 223.2, 33.3, -0.4 / comment
    indicating array elements 2, 3 and 4 in F77 list format of the type
    of the first element.

 3)  HIERARCH ARRAY(4I) = 1, 2, 3, 4 / comment  
    indicating an array with 4 elements in F77 list format of integer type.

To provide space for small arrays a continue card would be needed. It
could be done by repeating the first keyword part (AIPS style) or
as the last non-comment character use a special sign e.g. '-'.

----- End Included Message -----