If a template keyword name ends with a "#" character, it is auto-indexed. The parser replaces the '#' with the current integer keyword index value in the FITS header. The first keyword field encountered in a given HDU definition ending with '#' is used as the index value incrementor. Each time this keyword field (also ending with '#') is encountered in the header definition the index value is incremented by 1.
All keyword fields ending with '#' encountered between index value incrementor keyword fields are assigned the current index value. The resulting FITS keyword (i.e., after the '#' is replaced with the index value) must be 8 characters or less in length. The following example demonstrates the auto-indexing feature:
Template Record Resulting keyword (in GROUP HDU add 6) DUMMY DUMMY PARAM# PARAM1 DUMMY# DUMMY1 PARAM PARAM PARAM# PARAM2 TEST# TEST2 PARAM# PARAM3 TEST# TEST3
The index value and index value incrementor keyword field are reset to 1 for each HDU or to 7 for each GROUP defined in the template.