[Back to the main proposals page]

Proposal 2: To increase the allowed length of string keyword values

Definition

This long string-valued keyword proposal provides a mechanism for assigning a character string value to a FITS keyword that is longer than can be expressed on a single 80-character keyword record. The long character string value is divided into multiple substrings, each of which is short enough to fit on a single keyword record. (Any single quote characters that are embedded within the string must first be expanded into two successive single quote characters). A back slash (`\') continuation character is appended to all but the last substring, then all the substrings are enclosed within single quote characters and written to a sequence of 80-byte keyword records. The first keyword record is constructed using the actual keyword name; the keyword names on all the subsequent continuation keyword records have an underscore character followed by an integer sequence number appended to that same name. The sequence number on the first continued keyword record must be the number 1 (without any leading zeros) and the sequence number is incremented by 1 on each subsequent keyword. It is recommended, but not required, that these keywords appear in order in the FITS header without any intervening keyword records.

The first keyword in the sequence has the `= ' value indicator between the keyword name and the value string. All the subsequent keyword records do not have the value indicator; the keyword name and the quoted substring are simply separated by one or more space characters. Thus, under the current rules of the FITS Standard, the continued keyword records do not formally contain a keyword value.

Examples

The following keyword records conform to this convention:

00000000011111111112222222222333333333344444444445555555555666666666677777777778
12345678901234567890123456789012345678901234567890123456789012345678901234567890
ABSTRACT= 'Fifteen spirals are now available for which the sense of the spiral\'
ABSTRACT_1 ' pattern and the sense of the spectrographic rotation are known an\'
ABSTRACT_2 'd in which there is conspicuous dissymmetry of obscuration.'

Note that it is not required that each substring completely fill each keyword record. In principle, each keyword record may also contain a comment field, as shown below.

00000000011111111112222222222333333333344444444445555555555666666666677777777778
12345678901234567890123456789012345678901234567890123456789012345678901234567890
ABSTRACT= 'Fifteen spirals are now available \'    / Article by E. Hubble       
ABSTRACT_1 'for which the sense of the spiral \'  / published in 1943          
ABSTRACT_2 'pattern and the sense of the spectrographic \'  / in the Ap.J.     
ABSTRACT_3 'rotation are known and in which there is \'                        
ABSTRACT_4 'conspicuous dissymmetry of obscuration.'

Discussion

This proposal assumes that the keyword names may be more than 8 characters long, as described in Proposal 1.

The main advantage of this proposal over the existing CONTINUE convention to represent long string values, that has been in use for many years (especially within the high-energy astrophysics community), is that the current proposal explicitly defines the order of the continued keywords and hence is not affected if the order of the keywords in the FITS header is changed.

The back slash continuation character serves as a flag to the keyword reading software that this keyword record is probably continued on another keyword record. The continuation character is appended to the character string itself (rather than external to the string value, for example, in the 80th character of the keyword record) to make the continuation character more prominent to both software and to human readers. Note that if a keyword string value ends with the continuation character, but there is no valid continued keyword record in the FITS header, then that continuation character should be considered to be literally part of the value string.

The lack of the `= ' value indicator in the continued keyword records serves to help insulate them from corruption by existing software that does not support this convention. Since these keyword records do not formally contain a value, it is less likely that existing software would attempt to modify them. Such software should treat these keywords in the same way as COMMENT or HISTORY keywords that also do not have a value.