Header items can be stored in hierarchical structures.4 What this actually means is that a header item can be used as a ``container'' to store other items (which are known as components). Hierarchical items are distinguished by using a period sign in the name to separate their various components. So, for instance, if you had a series of values that described a useful region on an image you might write these out using something like:
* Store the useful region of this image.
CALL HDR_OUTI( 'OUT', 'MYSOURCE', 'USEFUL.MINX', ' ',IXLOW, ISTAT )
CALL HDR_OUTI( 'OUT', 'MYSOURCE', 'USEFUL.MAXX', ' ',IXHIGH, ISTAT )
CALL HDR_OUTI( 'OUT', 'MYSOURCE', 'USEFUL.MINY', ' ',IYLOW, ISTAT )
CALL HDR_OUTI( 'OUT', 'MYSOURCE', 'USEFUL.MAXY', ' ',IYHIGH, ISTAT )
The number of sub-components and the level of hierarchy isn't
restricted, so more elaborate structures are possible (but not
necessarily desirable).
You can examine the header items in an image by using the HDSTRACE program (SUN/102). If your image file is called image then you would use the command:
% hdstrace image.more.mysourceto see the contents of the source 'MYSOURCE'. To list the contents of a FITS source the most convenient method is to use the KAPPA program FITSLIST (SUN/95).
If you have any hierarchical FITS headers (these were once used extensively by UK observatories), then they should look something like:
ING DETHEAD = 'CCD-RCA2' /Type of detector head
when examined by FITSLIST. To access this
item using IMG you should call it 'ING.DETHEAD'.
The value of this item is shown being read by the example
program
hdrread.f
(see §
) next:
% hdrread ITEM - Header item > ING.DETHEAD IN - Input image > image The header item 'ING.DETHEAD' has a value of CCD-RCA2. %Hierarchical items are processed as normal by the HDR indexing routines (§
). Each
component item counts only once and no significance is attached to the
fact it may be part of a hierarchy. When retrieving an indexed header
item, its name is returned in full, including all the necessary
periods.
IMG Simple Image Data Access