Previous: Local FITS Conventions supported by FITSIO
Up: Local FITS Conventions supported by FITSIO
Next: Arrays of Strings in Binary Table Extensions
Previous Page: Local FITS Conventions supported by FITSIO
Next Page: Arrays of Strings in Binary Table Extensions

Support for Long String Keyword Values.

The length of a standard FITS string keyword is limited to 68 characters since it must fit entirely within a single FITS header keyword record. In some instances it is necessary to encode strings longer than this limit, so FITSIO supports a local convention in which the string value is continued over subsequent comment keywords which have a blank keyword name. The specific convention that is used is that a backslash character is appended at the end of each line which is to be continued, and then the string is continued on the next keyword in the FITS header which has a completely blank keyword name. The continued string value is also enclosed in quotes but there is no equal sign in column 9 of the continuation keyword. The string value may be continued in this way over as may additional blank keywords as is required. Note that FITS software that does not recognize this convention will simply read the first line of the string keyword, and will interpret the subsequent 'continuation' lines as COMMENT keywords. The following lines illustrate this convention:

LONGSTR = 'This is a very long string keyword\'  / Optional Comment
          ' value that is continued over 3 keywords in the \'
          'FITS header.' / Another optional comment may be put here.
This convention is transparently supported by all the FITSIO subroutines which read, write, insert, modify, or delete string keywords. To write a long string keyword value using this convention, one simply has to pass the long string value to the appropriate subroutine (e.g., FTPKYS). The FITSIO subroutine will internally break up the string into the separate continuation keywords and write them all to the header. Similarly when reading a long keyword string, one only has to take care that the string value parameter in ftgkys has been declared long enough to hold the entire string, otherwise the returned value will be truncated to the length of the string variable.

asterix@space.starlink
Wed Feb 16 08:18:45 GMT 1994